mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Fixes handling of click/activation events on keybind options ctrls so clicking on it at all activates it, instead of needing to click on the button image specifically
Adjust the scaling of the options rows to be a consistent 50/50 divide between the options name and the actual options values to make the layout and scaling consistent Fixes key remapping behavior to work properly Added SubHeader text gui profile that is centered Made the remapping gui control be stylistically consistent to messageboxes
This commit is contained in:
parent
abbfb634f3
commit
f2585fea4d
|
|
@ -817,16 +817,9 @@ void GuiGameSettingsCtrl::clickKeybind(S32 xPos)
|
||||||
S32 columnSplit = mColumnSplit;
|
S32 columnSplit = mColumnSplit;
|
||||||
|
|
||||||
S32 height = getHeight();
|
S32 height = getHeight();
|
||||||
|
S32 width = getWidth();
|
||||||
|
|
||||||
Point2I button;
|
RectI rect(Point2I::Zero, Point2I(width, height));
|
||||||
button.x = columnSplit + (columnSplit / 2.5)/* + (optionWidth / 2)*/;
|
|
||||||
button.y = 0;
|
|
||||||
|
|
||||||
Point2I buttonSize;
|
|
||||||
buttonSize.x = height;
|
|
||||||
buttonSize.y = height;
|
|
||||||
|
|
||||||
RectI rect(button, buttonSize);
|
|
||||||
|
|
||||||
onChange_callback();
|
onChange_callback();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -828,7 +828,7 @@ function OptionsMenuSettingsList::addOptionRow(%this, %label, %targetPrefVar, %o
|
||||||
%enabled = true;
|
%enabled = true;
|
||||||
|
|
||||||
%optionsRowSize = 30;
|
%optionsRowSize = 30;
|
||||||
%optionColumnWidth = %this.extent.x * 0.3;//todo, calculate off longest option text?
|
%optionColumnWidth = %this.extent.x * 0.5;//todo, calculate off longest option text?
|
||||||
|
|
||||||
%option = new GuiGameSettingsCtrl() {
|
%option = new GuiGameSettingsCtrl() {
|
||||||
class = "MenuOptionsButton";
|
class = "MenuOptionsButton";
|
||||||
|
|
@ -936,7 +936,7 @@ function OptionsMenuSettingsList::addSliderRow(%this, %label, %targetPrefVar, %i
|
||||||
%enabled = true;
|
%enabled = true;
|
||||||
|
|
||||||
%optionsRowSize = 30;
|
%optionsRowSize = 30;
|
||||||
%optionColumnWidth = %this.extent.x - 450;//todo, calculate off longest option text?
|
%optionColumnWidth = %this.extent.x * 0.5;//todo, calculate off longest option text?
|
||||||
|
|
||||||
%option = new GuiGameSettingsCtrl() {
|
%option = new GuiGameSettingsCtrl() {
|
||||||
class = "MenuOptionsButton";
|
class = "MenuOptionsButton";
|
||||||
|
|
@ -965,7 +965,7 @@ function OptionsMenuSettingsList::addKeybindRow(%this, %label, %bitmapName, %cal
|
||||||
%enabled = true;
|
%enabled = true;
|
||||||
|
|
||||||
%optionsRowSize = 40;
|
%optionsRowSize = 40;
|
||||||
%optionColumnWidth = %this.extent.x - 450;
|
%optionColumnWidth = %this.extent.x * 0.5;//todo, calculate off longest option text?
|
||||||
|
|
||||||
%option = new GuiGameSettingsCtrl() {
|
%option = new GuiGameSettingsCtrl() {
|
||||||
class = "MenuOptionsButton";
|
class = "MenuOptionsButton";
|
||||||
|
|
|
||||||
|
|
@ -1,121 +1,77 @@
|
||||||
//--- OBJECT WRITE BEGIN ---
|
//--- OBJECT WRITE BEGIN ---
|
||||||
$guiContent = new GuiControl(RemapDlg) {
|
$guiContent = new GuiControl(RemapDlg) {
|
||||||
position = "0 0";
|
|
||||||
extent = "1024 768";
|
extent = "1024 768";
|
||||||
minExtent = "8 8";
|
minExtent = "8 8";
|
||||||
horizSizing = "right";
|
|
||||||
vertSizing = "bottom";
|
|
||||||
profile = "GuiDefaultProfile";
|
profile = "GuiDefaultProfile";
|
||||||
visible = "1";
|
|
||||||
active = "1";
|
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "1";
|
isContainer = "1";
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "1";
|
canSaveDynamicFields = "1";
|
||||||
helpTag = "0";
|
helpTag = "0";
|
||||||
|
|
||||||
new GuiContainer(RemapPanel) {
|
new GuiContainer(RemapPanel) {
|
||||||
margin = "0 0 0 0";
|
position = "162 332";
|
||||||
padding = "0 0 0 0";
|
extent = "700 104";
|
||||||
anchorTop = "1";
|
|
||||||
anchorBottom = "0";
|
|
||||||
anchorLeft = "1";
|
|
||||||
anchorRight = "0";
|
|
||||||
position = "162 352";
|
|
||||||
extent = "700 64";
|
|
||||||
minExtent = "8 2";
|
|
||||||
horizSizing = "center";
|
horizSizing = "center";
|
||||||
vertSizing = "center";
|
vertSizing = "center";
|
||||||
profile = "GuiDefaultProfile";
|
profile = "GuiDefaultProfile";
|
||||||
visible = "1";
|
|
||||||
active = "1";
|
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "1";
|
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
|
|
||||||
new GuiInputCtrl(OptRemapInputCtrl) {
|
new GuiInputCtrl(OptRemapInputCtrl) {
|
||||||
lockMouse = "0";
|
|
||||||
position = "480 0";
|
position = "480 0";
|
||||||
extent = "64 64";
|
extent = "64 104";
|
||||||
minExtent = "8 8";
|
minExtent = "8 8";
|
||||||
horizSizing = "width";
|
horizSizing = "width";
|
||||||
vertSizing = "height";
|
vertSizing = "height";
|
||||||
profile = "GuiInputCtrlProfile";
|
profile = "GuiInputCtrlProfile";
|
||||||
visible = "1";
|
|
||||||
active = "1";
|
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "0";
|
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
};
|
};
|
||||||
new GuiChunkedBitmapCtrl() {
|
new GuiControl(RemapBoxCtrl) {
|
||||||
bitmapAsset = "UI:hudfill_image";
|
position = "-1 1";
|
||||||
useVariable = "0";
|
extent = "701 102";
|
||||||
tile = "0";
|
horizSizing = "center";
|
||||||
position = "0 0";
|
vertSizing = "center";
|
||||||
extent = "700 64";
|
|
||||||
minExtent = "8 2";
|
|
||||||
horizSizing = "right";
|
|
||||||
vertSizing = "bottom";
|
|
||||||
profile = "GuiDefaultProfile";
|
profile = "GuiDefaultProfile";
|
||||||
visible = "1";
|
|
||||||
active = "1";
|
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "0";
|
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
};
|
|
||||||
new GuiTextCtrl() {
|
|
||||||
text = "Press escape to cancel";
|
|
||||||
maxLength = "255";
|
|
||||||
margin = "0 0 0 0";
|
|
||||||
padding = "0 0 0 0";
|
|
||||||
anchorTop = "1";
|
|
||||||
anchorBottom = "0";
|
|
||||||
anchorLeft = "1";
|
|
||||||
anchorRight = "0";
|
|
||||||
position = "247 34";
|
|
||||||
extent = "242 20";
|
|
||||||
minExtent = "8 8";
|
|
||||||
horizSizing = "width";
|
|
||||||
vertSizing = "height";
|
|
||||||
profile = "GuiMenuButtonProfile";
|
|
||||||
visible = "1";
|
|
||||||
active = "1";
|
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "1";
|
isContainer = "1";
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "0";
|
new GuiBitmapBarCtrl() {
|
||||||
};
|
BitmapAsset = "UI:panel_image";
|
||||||
new GuiTextCtrl() {
|
extent = "701 40";
|
||||||
text = "Re-bind \"\" to...";
|
horizSizing = "width";
|
||||||
maxLength = "255";
|
profile = "GuiDefaultProfile";
|
||||||
margin = "0 0 0 0";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
padding = "0 0 0 0";
|
};
|
||||||
anchorTop = "1";
|
new GuiBitmapBarCtrl() {
|
||||||
anchorBottom = "0";
|
BitmapAsset = "UI:panel_low_image";
|
||||||
anchorLeft = "1";
|
position = "0 40";
|
||||||
anchorRight = "0";
|
extent = "701 341";
|
||||||
position = "177 8";
|
horizSizing = "width";
|
||||||
extent = "384 20";
|
profile = "GuiDefaultProfile";
|
||||||
minExtent = "8 8";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
horizSizing = "width";
|
};
|
||||||
vertSizing = "height";
|
new GuiTextCtrl() {
|
||||||
profile = "GuiMenuButtonProfile";
|
text = "Press escape to cancel";
|
||||||
visible = "1";
|
maxLength = "255";
|
||||||
active = "1";
|
position = "260 67";
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
extent = "181 23";
|
||||||
hovertime = "1000";
|
minExtent = "8 8";
|
||||||
isContainer = "1";
|
horizSizing = "width";
|
||||||
internalName = "OptRemapText";
|
vertSizing = "height";
|
||||||
canSave = "1";
|
profile = "MenuMLSubHeaderTextCenter";
|
||||||
canSaveDynamicFields = "0";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
};
|
||||||
|
new GuiTextCtrl() {
|
||||||
|
text = "Re-bind \"Forward\" to...";
|
||||||
|
maxLength = "255";
|
||||||
|
position = "259 40";
|
||||||
|
extent = "184 23";
|
||||||
|
minExtent = "8 8";
|
||||||
|
horizSizing = "center";
|
||||||
|
vertSizing = "height";
|
||||||
|
profile = "MenuMLSubHeaderTextCenter";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
internalName = "OptRemapText";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -205,12 +205,13 @@ function controlSetChanged()
|
||||||
fillRemapList();
|
fillRemapList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function doKeyRemap( %rowIndex )
|
function doKeyRemap( %row )
|
||||||
{
|
{
|
||||||
|
%rowIndex = %row.getParent().getObjectIndex(%row);
|
||||||
%rowIndex--; //Offset the rowIndex to account for controlset option
|
%rowIndex--; //Offset the rowIndex to account for controlset option
|
||||||
%name = $RemapName[%rowIndex];
|
%name = $RemapName[%rowIndex];
|
||||||
|
|
||||||
RemapDlg-->OptRemapText.setValue( "Re-bind \"" @ %name @ "\" to..." );
|
RemapDlg-->OptRemapText.text = "Re-bind \"" @ %name @ "\" to..." ;
|
||||||
OptRemapInputCtrl.index = %rowIndex;
|
OptRemapInputCtrl.index = %rowIndex;
|
||||||
Canvas.pushDialog( RemapDlg );
|
Canvas.pushDialog( RemapDlg );
|
||||||
|
|
||||||
|
|
@ -223,7 +224,7 @@ function doKeyRemap( %rowIndex )
|
||||||
function ControlsMenuRebindButton::onClick(%this)
|
function ControlsMenuRebindButton::onClick(%this)
|
||||||
{
|
{
|
||||||
%name = $RemapName[%this.keybindIndex];
|
%name = $RemapName[%this.keybindIndex];
|
||||||
RemapDlg-->OptRemapText.setValue( "Re-bind \"" @ %name @ "\" to..." );
|
RemapDlg-->OptRemapText.text = "Re-bind \"" @ %name @ "\" to..." ;
|
||||||
|
|
||||||
OptRemapInputCtrl.index = %this.keybindIndex;
|
OptRemapInputCtrl.index = %this.keybindIndex;
|
||||||
OptRemapInputCtrl.optionIndex = %this.optionIndex;
|
OptRemapInputCtrl.optionIndex = %this.optionIndex;
|
||||||
|
|
@ -305,16 +306,12 @@ function OptRemapInputCtrl::onInputEvent( %this, %device, %action )
|
||||||
%prevCmdName = $RemapName[%prevMapIndex];
|
%prevCmdName = $RemapName[%prevMapIndex];
|
||||||
Canvas.pushDialog( RemapConfirmDlg );
|
Canvas.pushDialog( RemapConfirmDlg );
|
||||||
|
|
||||||
RemapConfirmationText.setText("\"" @ %mapName @ "\" is already bound to \""
|
%remapWarnText = "\"" @ %mapName @ "\" is already bound to \"" @ %prevCmdName @ "\"! Do you wish to replace this mapping?";
|
||||||
@ %prevCmdName @ "\"! Do you wish to replace this mapping?");
|
%doRemapCommand = "redoMapping(" @ %device @ ", " @ %actionMap @ ", \"" @ %action @ "\", \"" @
|
||||||
RemapConfirmationYesButton.command = "redoMapping(" @ %device @ ", " @ %actionMap @ ", \"" @ %action @ "\", \"" @
|
|
||||||
%cmd @ "\", " @ %prevMapIndex @ ", " @ %this.index @ "); Canvas.popDialog();";
|
%cmd @ "\", " @ %prevMapIndex @ ", " @ %this.index @ "); Canvas.popDialog();";
|
||||||
RemapConfirmationNoButton.command = "Canvas.popDialog();";
|
%cancelCommand = "Canvas.popDialog();";
|
||||||
|
|
||||||
/*MessageBoxYesNo( "Warning",
|
MessageBoxYesNo( "Key already in use", %remapWarnText, %doRemapCommand, %cancelCommand );
|
||||||
"\"" @ %mapName @ "\" is already bound to \""
|
|
||||||
@ %prevCmdName @ "\"!\nDo you wish to replace this mapping?",
|
|
||||||
%callback, "" );*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function findRemapCmdIndex( %command )
|
function findRemapCmdIndex( %command )
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,11 @@ new GuiControlProfile(MenuMLSubHeaderText)
|
||||||
autoSizeHeight = true;
|
autoSizeHeight = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
new GuiControlProfile(MenuMLSubHeaderTextCenter : MenuMLSubHeaderText)
|
||||||
|
{
|
||||||
|
justify = "center";
|
||||||
|
};
|
||||||
|
|
||||||
if( !isObject( GuiMenuButtonProfile ) )
|
if( !isObject( GuiMenuButtonProfile ) )
|
||||||
new GuiControlProfile( GuiMenuButtonProfile )
|
new GuiControlProfile( GuiMenuButtonProfile )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue