mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Update optionsMenu.tscript
Fixed re-mappable binds with "mouse" as the device not showing up in the menu.
This commit is contained in:
parent
2e291d8ab2
commit
6526e87724
1 changed files with 22 additions and 13 deletions
|
|
@ -583,7 +583,7 @@ function OptionsMenu::populateAudioSettings(%this)
|
||||||
|
|
||||||
function OptionsMenu::populateKBMControls(%this)
|
function OptionsMenu::populateKBMControls(%this)
|
||||||
{
|
{
|
||||||
%this.populateKeybinds("keyboard", KBMControlsList);
|
%this.populateKeybinds("keyboard" TAB "mouse", KBMControlsList);
|
||||||
|
|
||||||
%this.syncGui();
|
%this.syncGui();
|
||||||
|
|
||||||
|
|
@ -599,7 +599,7 @@ function OptionsMenu::populateGamepadControls(%this)
|
||||||
GamepadControlsList.syncGui();
|
GamepadControlsList.syncGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
function OptionsMenu::populateKeybinds(%this, %device, %controlsList)
|
function OptionsMenu::populateKeybinds(%this, %devices, %controlsList)
|
||||||
{
|
{
|
||||||
%controlsList.clear();
|
%controlsList.clear();
|
||||||
|
|
||||||
|
|
@ -662,7 +662,16 @@ function OptionsMenu::populateKeybinds(%this, %device, %controlsList)
|
||||||
|
|
||||||
for ( %i = 0; %i < $RemapCount; %i++ )
|
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;
|
continue;
|
||||||
|
|
||||||
%actionMapName = $RemapActionMap[%i].humanReadableName $= "" ? $RemapActionMap[%i].getName() : $RemapActionMap[%i].humanReadableName;
|
%actionMapName = $RemapActionMap[%i].humanReadableName $= "" ? $RemapActionMap[%i].getName() : $RemapActionMap[%i].humanReadableName;
|
||||||
|
|
@ -670,13 +679,13 @@ function OptionsMenu::populateKeybinds(%this, %device, %controlsList)
|
||||||
if(%currentActionMap !$= %actionMapName)
|
if(%currentActionMap !$= %actionMapName)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
%keyMap = buildFullMapString( %i, $RemapActionMap[%i], %device );
|
%keyMap = buildFullMapString( %i, $RemapActionMap[%i], %entryDevice );
|
||||||
|
|
||||||
%description = $RemapDescription[%i];
|
%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);
|
%controlsList.add(%remapEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue