mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Adds handling for the keyboard remap page of the options menu to be able to present a bind with a modifier key
This commit is contained in:
parent
15971185ee
commit
b1f71bab74
1 changed files with 86 additions and 17 deletions
|
|
@ -123,12 +123,33 @@ function OptionsMenuList::syncGui(%this)
|
||||||
}
|
}
|
||||||
else if(%option.class $= "OptionsKeybindEntry")
|
else if(%option.class $= "OptionsKeybindEntry")
|
||||||
{
|
{
|
||||||
%bindImgAsset = getButtonBitmap(%option.device, getField(%option.keymap, 1));
|
if(getWordCount(getField(%option.keymap, 1)) == 2)
|
||||||
|
{
|
||||||
if(%bindImgAsset $= "UI:Keyboard_Black_Blank_image")
|
%keymap = getField(%option.keymap, 1);
|
||||||
%bindImgAsset = "";
|
%modifierImgAsset = getButtonBitmap(%option.device, getWord(%keymap, 0));
|
||||||
|
|
||||||
%container-->bindButton.setBitmap(%bindImgAsset);
|
if(%modifierImgAsset $= "UI:Keyboard_Black_Blank_image")
|
||||||
|
%modifierImgAsset = "";
|
||||||
|
|
||||||
|
%container-->modifierButton.setBitmap(%modifierImgAsset);
|
||||||
|
|
||||||
|
//
|
||||||
|
%bindImgAsset = getButtonBitmap(%option.device, getWord(%keymap, 1));
|
||||||
|
|
||||||
|
if(%bindImgAsset $= "UI:Keyboard_Black_Blank_image")
|
||||||
|
%bindImgAsset = "";
|
||||||
|
|
||||||
|
%container-->bindButton.setBitmap(%bindImgAsset);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%bindImgAsset = getButtonBitmap(%option.device, getField(%option.keymap, 1));
|
||||||
|
|
||||||
|
if(%bindImgAsset $= "UI:Keyboard_Black_Blank_image")
|
||||||
|
%bindImgAsset = "";
|
||||||
|
|
||||||
|
%container-->bindButton.setBitmap(%bindImgAsset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -624,6 +645,8 @@ function OptionsMenu::populateKeybinds(%this, %device, %controlsList)
|
||||||
if($activeRemapControlSet $= "")
|
if($activeRemapControlSet $= "")
|
||||||
$activeRemapControlSet = getField(%actionMapList, 0);
|
$activeRemapControlSet = getField(%actionMapList, 0);
|
||||||
|
|
||||||
|
echo("============================================");
|
||||||
|
|
||||||
for(%am = 0; %am < getFieldCount(%actionMapList); %am++)
|
for(%am = 0; %am < getFieldCount(%actionMapList); %am++)
|
||||||
{
|
{
|
||||||
%currentActionMap = getField(%actionMapList, %am);
|
%currentActionMap = getField(%actionMapList, %am);
|
||||||
|
|
@ -650,6 +673,8 @@ function OptionsMenu::populateKeybinds(%this, %device, %controlsList)
|
||||||
|
|
||||||
%description = $RemapDescription[%i];
|
%description = $RemapDescription[%i];
|
||||||
|
|
||||||
|
echo("Added ActionMap Entry: " @ %actionMapName @ " | " @ %device @ " | " @ %keymap @ " | " @ %description);
|
||||||
|
|
||||||
%remapEntry = addActionMapEntry(%actionMapName, %device, %keyMap, %i, %description);
|
%remapEntry = addActionMapEntry(%actionMapName, %device, %keyMap, %i, %description);
|
||||||
%controlsList.add(%remapEntry);
|
%controlsList.add(%remapEntry);
|
||||||
}
|
}
|
||||||
|
|
@ -1045,20 +1070,64 @@ function addActionMapEntry(%actionMap, %device, %keyMap, %index, %description)
|
||||||
horizSizing = "left";
|
horizSizing = "left";
|
||||||
vertSizing = "height";
|
vertSizing = "height";
|
||||||
internalName = "valuesContainer";
|
internalName = "valuesContainer";
|
||||||
|
|
||||||
new GuiIconButtonCtrl() {
|
|
||||||
position = "300 -10";
|
|
||||||
extent = "98 45";
|
|
||||||
BitmapAsset = "";
|
|
||||||
profile = GuiRemapActionMapButtonProfile;
|
|
||||||
sizeIconToButton = true;
|
|
||||||
makeIconSquare = true;
|
|
||||||
iconLocation = "center";
|
|
||||||
internalName = "bindButton";
|
|
||||||
active = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
%buttonContainer = %entry.findObjectByInternalName("valuesContainer");
|
||||||
|
echo("Keymap: " @ %keymap @ " | Keymap word count: " @ getWordCount(getField(%keyMap, 1)));
|
||||||
|
if(getWordCount(getField(%keyMap, 1)) == 2)
|
||||||
|
{
|
||||||
|
%modifierBtn = new GuiIconButtonCtrl() {
|
||||||
|
position = 156 SPC -10;
|
||||||
|
extent = "98 45";
|
||||||
|
BitmapAsset = "";
|
||||||
|
profile = GuiRemapActionMapButtonProfile;
|
||||||
|
sizeIconToButton = true;
|
||||||
|
makeIconSquare = true;
|
||||||
|
iconLocation = "center";
|
||||||
|
internalName = "modifierButton";
|
||||||
|
active = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
%combinerText = new GuiTextCtrl(){
|
||||||
|
position = 264 SPC -5;
|
||||||
|
extent = "20 45";
|
||||||
|
profile = MenuSubHeaderText;
|
||||||
|
text = " + ";
|
||||||
|
};
|
||||||
|
|
||||||
|
%bindButton = new GuiIconButtonCtrl() {
|
||||||
|
position = "300 -10";
|
||||||
|
extent = "98 45";
|
||||||
|
BitmapAsset = "";
|
||||||
|
profile = GuiRemapActionMapButtonProfile;
|
||||||
|
sizeIconToButton = true;
|
||||||
|
makeIconSquare = true;
|
||||||
|
iconLocation = "center";
|
||||||
|
internalName = "bindButton";
|
||||||
|
active = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
%buttonContainer.add(%modifierBtn);
|
||||||
|
%buttonContainer.add(%combinerText);
|
||||||
|
%buttonContainer.add(%bindButton);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%bindButton = new GuiIconButtonCtrl() {
|
||||||
|
position = "300 -10";
|
||||||
|
extent = "98 45";
|
||||||
|
BitmapAsset = "";
|
||||||
|
profile = GuiRemapActionMapButtonProfile;
|
||||||
|
sizeIconToButton = true;
|
||||||
|
makeIconSquare = true;
|
||||||
|
iconLocation = "center";
|
||||||
|
internalName = "bindButton";
|
||||||
|
active = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
%buttonContainer.add(%bindButton);
|
||||||
|
}
|
||||||
|
|
||||||
return %entry;
|
return %entry;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue