From e0b8ff6ca17a3c8cf8c17ebd33cf109db574dba0 Mon Sep 17 00:00:00 2001 From: Barichello Date: Mon, 17 Jan 2022 19:13:02 -0300 Subject: Fix controller prompts Closes #126 --- .../mod/scripts/vscripts/ui/controller_prompts.nut | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut (limited to 'Northstar.Client/mod/scripts/vscripts/ui/controller_prompts.nut') 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) +} -- cgit v1.2.3