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:
Areloch 2022-12-06 00:16:13 -06:00
parent a304198abb
commit 44c894d335
3 changed files with 53 additions and 66 deletions

View file

@ -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