function ChooseLevelMenu::fillPrefEntries( %this ) utility method to set gui elements to prefs

This commit is contained in:
AzaezelX 2024-01-04 12:55:07 -06:00
parent 2fee2902f6
commit e4342079f1
2 changed files with 16 additions and 6 deletions

View file

@ -187,7 +187,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
profile = "MenuMLSubHeaderText";
tooltipProfile = "GuiToolTipProfile";
};
new GuiTextEditCtrl() {
new GuiTextEditCtrl(playerNameCTRL) {
text = "Visitor";
position = "606 4";
extent = "295 22";
@ -213,8 +213,8 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
profile = "MenuMLSubHeaderText";
tooltipProfile = "GuiToolTipProfile";
};
new GuiTextEditCtrl() {
text = "Torque 3D Server";
new GuiTextEditCtrl(serverNameCTRL) {
text = "";
position = "606 4";
extent = "295 22";
horizSizing = "left";
@ -239,7 +239,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
profile = "MenuMLSubHeaderText";
tooltipProfile = "GuiToolTipProfile";
};
new GuiTextEditCtrl() {
new GuiTextEditCtrl(serverPassCTRL) {
text = "";
position = "606 4";
extent = "295 22";
@ -265,7 +265,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
profile = "MenuMLSubHeaderText";
tooltipProfile = "GuiToolTipProfile";
};
new GuiTextEditCtrl() {
new GuiTextEditCtrl(serverInfoCTRL) {
text = "This is a Torque 3D server.";
position = "606 4";
extent = "295 22";
@ -291,7 +291,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) {
profile = "MenuMLSubHeaderText";
tooltipProfile = "GuiToolTipProfile";
};
new GuiTextEditCtrl(JoinServerPlayerNameTxt) {
new GuiTextEditCtrl(serverMaxPlayersCTRL) {
text = "64";
position = "606 4";
extent = "295 22";

View file

@ -26,6 +26,16 @@ function ChooseLevelMenu::onAdd( %this )
new AssetQuery(ChooseLevelAssetQuery);
%this.previewButtonSize = "445 120";
%this.fillPrefEntries();
}
function ChooseLevelMenu::fillPrefEntries( %this )
{
serverNameCTRL.setText($Pref::Player::Name);
serverNameCTRL.setText($Pref::Server::Name);
serverPassCTRL.setText($Pref::Server::Password);
serverInfoCTRL.setText($Pref::Server::Info);
serverMaxPlayersCTRL.setText($Pref::Server::MaxPlayers);
}
function ChooseLevelMenu::onWake(%this)