mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +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
|
|
@ -8,4 +8,23 @@ function getMouseAdjustAmount(%val)
|
|||
{
|
||||
// based on a default camera FOV of 90'
|
||||
return(%val * ($cameraFov / 90) * 0.01) * $pref::Input::LinkMouseSensitivity;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
$RemapName[$RemapCount] = %name;
|
||||
$RemapCmd[$RemapCount] = %command;
|
||||
$RemapActionMap[$RemapCount] = %actionMap;
|
||||
$RemapDevice[$RemapCount] = %device;
|
||||
$RemapDescription[$RemapCount] = %description;
|
||||
$RemapCount++;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue