aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut
diff options
context:
space:
mode:
authorBarichello <artur@barichello.me>2022-01-17 19:13:02 -0300
committerBarichello <artur@barichello.me>2022-01-17 21:21:45 -0300
commite0b8ff6ca17a3c8cf8c17ebd33cf109db574dba0 (patch)
tree5a1777a1dfe0756b00f9e8149449363324185e3a /Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut
parent4c2bf1f7519d1164ea66c806f3c0a056f53c87a5 (diff)
downloadNorthstarMods-e0b8ff6ca17a3c8cf8c17ebd33cf109db574dba0.tar.gz
NorthstarMods-e0b8ff6ca17a3c8cf8c17ebd33cf109db574dba0.zip
Fix controller prompts
Closes #126
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut')
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut19
1 files changed, 19 insertions, 0 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 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)
+}