Skip to end of metadata
Go to start of metadata

On this page I will describe how to replace a vanilla menu with your own. For example I will change the traderestrictionsmenu

At first you should create the following things in your mod folder:

  1. ui.xml
  2. ego_detailmonitorHelper.xml
  3. A Folder which is named ui

Now copy the traderestrictions.lua in your folder ui and rename it. For example in my case I named it FC_traderestrictions.lua.

Now we begin with the modding. We create the ui.xml and the ego_detailmonitor.xml

The following code is for the ui.xml:

 

meanings:

  1. environment type="detailmonitor" = That's the environment/type of monitor you are working with.
  2. file name="ui/FC_menu_traderestrictions/FC_menu_traderestrictions.lua" = Thats the path of your lua file
  3. dependency name="ego_detailmonitorHelper"= Thats the line for the depency. In my example i use the DetailmonitorHelper
  4. addon name="FC_Traderestriction" = This specifies the name of the addon.

The following code is for the detailmonitorHelper.xml:

 

 

The following Codelines are to delete the old menu:

 

 

 

After deleting the old menu you can add your own code after that. For examples please write a PN to me  FindolCaleb at the Egosoft Forum ( because the maincode is too long for this page)

3 Comments

  1. Anonymous

    Code can be attached to page as files.

  2. Anonymous

    Did you forget to mention to add a folder named "FC_menu_traderestrictions" inside the "ui" folder ? im confused because your file path seems to suggest a folder "FC_menu_traderestrictions".

    <file name="ui/FC_menu_traderestrictions/FC_menu_traderestrictions.lua" />

     

    Also can you be more specific on how to do this ? for example i just wanted to change a function in the "PlatformsMenu". my target function is the "displaymenu" where it changes the fonts to red for enemies but neglected to color player owned NPCs in his station to green. i wanted to add this feature so that they are colored green and can be easy to spot against the spawned NPCs in player owned stations. how do i do that ?

  3. Anonymous

    Also how will that last code get executed ? should i add init() at the bottom ?