Anyone know how inject an info text into custom menus?
Specifically for arrow entries, as they don't return from the menu.
I do not mean "add custom menu info line", although that's where it will show up obviously.
I know there is an intricate method to this, except I don't recall how it was done.
- Orf. The Muxmaster.
[question]Injecting info in menus on mouseover[RESOLVED]
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
[question]Injecting info in menus on mouseover[RESOLVED]
Last edited by Orfevs on Sun, 16. Feb 14, 04:57, edited 1 time in total.
TCAN TC/AP Artificial Life, Menudriven Automated Ship/Station Namer
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.
The menu is just an array so to inject menu items you would just modify it using array manipulation commands. So lets say script A opens a menu, script B needs to monitor the menu array to detect when the value selection menu item changes and make modifications to the menu array based on the value selected.
For examples you can look at Lib Scrat: http://forum.egosoft.com/viewtopic.php?t=261816
You can also copy the pattern I've developed for my mods which make dynamic menus a lot more linear and can be found in my Ship Browser mod. The pattern uses 3 script files which are reusable for every menu you make:
You can find my implementation of this pattern at https://github.com/Zanzal/ShipBrowser/t ... er/scripts.
For examples you can look at Lib Scrat: http://forum.egosoft.com/viewtopic.php?t=261816
You can also copy the pattern I've developed for my mods which make dynamic menus a lot more linear and can be found in my Ship Browser mod. The pattern uses 3 script files which are reusable for every menu you make:
- createmenu: takes parameters packs them into an array which I call $handle. Includes a placeholder for a result value at index 0 and returns the $handle array after STARTing the menu script.
ismenuopen: returns [TRUE] if the menu is still open and waits for a 100 ms if it is
menu: opens the menu packed into the $handle array - intended to be called by createmenu using START so it runs in a separate task
Code: Select all
$menu = ... your menu array ...
$handle = [THIS]-> call script 'lib.zanzal.createmenu' : title=$title.text heading=null menu.items=$menu large.menu=[TRUE]
while [THIS]-> call script 'lib.zanzal.ismenuopen' : handle=$handle
* Check your $menu indexes for updates and respond by modifying $menu as needed.
end
$result = $handle[0]
Just the words "separate task" made me want to take a very long walk, then run all the way back and smash my head into something breakable..
Thank you for lodging me out of the hole I dug for myself!
EDIT:
The info is extremely helpful as well, so I guess my menus will change a little
Thank you for lodging me out of the hole I dug for myself!
EDIT:
The info is extremely helpful as well, so I guess my menus will change a little
TCAN TC/AP Artificial Life, Menudriven Automated Ship/Station Namer
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.