Game Development Community

dev|Pro Game Development Curriculum

Network Preferences Tab Add-On for Options GUI

by BrokeAss Games · 11/27/2005 (10:45 pm) · 7 comments

This is an additional tab for the Options GUI that allows you to edit some of the network preferences in Torque.

In starter.fps/client/scripts/optionsDlg.cs...

After:
OptGraphicsPane.setVisible(false);
Add this:
OptNetworkPane.setVisible(false);

In starter.fps/client/ui/optionsDlg.gui...

After:
new GuiButtonCtrl() {
         profile = "GuiButtonProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "107 23";
         extent = "78 23";
         minExtent = "8 8";
         visible = "1";
         command = "optionsDlg.setPane(Audio);";
         text = "Audio";
         groupNum = "-1";
         buttonType = "PushButton";
            helpTag = "0";
      };
Add this:
new GuiButtonCtrl() {
         profile = "GuiButtonProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "203 23";
         extent = "78 23";
         minExtent = "8 8";
         visible = "1";
         command = "optionsDlg.setPane(Network);";
         text = "Network";
         groupNum = "-1";
         buttonType = "PushButton";
            helpTag = "0";
      };
And before this:
new GuiControl(OptControlsPane) {
Add this:
new GuiControl(OptNetworkPane) {
         profile = "GuiWindowProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "9 55";
         extent = "464 208";
         minExtent = "8 8";
         visible = "1";
            helpTag = "0";

         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "16 2";
            extent = "58 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Zone Name:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtServerName) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "74 2";
            extent = "146 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::Name";
            lockMouse = "0";
            maxLength = "10";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextEditCtrl(txtServerInfo) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "74 22";
            extent = "146 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::Info";
            lockMouse = "0";
            maxLength = "255";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "25 22";
            extent = "49 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Zone Info:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtServerPort) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "74 42";
            extent = "146 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::Port";
            lockMouse = "0";
            maxLength = "5";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "23 42";
            extent = "50 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Zone Port:";
            maxLength = "255";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "235 2";
            extent = "62 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Max Players:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtMaxPlayers) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "297 2";
            extent = "41 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::MaxPlayers";
            lockMouse = "0";
            maxLength = "3";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "261 21";
            extent = "36 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Region:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtRegion) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "297 21";
            extent = "41 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::RegionMask";
            lockMouse = "0";
            maxLength = "2";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "250 41";
            extent = "47 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Ban Time:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtBanTime) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "297 41";
            extent = "41 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::BanTime";
            lockMouse = "0";
            maxLength = "10";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "227 61";
            extent = "70 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Kick Ban Time:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtKickBanTime) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "297 61";
            extent = "41 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::KickBanTime";
            lockMouse = "0";
            maxLength = "10";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "14 63";
            extent = "60 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Admin Pass:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtAdminPass) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "74 63";
            extent = "146 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::AdminPassword";
            lockMouse = "0";
            maxLength = "255";
            historySize = "0";
            password = "1";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "27 103";
            extent = "46 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Cluster 1:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtClusterMaster) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "74 103";
            extent = "246 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Master0";
            lockMouse = "0";
            maxLength = "255";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "19 83";
            extent = "55 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Zone Pass:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtServerPass) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "74 83";
            extent = "146 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::Password";
            lockMouse = "0";
            maxLength = "255";
            historySize = "0";
            password = "1";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "27 123";
            extent = "46 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Cluster 2:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtClusterMaster1) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "74 123";
            extent = "246 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Master1";
            lockMouse = "0";
            maxLength = "255";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextEditCtrl(txtRateToClient) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "421 2";
            extent = "41 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$pref::Net::PacketRateToClient";
            lockMouse = "0";
            maxLength = "10";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "350 2";
            extent = "71 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Client Pkt Rate:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtRateToClient) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "421 23";
            extent = "41 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$pref::Net::PacketRateToServer";
            lockMouse = "0";
            maxLength = "10";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "351 23";
            extent = "70 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Zone Pkt Rate:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtRateToClient) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "421 43";
            extent = "41 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$pref::Net::PacketSize";
            lockMouse = "0";
            maxLength = "10";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "362 43";
            extent = "59 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Packet Size:";
            maxLength = "255";
         };
         new GuiTextCtrl() {
            profile = "GuiTextProfile";
            horizSizing = "relative";
            vertSizing = "relative";
            position = "352 62";
            extent = "69 18";
            minExtent = "8 2";
            visible = "1";
            lockMouse = "0";
            text = "Max Chat Len:";
            maxLength = "255";
         };
         new GuiTextEditCtrl(txtRateToClient) {
            profile = "GuiTextEditProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "421 62";
            extent = "41 18";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::MaxChatLen";
            lockMouse = "0";
            maxLength = "10";
            historySize = "0";
            password = "0";
            tabComplete = "0";
            sinkAllKeyEvents = "0";
         };
         new GuiCheckBoxCtrl() {
            profile = "GuiCheckBoxProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "226 75";
            extent = "140 30";
            minExtent = "8 2";
            visible = "1";
            variable = "$Pref::Server::FloodProtectionEnabled";
            text = "Flood Protection";
            groupNum = "-1";
            buttonType = "ToggleButton";
         };
      };

www.brokeassgames.com/images/netoptions.jpg
Please post any other network preferences that would be useful to this.

#1
11/28/2005 (12:22 am)
This is very useful, thank you, I was wondering what to do with the empty network pane in my options dialog =)
#2
11/29/2005 (5:32 am)
How about a screenshot for us to oogle?

My brain is having trouble (Edit: ok I'm just lazy) picturing what's on the tab.
#3
11/29/2005 (3:19 pm)
I would be carefull when playing with: $Pref::Server::RegionMask

It is a legacy from Tribes 2 and can tend to result in odd behavior with the Join GUI Filters
#4
12/03/2005 (7:51 pm)
Sweet, thanks :]
#5
12/06/2005 (7:42 am)
In your optionsDlg.gui section, the "After" and "Add this" codeblocks are identical.
#6
12/06/2005 (4:30 pm)
@BigPapa
Thx, fixed.
#7
07/02/2007 (8:12 am)
Nice resource :)