Class GameplayMenu
From TrainzOnline
(Difference between revisions)
(New page: *API Hierarchy **GSObject ***GameObject ****TrainzGameObject *****[[Class Library| Li...) |
|||
Line 7: | Line 7: | ||
<br> | <br> | ||
* A class that implements a in-game Menu like the Routes or Scenario Menu. | * A class that implements a in-game Menu like the Routes or Scenario Menu. | ||
+ | * This script is running in the [[New TrainzScript Features#Global script context|global script context]] | ||
<br> | <br> | ||
Line 19: | Line 20: | ||
|- | |- | ||
|public define int MENUMODE_MENU = 2;||Visible as a full-screen menu. | |public define int MENUMODE_MENU = 2;||Visible as a full-screen menu. | ||
+ | |} | ||
+ | <br> | ||
+ | ==Members== | ||
+ | <br> | ||
+ | {{TableHeader|width=95%|margin=15px}} | ||
+ | |width=375|<b> Browser m_browser</b>||An internal reference to the embedded browser object, which displays this game menu | ||
|} | |} | ||
<br> | <br> | ||
Line 25: | Line 32: | ||
{{MethodHeader|public void SetGameplayMenuMode(Browser browser, int menuMode)}} | {{MethodHeader|public void SetGameplayMenuMode(Browser browser, int menuMode)}} | ||
;Parameters | ;Parameters | ||
− | *'''browser ''' =The Browser control which is used to visualise this GameplayMenu. | + | *'''browser ''' = The Browser control which is used to visualise this GameplayMenu. |
− | *'''menuMode''' = One of the MENUMODE_* defines, indicating which mode we are switching to. | + | *'''menuMode''' = One of the [[#Menu Modes|MENUMODE_*]] defines, indicating which mode we are switching to. |
;Returned Value | ;Returned Value | ||
*None | *None | ||
Line 34: | Line 41: | ||
<br> | <br> | ||
{{MethodHeader|public native void CloseGameplayMenu(void)}} | {{MethodHeader|public native void CloseGameplayMenu(void)}} | ||
+ | ;Parameters | ||
+ | *none | ||
+ | ;Returned Value | ||
+ | *none | ||
+ | ;Notes | ||
+ | *This function causes this gameplay menu to be closed, returning the user to the game main menu. | ||
+ | <br> | ||
+ | {{MethodHeader|public void UserRequestGoBack(void)}} | ||
+ | ;Parameters | ||
+ | *none | ||
+ | ;Returned Value | ||
+ | *none | ||
+ | ;Notes | ||
+ | *Called whenever the user requests a "go back" action. | ||
+ | *If the user has navigated to some form of "sub menu", this should return them to the main level of this gameplay menu. | ||
+ | *If at the main level, this should close the gameplay menu and return to the game main menu. | ||
+ | <br> | ||
+ | {{MethodHeader|public void TADRequestRefresh(void)}} | ||
+ | ;Parameters | ||
+ | * | ||
+ | ;Returned Value | ||
+ | * | ||
+ | ;Notes | ||
+ | *Called on a fullscreen menu when the TAD is modified. | ||
+ | *Dynamic menus based on lists of assets may wish to refresh their view of the world at this time. | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadDriverQuickDrive(KUID kuid)}} | ||
+ | ;Parameters | ||
+ | *'''kuid''' = the KUID of the map to QuickDrive. | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *Loads the Driver module with the supplied map | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadDriverSession(KUID kuid)}} | ||
+ | ;Parameters | ||
+ | *'''kuid''' = the KUID of the session to Drive. | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *Loads the Driver module with a session | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadDriverScenario(KUID kuid)}} | ||
+ | ;Parameters | ||
+ | *'''kuid''' = the KUID of the scenario to Drive. | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *Loads the Driver module with a scenario | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadDriverSavedSession(string theSavedSession)}} | ||
+ | ;Parameters | ||
+ | * do not use | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz. | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadSurveyorNew()}} | ||
+ | ;Parameters | ||
+ | *none | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *Loads the Surveyor module with a new map. | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadSurveyorMap(KUID kuid)}} | ||
+ | ;Parameters | ||
+ | *'''kuid''' = the KUID of the map to load. | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *Loads the Surveyor module with a map. | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadSurveyorMapNewSession(KUID kuid)}} | ||
+ | ;Parameters | ||
+ | *'''kuid''' = the KUID of the map to load. | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *Loads the Surveyor module with a map, to start a new session. | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadSurveyorSession(KUID kuid)}} | ||
+ | ;Parameters | ||
+ | *'''kuid''' = the KUID of the session to load. | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *Loads the Surveyor module with a session. | ||
+ | <br> | ||
+ | {{MethodHeader|native bool LoadRailyard(KUID kuid)}} | ||
+ | ;Parameters | ||
+ | *'''kuid''' = the KUID of the vehicle to select in Railyard. May be null. | ||
+ | ;Returned Value | ||
+ | *True on success. False if something failed. | ||
+ | ;Notes | ||
+ | *Loads the Railyard module, optionally displaying the specified vehicle. | ||
+ | <br> | ||
+ | {{MethodHeader|native Soup GetSavedSessionInfo()}} | ||
+ | ;Parameters | ||
+ | * | ||
+ | ;Returned Value | ||
+ | * | ||
+ | ;Notes | ||
+ | *INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz. | ||
+ | <br> | ||
+ | {{MethodHeader|native bool DeleteMap(KUID theMap)}} | ||
+ | ;Parameters | ||
+ | *'''theMap''' = the KUID of the route to delete | ||
+ | ;Returned Value | ||
+ | *True if successfully deleted. | ||
+ | ;Notes | ||
+ | *Deletes a specific map, and all sessions that use it | ||
+ | <br> | ||
+ | {{MethodHeader|native bool DeleteSession(KUID theSession)}} | ||
+ | ;Parameters | ||
+ | *'''theSession''' = the session to delete | ||
+ | ;Returned Value | ||
+ | *True if successfully deleted. | ||
+ | ;Notes | ||
+ | *Deletes a specific session | ||
+ | <br> | ||
+ | {{MethodHeader|native bool DeleteScenario(KUID theScenario)}} | ||
+ | ;Parameters | ||
+ | *'''theScenario''' = the scenario to delete | ||
+ | ;Returned Value | ||
+ | *True if successfully deleted. | ||
+ | ;Notes | ||
+ | *Deletes a specific scenario | ||
+ | <br> | ||
+ | {{MethodHeader|native bool DeleteSavedSession(string theSavedSession)}} | ||
+ | ;Parameters | ||
+ | * N/A | ||
+ | ;Returned Value | ||
+ | * N/A | ||
+ | ;Notes | ||
+ | *INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz. | ||
+ | |||
+ | |||
+ | <br> | ||
==Categories== | ==Categories== | ||
[[Category:Script Class]] | [[Category:Script Class]] |
Revision as of 01:04, 16 October 2010
- API Hierarchy
- GSObject
- GameObject
- TrainzGameObject
- Library
- GameplayMenu
- Library
- TrainzGameObject
- GameObject
- GSObject
- A class that implements a in-game Menu like the Routes or Scenario Menu.
- This script is running in the global script context
Contents |
Constants
Menu Modes
public define int MENUMODE_NONE = 0 | Not visible. |
public define int MENUMODE_BUTTON = 1; | Visible as a button on the gameplay menu. |
public define int MENUMODE_MENU = 2; | Visible as a full-screen menu. |
Members
Browser m_browser | An internal reference to the embedded browser object, which displays this game menu |
Methods
public void SetGameplayMenuMode(Browser browser, int menuMode)
- Parameters
- browser = The Browser control which is used to visualise this GameplayMenu.
- menuMode = One of the MENUMODE_* defines, indicating which mode we are switching to.
- Returned Value
- None
- Notes
- Called whenever the menumode of this GameplayMenu is changed.
- Change the appearance of this menu based on menuMode by changing the HTML code of the embedded browser object m_browser
public native void CloseGameplayMenu(void)
- Parameters
- none
- Returned Value
- none
- Notes
- This function causes this gameplay menu to be closed, returning the user to the game main menu.
public void UserRequestGoBack(void)
- Parameters
- none
- Returned Value
- none
- Notes
- Called whenever the user requests a "go back" action.
- If the user has navigated to some form of "sub menu", this should return them to the main level of this gameplay menu.
- If at the main level, this should close the gameplay menu and return to the game main menu.
public void TADRequestRefresh(void)
- Parameters
- Returned Value
- Notes
- Called on a fullscreen menu when the TAD is modified.
- Dynamic menus based on lists of assets may wish to refresh their view of the world at this time.
native bool LoadDriverQuickDrive(KUID kuid)
- Parameters
- kuid = the KUID of the map to QuickDrive.
- Returned Value
- True on success. False if something failed.
- Notes
- Loads the Driver module with the supplied map
native bool LoadDriverSession(KUID kuid)
- Parameters
- kuid = the KUID of the session to Drive.
- Returned Value
- True on success. False if something failed.
- Notes
- Loads the Driver module with a session
native bool LoadDriverScenario(KUID kuid)
- Parameters
- kuid = the KUID of the scenario to Drive.
- Returned Value
- True on success. False if something failed.
- Notes
- Loads the Driver module with a scenario
native bool LoadDriverSavedSession(string theSavedSession)
- Parameters
- do not use
- Returned Value
- True on success. False if something failed.
- Notes
- INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz.
native bool LoadSurveyorNew()
- Parameters
- none
- Returned Value
- True on success. False if something failed.
- Notes
- Loads the Surveyor module with a new map.
native bool LoadSurveyorMap(KUID kuid)
- Parameters
- kuid = the KUID of the map to load.
- Returned Value
- True on success. False if something failed.
- Notes
- Loads the Surveyor module with a map.
native bool LoadSurveyorMapNewSession(KUID kuid)
- Parameters
- kuid = the KUID of the map to load.
- Returned Value
- True on success. False if something failed.
- Notes
- Loads the Surveyor module with a map, to start a new session.
native bool LoadSurveyorSession(KUID kuid)
- Parameters
- kuid = the KUID of the session to load.
- Returned Value
- True on success. False if something failed.
- Notes
- Loads the Surveyor module with a session.
native bool LoadRailyard(KUID kuid)
- Parameters
- kuid = the KUID of the vehicle to select in Railyard. May be null.
- Returned Value
- True on success. False if something failed.
- Notes
- Loads the Railyard module, optionally displaying the specified vehicle.
native Soup GetSavedSessionInfo()
- Parameters
- Returned Value
- Notes
- INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz.
native bool DeleteMap(KUID theMap)
- Parameters
- theMap = the KUID of the route to delete
- Returned Value
- True if successfully deleted.
- Notes
- Deletes a specific map, and all sessions that use it
native bool DeleteSession(KUID theSession)
- Parameters
- theSession = the session to delete
- Returned Value
- True if successfully deleted.
- Notes
- Deletes a specific session
native bool DeleteScenario(KUID theScenario)
- Parameters
- theScenario = the scenario to delete
- Returned Value
- True if successfully deleted.
- Notes
- Deletes a specific scenario
native bool DeleteSavedSession(string theSavedSession)
- Parameters
- N/A
- Returned Value
- N/A
- Notes
- INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz.