mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 23:05:38 +00:00
Initial pass to rework and cleanup the main UI interface
Implements interface buttons that react to input type and visually display keybinds Updates the T3D icon and splash screen
This commit is contained in:
parent
157b114ec7
commit
bc27125e90
188 changed files with 2553 additions and 758 deletions
|
|
@ -38,29 +38,17 @@ new SFXProfile(messageBoxBeep)
|
|||
preload = true;
|
||||
};*/
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// messageCallback
|
||||
// Calls a callback passed to a message box.
|
||||
//---------------------------------------------------------------------------------------------
|
||||
function messageCallback(%dlg, %callback)
|
||||
{
|
||||
Canvas.popDialog(%dlg);
|
||||
eval(%callback);
|
||||
}
|
||||
|
||||
//The # in the function passed replaced with the output
|
||||
//of the preset menu.
|
||||
function IOCallback(%dlg, %callback)
|
||||
{
|
||||
%id = IODropdownMenu.getSelected();
|
||||
%text = IODropdownMenu.getTextById(%id);
|
||||
%callback = strreplace(%callback, "#", %text);
|
||||
eval(%callback);
|
||||
MessageBoxDlg.originalMenubuttonContainer.add(GamepadButtonsGui);
|
||||
MessageBoxDlg.originalMenubuttonContainer.refresh();
|
||||
|
||||
Canvas.popDialog(%dlg);
|
||||
eval(%callback);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
@ -102,12 +90,21 @@ function MBSetText(%text, %frame, %msg)
|
|||
// callback for each button.
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
//MessageBoxOK("Test", "This is a test message box", "echo(\"Uhhhhhawhat?\"");
|
||||
function MessageBoxOK(%title, %message, %callback)
|
||||
{
|
||||
MBOKFrame.text = %title;
|
||||
Canvas.pushDialog(MessageBoxOKDlg);
|
||||
MBSetText(MBOKText, MBOKFrame, %message);
|
||||
MessageBoxOKDlg.callback = %callback;
|
||||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent();
|
||||
|
||||
MessageBoxButtonHolder.add(GamepadButtonsGui);
|
||||
GamepadButtonsGui.clearButtons();
|
||||
GamepadButtonsGui.setButton(7, "A", "", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
|
||||
GamepadButtonsGui.refreshButtons();
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
MessageBoxDlg.callback = %callback;
|
||||
}
|
||||
|
||||
function MessageBoxOKDlg::onSleep( %this )
|
||||
|
|
@ -117,11 +114,20 @@ function MessageBoxOKDlg::onSleep( %this )
|
|||
|
||||
function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
|
||||
{
|
||||
MBOKCancelFrame.text = %title;
|
||||
Canvas.pushDialog(MessageBoxOKCancelDlg);
|
||||
MBSetText(MBOKCancelText, MBOKCancelFrame, %message);
|
||||
MessageBoxOKCancelDlg.callback = %callback;
|
||||
MessageBoxOKCancelDlg.cancelCallback = %cancelCallback;
|
||||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent();
|
||||
|
||||
MessageBoxButtonHolder.add(GamepadButtonsGui);
|
||||
GamepadButtonsGui.clearButtons();
|
||||
GamepadButtonsGui.setButton(5, "A", "", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
|
||||
GamepadButtonsGui.setButton(6, "B", "", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
|
||||
GamepadButtonsGui.refreshButtons();
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
MessageBoxDlg.callback = %callback;
|
||||
MessageBoxDlg.cancelCallback = %cancelCallback;
|
||||
}
|
||||
|
||||
function MessageBoxOKCancelDlg::onSleep( %this )
|
||||
|
|
@ -202,28 +208,49 @@ function MessageBoxOKCancelDetailsDlg::onSleep( %this )
|
|||
|
||||
function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback)
|
||||
{
|
||||
MBYesNoFrame.text = %title;
|
||||
Canvas.pushDialog(MessageBoxYesNoDlg);
|
||||
MBSetText(MBYesNoText, MBYesNoFrame, %message);
|
||||
MessageBoxYesNoDlg.yesCallBack = %yesCallback;
|
||||
MessageBoxYesNoDlg.noCallback = %noCallBack;
|
||||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent();
|
||||
|
||||
MessageBoxButtonHolder.add(GamepadButtonsGui);
|
||||
GamepadButtonsGui.clearButtons();
|
||||
GamepadButtonsGui.setButton(5, "A", "", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
|
||||
GamepadButtonsGui.setButton(6, "B", "", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
|
||||
GamepadButtonsGui.refreshButtons();
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
MessageBoxDlg.yesCallBack = %yesCallback;
|
||||
MessageBoxDlg.noCallback = %noCallback;
|
||||
}
|
||||
|
||||
function MessageBoxYesNoCancel(%title, %message, %yesCallback, %noCallback, %cancelCallback)
|
||||
{
|
||||
MBYesNoCancelFrame.text = %title;
|
||||
MessageBoxYesNoDlg.profile = "GuiOverlayProfile";
|
||||
Canvas.pushDialog(MessageBoxYesNoCancelDlg);
|
||||
MBSetText(MBYesNoCancelText, MBYesNoCancelFrame, %message);
|
||||
MessageBoxYesNoCancelDlg.yesCallBack = %yesCallback;
|
||||
MessageBoxYesNoCancelDlg.noCallback = %noCallBack;
|
||||
MessageBoxYesNoCancelDlg.cancelCallback = %cancelCallback;
|
||||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent();
|
||||
|
||||
MessageBoxButtonHolder.add(GamepadButtonsGui);
|
||||
GamepadButtonsGui.clearButtons();
|
||||
GamepadButtonsGui.setButton(5, "A", "", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
|
||||
GamepadButtonsGui.setButton(6, "B", "", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
|
||||
GamepadButtonsGui.setButton(7, "Back", "", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
|
||||
GamepadButtonsGui.refreshButtons();
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
MessageBoxDlg.yesCallBack = %yesCallback;
|
||||
MessageBoxDlg.noCallback = %noCallback;
|
||||
MessageBoxDlg.cancelCallback = %cancelCallback;
|
||||
}
|
||||
|
||||
function MessageBoxYesNoDlg::onSleep( %this )
|
||||
function MessageBoxDlg::onSleep( %this )
|
||||
{
|
||||
%this.callback = "";
|
||||
%this.cancelCallback = "";
|
||||
%this.yesCallback = "";
|
||||
%this.noCallback = "";
|
||||
%this.cancelCallback = "";
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
@ -232,14 +259,19 @@ function MessageBoxYesNoDlg::onSleep( %this )
|
|||
//---------------------------------------------------------------------------------------------
|
||||
function MessagePopup(%title, %message, %delay)
|
||||
{
|
||||
// Currently two lines max.
|
||||
MessagePopFrame.setText(%title);
|
||||
Canvas.pushDialog(MessagePopupDlg);
|
||||
MBSetText(MessagePopText, MessagePopFrame, %message);
|
||||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
|
||||
if (%delay !$= "")
|
||||
schedule(%delay, 0, CloseMessagePopup);
|
||||
}
|
||||
|
||||
function CloseMessagePopup()
|
||||
{
|
||||
Canvas.popDialog(MessageBoxDlg);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// IODropdown
|
||||
// By passing in a simgroup or simset, the user will be able to choose a child of that group
|
||||
|
|
@ -273,7 +305,14 @@ function IODropdownDlg::onSleep( %this )
|
|||
IODropdownMenu.clear();
|
||||
}
|
||||
|
||||
function CloseMessagePopup()
|
||||
//The # in the function passed replaced with the output
|
||||
//of the preset menu.
|
||||
function IOCallback(%dlg, %callback)
|
||||
{
|
||||
Canvas.popDialog(MessagePopupDlg);
|
||||
%id = IODropdownMenu.getSelected();
|
||||
%text = IODropdownMenu.getTextById(%id);
|
||||
%callback = strreplace(%callback, "#", %text);
|
||||
eval(%callback);
|
||||
|
||||
Canvas.popDialog(%dlg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,75 @@
|
|||
|
||||
new GuiGameListMenuProfile(DefaultListMenuProfile)
|
||||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 20;
|
||||
fontColor = "120 120 120";
|
||||
fontColorSEL = "16 16 16";
|
||||
fontColorNA = "200 200 200";
|
||||
fontColorHL = "100 100 120";
|
||||
HitAreaUpperLeft = "16 20";
|
||||
HitAreaLowerRight = "503 74";
|
||||
IconOffset = "40 0";
|
||||
TextOffset = "100 0";
|
||||
RowSize = "500 90";
|
||||
ColumnSplit = "250";
|
||||
RightPad = "20";
|
||||
bitmap = "data/ui/images/listMenuArray";
|
||||
canKeyFocus = true;
|
||||
};
|
||||
|
||||
new GuiControlProfile(GamepadDefaultProfile)
|
||||
{
|
||||
border = 0;
|
||||
};
|
||||
|
||||
new GuiControlProfile(GamepadButtonTextLeft)
|
||||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 20;
|
||||
fontColor = "255 255 255";
|
||||
justify = "left";
|
||||
};
|
||||
|
||||
new GuiControlProfile(GamepadButtonTextRight : GamepadButtonTextLeft)
|
||||
{
|
||||
justify = "right";
|
||||
};
|
||||
|
||||
new GuiControlProfile(MenuHeaderText)
|
||||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 30;
|
||||
fontColor = "255 255 255";
|
||||
justify = "left";
|
||||
};
|
||||
|
||||
new GuiControlProfile(MenuHeaderTextCenter)
|
||||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 30;
|
||||
fontColor = "255 255 255";
|
||||
justify = "center";
|
||||
};
|
||||
|
||||
new GuiControlProfile(MenuSubHeaderText)
|
||||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 20;
|
||||
fontColor = "255 255 255";
|
||||
justify = "left";
|
||||
};
|
||||
|
||||
new GuiControlProfile(MenuMLSubHeaderText)
|
||||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 20;
|
||||
fontColor = "255 255 255";
|
||||
justify = "left";
|
||||
autoSizeWidth = true;
|
||||
autoSizeHeight = true;
|
||||
};
|
||||
|
||||
if( !isObject( GuiMenuButtonProfile ) )
|
||||
new GuiControlProfile( GuiMenuButtonProfile )
|
||||
{
|
||||
|
|
@ -5,10 +77,16 @@ new GuiControlProfile( GuiMenuButtonProfile )
|
|||
border = false;
|
||||
fontSize = 18;
|
||||
fontType = "Arial Bold";
|
||||
fontColor = "240 240 240";
|
||||
fontColorHL = "0 0 0";
|
||||
fontColor = "200 200 200";
|
||||
fontColorHL = "80 80 80";
|
||||
fontColorNA = "0 0 0";
|
||||
fontColorSEL ="0 0 0";
|
||||
fontColorSEL = "0 0 0";
|
||||
fillColor = "255 255 255 120";
|
||||
fillColorHL = "100 100 100 50";
|
||||
fillColorNA = "0 0 0 50";
|
||||
borderColor = "0 0 0 0";
|
||||
borderColorNA = "0 0 0 0";
|
||||
borderColorHL = "0 0 0 0";
|
||||
fixedExtent = false;
|
||||
justify = "center";
|
||||
canKeyFocus = false;
|
||||
|
|
@ -207,6 +285,7 @@ new GuiControlProfile( GuiTextArrayProfile : GuiTextProfile )
|
|||
fillColorSEL = "180 180 180";
|
||||
border = false;
|
||||
category = "Core";
|
||||
canKeyFocus = true;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
@ -404,11 +483,11 @@ new GuiControlProfile( GuiSliderProfile )
|
|||
if(!isObject(GuiMenuScrollProfile))
|
||||
new GuiControlProfile(GuiMenuScrollProfile)
|
||||
{
|
||||
opaque = true;
|
||||
opaque = false;
|
||||
fillcolor = "50 50 50";
|
||||
fontColor = "200 200 200";
|
||||
fontColorHL = "250 250 250";
|
||||
border = true;
|
||||
border = false;
|
||||
bitmap = "data/ui/images/scrollBar";
|
||||
hasBitmapArray = true;
|
||||
category = "Core";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue