Gui events

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Rustybolts
---- E L I T E ----
---- E L I T E ----
Posts: 293
Joined: Sun Jun 07, 2009 6:22 pm
Location: UK

Gui events

Post by Rustybolts »

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.
STE.+ Firefly/Dragonfly + BlackJacksbullion v.1.23 link below.
http://www.mediafire.com/?sharekey=ca16 ... f6e8ebb871
Image
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

You can. The handler is

Code: Select all

this.guiScreenChanged = function(to, from)
{
    ... your code here ...
}
where 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.
User avatar
Rustybolts
---- E L I T E ----
---- E L I T E ----
Posts: 293
Joined: Sun Jun 07, 2009 6:22 pm
Location: UK

Post by Rustybolts »

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?
STE.+ Firefly/Dragonfly + BlackJacksbullion v.1.23 link below.
http://www.mediafire.com/?sharekey=ca16 ... f6e8ebb871
Image
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

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?
It is the same as in the game. Here is the complete list of GUI_SCREENs:

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
User avatar
Rustybolts
---- E L I T E ----
---- E L I T E ----
Posts: 293
Joined: Sun Jun 07, 2009 6:22 pm
Location: UK

Post by Rustybolts »

Much apreciated ty
:D
STE.+ Firefly/Dragonfly + BlackJacksbullion v.1.23 link below.
http://www.mediafire.com/?sharekey=ca16 ... f6e8ebb871
Image
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

another_commander wrote:
You can. The handler is

Code: Select all

this.guiScreenChanged = function(to, from)
{
    ... your code here ...
}
where 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.
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)
User avatar
Rustybolts
---- E L I T E ----
---- E L I T E ----
Posts: 293
Joined: Sun Jun 07, 2009 6:22 pm
Location: UK

Post by Rustybolts »

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?
STE.+ Firefly/Dragonfly + BlackJacksbullion v.1.23 link below.
http://www.mediafire.com/?sharekey=ca16 ... f6e8ebb871
Image
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

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?
I don't think we have a general setGUIScreen method, so the answer would be no.
User avatar
Rustybolts
---- E L I T E ----
---- E L I T E ----
Posts: 293
Joined: Sun Jun 07, 2009 6:22 pm
Location: UK

Post by Rustybolts »

Not what i wanted to hear. Oh well that pisses on my fire.
T.y for help
STE.+ Firefly/Dragonfly + BlackJacksbullion v.1.23 link below.
http://www.mediafire.com/?sharekey=ca16 ... f6e8ebb871
Image
Post Reply