From 0853de7c516752080dd37ea2834fe072bbfa5d16 Mon Sep 17 00:00:00 2001 From: Sir-Skurpsalot <87043120+Sir-Skurpsalot@users.noreply.github.com> Date: Mon, 15 Dec 2025 22:39:46 -0700 Subject: [PATCH] Update utility.tscript moved addKeyRemap() back to this file so defaultkeybinds can find it in time --- .../game/data/UI/scripts/utility.tscript | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Templates/BaseGame/game/data/UI/scripts/utility.tscript b/Templates/BaseGame/game/data/UI/scripts/utility.tscript index 3cb339b9a..6b01b0ab8 100644 --- a/Templates/BaseGame/game/data/UI/scripts/utility.tscript +++ b/Templates/BaseGame/game/data/UI/scripts/utility.tscript @@ -195,3 +195,26 @@ function switchLanguage(%language) //use here the #n as it's the order of inclus getCoreLangTable().setCurrentLanguage(%language); Canvas.setContent(Canvas.getContent()); } + +function addKeyRemap(%name, %actionMap, %device, %command, %description) +{ + if(%name $= "" || + %actionMap $= "" || + %device $= "" || + %command $= "") + { + error("addKeybindRemap() - tried to add a remap entry, but didn't have all the keeded info!"); + return; + } + + // "mouse" is accepted as a convenience, but the remappable actions related functions treat it same as "keyboard". + if(%device $= "mouse") + %device = "keyboard"; + + $RemapName[$RemapCount] = %name; + $RemapCmd[$RemapCount] = %command; + $RemapActionMap[$RemapCount] = %actionMap; + $RemapDevice[$RemapCount] = %device; + $RemapDescription[$RemapCount] = %description; + $RemapCount++; +}