mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-05 05:20:31 +00:00
Adds utility function to clean up and standardize the remapping handling for keybinds
Adds sanity check so if no remappable binds are found for an actionMap, it isn't listed in the controls menu Updates ExampleModule's keybinds to use new utility function
This commit is contained in:
parent
a304198abb
commit
44c894d335
3 changed files with 53 additions and 66 deletions
|
|
@ -145,6 +145,23 @@ function fillRemapList()
|
|||
|
||||
%actionMapName = %actionMap.humanReadableName $= "" ? %actionMap.getName() : %actionMap.humanReadableName;
|
||||
|
||||
//see if we have any actual listed remappable keys for this movemap. if so, drop it from the listing
|
||||
%hasRemaps = false;
|
||||
for ( %r = 0; %r < $RemapCount; %r++ )
|
||||
{
|
||||
%testMapName = $RemapActionMap[%r].humanReadableName $= "" ? $RemapActionMap[%r].getName() : $RemapActionMap[%r].humanReadableName;
|
||||
|
||||
if(%actionMapName $= %testMapName)
|
||||
{
|
||||
//got a match to at least one, so we're ok to continue
|
||||
%hasRemaps = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!%hasRemaps)
|
||||
continue;
|
||||
|
||||
if(%actionMapList $= "")
|
||||
%actionMapList = %actionMapName;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue