Gui events
Posted: Sun Nov 15, 2009 4:16 pm
Can i run some code if when docked with main station player opens shipyard gui or opens commodities gui e.t.c
T.Y for any help.
T.Y for any help.
Code: Select all
this.guiScreenChanged = function(to, from)
{
... your code here ...
}
It is the same as in the game. Here is the complete list of GUI_SCREENs:Rustybolts wrote:Ty I thought it was this command. Is there a list of each of these screens somewhere or are they all called the same as they are labled inside the game when playing?
Code: Select all
GUI_SCREEN_MAIN,
GUI_SCREEN_INTRO1,
GUI_SCREEN_INTRO2,
GUI_SCREEN_STATUS,
GUI_SCREEN_MANIFEST,
GUI_SCREEN_EQUIP_SHIP,
GUI_SCREEN_SHIPYARD,
GUI_SCREEN_LONG_RANGE_CHART,
GUI_SCREEN_SHORT_RANGE_CHART,
GUI_SCREEN_SYSTEM_DATA,
GUI_SCREEN_MARKET,
GUI_SCREEN_CONTRACTS,
GUI_SCREEN_OPTIONS,
GUI_SCREEN_GAMEOPTIONS,
GUI_SCREEN_LOAD,
GUI_SCREEN_SAVE,
GUI_SCREEN_SAVE_OVERWRITE,
GUI_SCREEN_STICKMAPPER,
GUI_SCREEN_MISSION,
GUI_SCREEN_REPORT
One warning though; Your code still has to double check if the "to" screen is the current screen as another oxp could have used that same handler for switching screens. (e.g. there could have been a launch() instruction by an other oxp)another_commander wrote:You can. The handler iswhere to and from hold the string description of the screen we got to and the screen we came from, like GUI_SCREEN_SYSTEM_DATA, GUI_SCREEN_STATUS etc.Code: Select all
this.guiScreenChanged = function(to, from) { ... your code here ... }
I don't think we have a general setGUIScreen method, so the answer would be no.Rustybolts wrote:If i run a mission screen from one of these is it possible after the mission screen has completed to return directly to the gui screen i have overided?