Class GameplayMenu: Difference between revisions
From TrainzOnline
Jump to navigationJump to search
New page: *API Hierarchy **GSObject ***GameObject ****TrainzGameObject *****[[Class Library| Li... |
m Change link to library reference, not language reference |
||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
*[[TrainzScript | *[[TrainzScript Library Reference|API Hierarchy]] | ||
**[[Class GSObject|GSObject]] | **[[Class GSObject|GSObject]] | ||
***[[Class GameObject|GameObject]] | ***[[Class GameObject|GameObject]] | ||
****[[Class TrainzGameObject|TrainzGameObject]] | ****[[Class TrainzGameObject|TrainzGameObject]] | ||
*****GameplayMenu | |||
<br> | <br> | ||
* A class that implements | * A class that implements an in-game Menu like the Routes or Scenario Menu. | ||
* This script is running in the [[New TrainzScript Features#Global script context|global script context]] | |||
* Used with [[KIND Gameplaymenu]] assets | |||
<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 | ||
;Notes | ;Notes | ||
*Called whenever the menumode of this GameplayMenu is changed. | *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 | *Change the appearance of this menu based on menuMode by changing the HTML code of the embedded browser object [[#Members|m_browser]] | ||
<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 | |||
*INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz. | |||
<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 | |||
*INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz. | |||
<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]] | ||
Latest revision as of 13:40, 28 December 2020
- API Hierarchy
- GSObject
- GameObject
- TrainzGameObject
- GameplayMenu
- TrainzGameObject
- GameObject
- GSObject
- A class that implements an in-game Menu like the Routes or Scenario Menu.
- This script is running in the global script context
- Used with KIND Gameplaymenu assets
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
- INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz.
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
- INTERNAL USE ONLY. DO NOT USE! This function will not be maintained in future versions of Trainz.
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.