aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Northstar.Client/mod.json5
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut19
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut19
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut2
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/ui_utility.gnut2
5 files changed, 41 insertions, 6 deletions
diff --git a/Northstar.Client/mod.json b/Northstar.Client/mod.json
index fbaf12039..d40d7ed0c 100644
--- a/Northstar.Client/mod.json
+++ b/Northstar.Client/mod.json
@@ -58,13 +58,16 @@
"Before": "AddNorthstarCustomMatchSettingsCategoryMenu"
}
},
-
{
"Path": "ui/menu_ns_custom_match_settings.nut",
"RunOn": "UI",
"UICallback": {
"Before": "AddNorthstarCustomMatchSettingsMenu"
}
+ },
+ {
+ "Path": "ui/controller_prompts.nut",
+ "RunOn": "UI"
}
],
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 000000000..1866f0563
--- /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 cc681e95b..6964c29d2 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 7aadce897..7c6c93fde 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 02d77795a..d6a7a29a9 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
+}