diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-19 02:23:57 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-19 02:23:57 +0000 |
commit | dda0f0240c1a19eeb321d362e751b397a63996ec (patch) | |
tree | b2c270fd94d5897639a1a1ad17b3c3e777833325 /Northstar.Client/mod/scripts/vscripts/ui | |
parent | 917da6226d0aa62717f4ec2abe644589dd8e0e42 (diff) | |
parent | 190349255d45ae88f7b6d2ad872a5df15699d97a (diff) | |
download | NorthstarMods-dda0f0240c1a19eeb321d362e751b397a63996ec.tar.gz NorthstarMods-dda0f0240c1a19eeb321d362e751b397a63996ec.zip |
Merge branch 'main' of https://github.com/R2Northstar/NorthstarMods
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts/ui')
4 files changed, 37 insertions, 5 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut b/Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut new file mode 100644 index 00000000..1866f056 --- /dev/null +++ b/Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut @@ -0,0 +1,19 @@ +global function PrependControllerPrompts + +// Returns the string that gets turned into a controller prompt image in the front-end +string function ControllerButtonToStr( int buttonID ) +{ + switch (buttonID) + { + case BUTTON_Y: + return "%[Y_BUTTON|]%" + case BUTTON_X: + return "%[X_BUTTON|]%" + } + unreachable +} + +string function PrependControllerPrompts( int buttonID, string localizationKey ) +{ + return ControllerButtonToStr( buttonID ) + " " + Localize(localizationKey) +} diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut index cc681e95..6964c29d 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut @@ -15,7 +15,8 @@ void function AddNorthstarModMenu() void function AddNorthstarModMenu_MainMenuFooter() { - AddMenuFooterOption( GetMenu( "MainMenu" ), BUTTON_Y, "#Y_BUTTON_MENU_TITLE_MODS", "#MENU_TITLE_MODS", AdvanceToModListMenu ) + string controllerStr = PrependControllerPrompts( BUTTON_Y, "#MENU_TITLE_MODS" ) + AddMenuFooterOption( GetMenu( "MainMenu" ), BUTTON_Y, controllerStr, "#MENU_TITLE_MODS", AdvanceToModListMenu ) } void function AdvanceToModListMenu( var button ) @@ -30,8 +31,20 @@ void function InitModMenu() AddMenuEventHandler( menu, eUIEvent.MENU_OPEN, OnModMenuOpened ) AddMenuEventHandler( menu, eUIEvent.MENU_CLOSE, OnModMenuClosed ) AddMenuFooterOption( menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" ) - AddMenuFooterOption( menu, BUTTON_Y, "#Y_BUTTON_RELOAD_MODS", "#RELOAD_MODS", OnReloadModsButtonPressed ) - AddMenuFooterOption( menu, BUTTON_BACK, "#BACK_AUTHENTICATION_AGREEMENT", "#AUTHENTICATION_AGREEMENT", OnAuthenticationAgreementButtonPressed ) + AddMenuFooterOption( + menu, + BUTTON_X, + PrependControllerPrompts( BUTTON_X, "#RELOAD_MODS" ), + "#RELOAD_MODS", + OnReloadModsButtonPressed + ) + AddMenuFooterOption( + menu, + BUTTON_BACK, + PrependControllerPrompts( BUTTON_Y, "#AUTHENTICATION_AGREEMENT" ), + "#AUTHENTICATION_AGREEMENT", + OnAuthenticationAgreementButtonPressed + ) foreach ( var button in GetElementsByClassname( GetMenu( "ModListMenu" ), "ModButton" ) ) { diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index 7aadce89..7c6c93fd 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -156,7 +156,7 @@ void function InitServerBrowserMenu() AddMenuEventHandler( file.menu, eUIEvent.MENU_CLOSE, OnCloseServerBrowserMenu ) AddMenuEventHandler( file.menu, eUIEvent.MENU_OPEN, OnServerBrowserMenuOpened ) AddMenuFooterOption( file.menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" ) - AddMenuFooterOption( file.menu, BUTTON_Y, "#Y_BUTTON_REFRESH_SERVERS", "#REFRESH_SERVERS", RefreshServers ) + AddMenuFooterOption( file.menu, BUTTON_Y, PrependControllerPrompts( BUTTON_Y, "#REFRESH_SERVERS" ), "#REFRESH_SERVERS", RefreshServers ) // Setup server buttons var width = 1120.0 * (GetScreenSize()[1] / 1080.0) diff --git a/Northstar.Client/mod/scripts/vscripts/ui/ui_utility.gnut b/Northstar.Client/mod/scripts/vscripts/ui/ui_utility.gnut index 02d77795..d6a7a29a 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/ui_utility.gnut +++ b/Northstar.Client/mod/scripts/vscripts/ui/ui_utility.gnut @@ -631,4 +631,4 @@ void function Hud_SetNavUp( var buttonFrom, var buttonTo ) void function Hud_SetNavDown( var buttonFrom, var buttonTo ) { buttonFrom.SetNavDown( buttonTo ) -}
\ No newline at end of file +} |