瀏覽代碼

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

AzaezelX 1 年之前
父節點
當前提交
e4342079f1

+ 6 - 6
Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.gui

@@ -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";

+ 10 - 0
Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.tscript

@@ -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)