mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-24 06:39:26 +00:00
- Complied the SystemMenu buttons to the groupNum highlighting implementation as they're simple buttons
- Fixed issue of Query Server on-screen button tripping a join action - Added playername textEdit field to Join Server menu - Fixed issue of messageBox on-screen buttons not making the input events properly after adding the make/break check from prior commit - Added MenuTextEditProfile for editable text fields in menu - Fixed issue of not getting the correct shift key bitmap if the button name was l/rshift
This commit is contained in:
parent
e71880b898
commit
150684a47d
6 changed files with 87 additions and 23 deletions
|
|
@ -22,6 +22,8 @@ $guiContent = new GuiControl(SystemMenu) {
|
|||
profile = "GuiMenuButtonProfile";
|
||||
command = "Canvas.popDialog(GameMenu);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
groupNum = "1";
|
||||
class = "SystemMenuButton";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Options";
|
||||
|
|
@ -30,6 +32,8 @@ $guiContent = new GuiControl(SystemMenu) {
|
|||
profile = "GuiMenuButtonProfile";
|
||||
command = "Canvas.pushDialog(OptionsMenu);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
groupNum = "1";
|
||||
class = "SystemMenuButton";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Exit to Menu";
|
||||
|
|
@ -38,6 +42,8 @@ $guiContent = new GuiControl(SystemMenu) {
|
|||
profile = "GuiMenuButtonProfile";
|
||||
command = "systemMenuExitToMenu();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
groupNum = "1";
|
||||
class = "SystemMenuButton";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Exit to Desktop";
|
||||
|
|
@ -46,6 +52,8 @@ $guiContent = new GuiControl(SystemMenu) {
|
|||
profile = "GuiMenuButtonProfile";
|
||||
command = "systemMenuExitToDesktop();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
groupNum = "1";
|
||||
class = "SystemMenuButton";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ function SystemMenu::onWake(%this)
|
|||
{
|
||||
$MenuList = SystemMenuButtonList;
|
||||
$MenuList.listPosition = 0;
|
||||
|
||||
$MenuList.syncGui();
|
||||
}
|
||||
|
||||
function SystemMenu::onSleep(%this)
|
||||
|
|
@ -19,10 +21,14 @@ function systemMenuExitToDesktop()
|
|||
MessageBoxOKCancel("Exit?", "Do you wish to exit to the desktop?", "quit();", "");
|
||||
}
|
||||
|
||||
function SystemMenuButton::onHighlighted(%this, %highlighted)
|
||||
{
|
||||
if(%highlighted)
|
||||
$MenuList.listPosition = $MenuList.getObjectIndex(%this);
|
||||
}
|
||||
|
||||
function SystemMenuButtonList::syncGUI(%this)
|
||||
{
|
||||
%this.callOnChildren("setHighlighted", false);
|
||||
|
||||
%btn = %this.getObject(%this.listPosition);
|
||||
%btn.setHighlighted(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
tooltipProfile = "GuiToolTipProfile";
|
||||
isContainer = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
|
||||
new GuiInputCtrl(JoinServerInputHandler) {
|
||||
ignoreMouseEvents = "1";
|
||||
ActionMap = "JoinServerActionMap";
|
||||
|
|
@ -18,7 +18,6 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
profile = "GuiInputCtrlProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
|
||||
new GuiPanel(JoinServerTitlePanel) {
|
||||
extent = "1281 60";
|
||||
horizSizing = "width";
|
||||
|
|
@ -34,23 +33,45 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
};
|
||||
};
|
||||
new GuiContainer() {
|
||||
position = "203 61";
|
||||
position = "190 61";
|
||||
extent = "900 30";
|
||||
profile = GuiMenuPanelProfile;
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
|
||||
new GuiTextCtrl() {
|
||||
text = "Player Name";
|
||||
position = "0 5";
|
||||
extent = "98 23";
|
||||
vertSizing = "center";
|
||||
profile = "MenuMLSubHeaderText";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
new GuiTextEditCtrl(JoinServerPlayerNameTxt) {
|
||||
text = "Visitor";
|
||||
position = "606 7";
|
||||
extent = "295 18";
|
||||
horizSizing = "left";
|
||||
vertSizing = "center";
|
||||
profile = "MenuTextEditprofile";
|
||||
variable = "$pref::Player::Name";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
};
|
||||
new GuiContainer() {
|
||||
position = "190 97";
|
||||
extent = "900 30";
|
||||
horizSizing = "center";
|
||||
profile = "GuiMenuPanelProfile";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
|
||||
new GuiTextCtrl() {
|
||||
text = "Server Details";
|
||||
position = "0 0";
|
||||
extent = "700 30";
|
||||
horizSizing = "right";
|
||||
vertSizing = "center";
|
||||
profile = "MenuSubHeaderText";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
|
||||
new GuiTextCtrl() {
|
||||
text = "Ping";
|
||||
position = "700 0";
|
||||
|
|
@ -60,7 +81,6 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
profile = "MenuSubHeaderCenteredText";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
|
||||
new GuiTextCtrl() {
|
||||
text = "Player Count";
|
||||
position = "770 0";
|
||||
|
|
@ -70,12 +90,12 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
profile = "MenuSubHeaderCenteredText";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
};
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
position = "203 91";
|
||||
extent = "900 621";
|
||||
position = "190 127";
|
||||
extent = "900 551";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "center";
|
||||
vertSizing = "height";
|
||||
|
|
@ -102,7 +122,7 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
tooltipProfile = "GuiToolTipProfile";
|
||||
|
||||
new GuiIconButtonCtrl(JoinServerJoinBtn) {
|
||||
BitmapAsset = "UI:Keyboard_Black_Return_image";
|
||||
BitmapAsset = "UI:Keyboard_Black_Space_image";
|
||||
sizeIconToButton = "1";
|
||||
makeIconSquare = "1";
|
||||
textLocation = "Center";
|
||||
|
|
@ -112,11 +132,12 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
horizSizing = "left";
|
||||
vertSizing = "center";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
active = "0";
|
||||
command = "JoinServerMenu.join();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
new GuiIconButtonCtrl(JoinServerQLanBtn) {
|
||||
BitmapAsset = "UI:Keyboard_Black_Escape_image";
|
||||
BitmapAsset = "UI:Keyboard_Black_E_image";
|
||||
sizeIconToButton = "1";
|
||||
makeIconSquare = "1";
|
||||
textLocation = "Center";
|
||||
|
|
@ -130,7 +151,7 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
new GuiIconButtonCtrl(JoinServerQServerBtn) {
|
||||
BitmapAsset = "UI:Keyboard_Black_Escape_image";
|
||||
BitmapAsset = "UI:Keyboard_Black_Q_image";
|
||||
sizeIconToButton = "1";
|
||||
makeIconSquare = "1";
|
||||
textLocation = "Center";
|
||||
|
|
@ -140,7 +161,7 @@ $guiContent = new GuiControl(JoinServerMenu) {
|
|||
horizSizing = "left";
|
||||
vertSizing = "center";
|
||||
profile = "GuiMenuButtonProfile";
|
||||
command = "JoinServerMenu.join();";
|
||||
command = "JoinServerMenu.query();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
};
|
||||
new GuiIconButtonCtrl(JoinServerBackBtn) {
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ function MessageBoxOK(%title, %message, %callback)
|
|||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
%okButton = MessageBoxCtrl.createButton("OK", "messageBoxYesClicked();");
|
||||
%okButton = MessageBoxCtrl.createButton("OK", "messageBoxYesClicked(1);");
|
||||
%bitmapAssetId = MessageBoxActionMap.getCommandButtonBitmap(Canvas.getLastInputDevice(), "messageBoxYesClicked");
|
||||
%okButton.setBitmap(%bitmapAssetId);
|
||||
|
||||
|
|
@ -182,11 +182,11 @@ function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback, %okLab
|
|||
else
|
||||
%cancelLabel = %cancelLabelOverride;
|
||||
|
||||
%okButton = MessageBoxCtrl.createButton(%okLabel, "messageBoxYesClicked();");
|
||||
%okButton = MessageBoxCtrl.createButton(%okLabel, "messageBoxYesClicked(1);");
|
||||
%bitmapAssetId = MessageBoxActionMap.getCommandButtonBitmap(Canvas.getLastInputDevice(), "messageBoxYesClicked");
|
||||
%okButton.setBitmap(%bitmapAssetId);
|
||||
|
||||
%cancelButton = MessageBoxCtrl.createButton(%cancelLabel, "messageBoxNoClicked();");
|
||||
%cancelButton = MessageBoxCtrl.createButton(%cancelLabel, "messageBoxNoClicked(1);");
|
||||
%bitmapAssetId = MessageBoxActionMap.getCommandButtonBitmap(Canvas.getLastInputDevice(), "messageBoxNoClicked");
|
||||
%cancelButton.setBitmap(%bitmapAssetId);
|
||||
|
||||
|
|
|
|||
|
|
@ -200,4 +200,30 @@ singleton GuiControlProfile(GuiMenuScrollProfile)
|
|||
bitmapAsset = "UI:scrollBar_image";
|
||||
hasBitmapArray = true;
|
||||
category = "BaseUI";
|
||||
};
|
||||
};
|
||||
|
||||
new GuiControlProfile(MenuTextEditprofile)
|
||||
{
|
||||
opaque = true;
|
||||
fillColor = "10 10 10 255";
|
||||
fillColorHL = "10 10 10 255";
|
||||
fontColor = "240 240 240";
|
||||
fontColorHL = "10 10 10 255";
|
||||
fontColorSEL = "255 255 255 255";
|
||||
fontColorNA = "200 200 200";
|
||||
textOffset = "4 2";
|
||||
autoSizeWidth = false;
|
||||
autoSizeHeight = true;
|
||||
justify = "left";
|
||||
tab = true;
|
||||
canKeyFocus = true;
|
||||
category = "BaseUI";
|
||||
borderColorSEL = "0 0 0 0";
|
||||
fontColors[0] = "240 240 240 255";
|
||||
fontColors[1] = "10 10 10 255";
|
||||
fontColors[2] = "200 200 200 255";
|
||||
fontColors[3] = "255 255 255 255";
|
||||
fillColorSEL = "10 10 10 255";
|
||||
fontSize = "18";
|
||||
cursorColor = "255 255 255 255";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -113,6 +113,9 @@ function getButtonBitmap(%device, %button)
|
|||
}
|
||||
else if(%device $= "Keyboard" || %device $= "Mouse")
|
||||
{
|
||||
if(%button $= "lshift" || %button $= "rshift")
|
||||
%button = "shift";
|
||||
|
||||
%assetId = "UI:Keyboard_Black_" @ %button @ "_image";
|
||||
}
|
||||
else if(%device !$= "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue