From 6526e877244b3a7327700914a7c52aca537752ea Mon Sep 17 00:00:00 2001 From: Sir-Skurpsalot <87043120+Sir-Skurpsalot@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:35:43 -0700 Subject: [PATCH] Update optionsMenu.tscript Fixed re-mappable binds with "mouse" as the device not showing up in the menu. --- .../game/data/UI/guis/optionsMenu.tscript | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript b/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript index d37f3ebce..e231f084e 100644 --- a/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript +++ b/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript @@ -583,7 +583,7 @@ function OptionsMenu::populateAudioSettings(%this) function OptionsMenu::populateKBMControls(%this) { - %this.populateKeybinds("keyboard", KBMControlsList); + %this.populateKeybinds("keyboard" TAB "mouse", KBMControlsList); %this.syncGui(); @@ -599,7 +599,7 @@ function OptionsMenu::populateGamepadControls(%this) GamepadControlsList.syncGui(); } -function OptionsMenu::populateKeybinds(%this, %device, %controlsList) +function OptionsMenu::populateKeybinds(%this, %devices, %controlsList) { %controlsList.clear(); @@ -662,21 +662,30 @@ function OptionsMenu::populateKeybinds(%this, %device, %controlsList) for ( %i = 0; %i < $RemapCount; %i++ ) { - if(%device !$= "" && %device !$= $RemapDevice[%i]) + %entryDevice = ""; + //Check each field of %devices for device matching the remappable action + foreach$(%d in %devices){ + if(%d $= $RemapDevice[%i]) { + %entryDevice = %d; + break; + } + } + //If there was no match go to the next remappable action + if(%entryDevice $= "") continue; - - %actionMapName = $RemapActionMap[%i].humanReadableName $= "" ? $RemapActionMap[%i].getName() : $RemapActionMap[%i].humanReadableName; - + + %actionMapName = $RemapActionMap[%i].humanReadableName $= "" ? $RemapActionMap[%i].getName() : $RemapActionMap[%i].humanReadableName; + if(%currentActionMap !$= %actionMapName) continue; - - %keyMap = buildFullMapString( %i, $RemapActionMap[%i], %device ); + + %keyMap = buildFullMapString( %i, $RemapActionMap[%i], %entryDevice ); %description = $RemapDescription[%i]; - if ($reportKeymapping) - echo("Added ActionMap Entry: " @ %actionMapName @ " | " @ %device @ " | " @ %keymap @ " | " @ %description); - - %remapEntry = addActionMapEntry(%actionMapName, %device, %keyMap, %i, %description); + + echo("Added ActionMap Entry: " @ %actionMapName @ " | " @ %entryDevice @ " | " @ %keymap @ " | " @ %description); + + %remapEntry = addActionMapEntry(%actionMapName, %entryDevice, %keyMap, %i, %description); %controlsList.add(%remapEntry); } } @@ -1132,4 +1141,4 @@ function addActionMapEntry(%actionMap, %device, %keyMap, %index, %description) } return %entry; -} \ No newline at end of file +}