Update MP Server descriptions
[fg:toms-fgdata.git] / gui / dialogs / multiplayer.xml
1 <?xml version="1.0"?>
2
3
4 <PropertyList>
5     <name>multiplayer</name>
6     <layout>vbox</layout>
7     <resizable>false</resizable>
8
9     <nasal>
10         <open>
11             if ((getprop("/sim/multiplay/selected-server") == nil) or 
12                 (getprop("/sim/multiplay/selected-server") == "" )   ){
13                 var tx = getprop("/sim/multiplay/txhost");
14                 var dlg = cmdarg();
15                 var servers = cmdarg().getChildren("group")[1].getChildren("combo")[0].getChildren("value");
16                 foreach (var s; servers) {
17                     var server = s.getValue();
18                     var host = split(" ", server)[0];
19                     if (host == tx) {
20                         setprop("/sim/multiplay/selected-server", server);
21                     }
22                 }
23             }
24         </open>
25         
26         <close>
27         </close>
28     </nasal>
29     
30     <!-- titlebar -->
31     <group>
32         <layout>hbox</layout>
33         <empty><stretch>1</stretch></empty>
34
35         <text>
36             <label>Multiplayer Settings</label>
37         </text>
38
39         <empty><stretch>1</stretch></empty>
40
41         <button>
42             <pref-width>16</pref-width>
43             <pref-height>16</pref-height>
44             <legend></legend>
45             <default>1</default>
46             <keynum>27</keynum>
47             <border>2</border>
48
49             <binding>
50                 <command>dialog-close</command>
51             </binding>
52         </button>
53     </group>
54     <hrule/>
55
56     <group>
57         <layout>table</layout>
58         <halign>center</halign>
59         <text>
60           <row>0</row><col>0</col>
61           <halign>right</halign>
62           <label>Callsign:</label>
63         </text>
64         <input>
65           <row>0</row><col>1</col>
66           <halign>left</halign>
67           <property>/sim/multiplay/callsign</property>
68         </input>
69         <text>
70           <row>1</row><col>0</col>
71           <halign>right</halign>
72           <label>Server:</label>
73         </text>
74         <combo>
75             <name>host</name>
76             <row>1</row><col>1</col>
77             <pref-width>350</pref-width>
78             <property>/sim/multiplay/selected-server</property>
79             <editable>false</editable>
80             <value>mpserver01.flightgear.org (Frankfurt, Germany)</value>
81             <value>mpserver02.flightgear.org (Kansas, USA)</value>
82             <value>mpserver03.flightgear.org (Germany)</value>
83             <value>mpserver04.flightgear.org (United Kingdom)</value>
84             <value>mpserver05.flightgear.org (Chicago, USA)</value>
85             <value>mpserver07.flightgear.org (Wisconsin, USA)</value>
86             <value>mpserver08.flightgear.org (Frankfurt am Main, Germany)</value>
87             <value>mpserver09.flightgear.org (Koln, Germany)</value>
88             <value>mpserver10.flightgear.org (Montpellier, France)</value>
89             <value>mpserver11.flightgear.org (Vilnius, Lithuania)</value>
90             <value>mpserver12.flightgear.org (Amsterdam, Netherlands)</value>
91             <value>mpserver13.flightgear.org (Grenoble, France)</value>
92         </combo>
93         
94     <!-- status area -->
95         <text>
96             <visible>
97                 <not><property>/sim/multiplay/online</property></not>
98             </visible>
99             <row>3</row>
100             <col>1</col>
101             <halign>left</halign>
102             <label>Not connected</label>
103         </text>
104         
105         <text>
106             <visible>
107                 <property>/sim/multiplay/online</property>
108             </visible>
109             <row>3</row>
110             <col>1</col>
111             <halign>left</halign>
112             <label>MMMMMMMMMMMMMMMMM</label>
113             <format>Connected to %s</format>
114             <property>/sim/multiplay/txhost</property>
115             <live>true</live>
116         </text>
117     </group>
118     
119     <hrule/>
120     <group>
121         <layout>hbox</layout>
122         <default-padding>10</default-padding>
123         <empty><stretch>true</stretch></empty>
124
125         <button>
126           <legend>Connect</legend>
127           <enable>
128             <not>
129               <property>/sim/multiplay/online</property>
130             </not>
131           </enable>
132           <binding>
133             <command>dialog-apply</command>
134           </binding>
135           <binding>
136             <command>nasal</command>
137             <script>
138               var server = getprop("/sim/multiplay/selected-server");
139               # Get the server name by splitting on the space between
140               # the hostname and the comment.
141               server = split(" ", server)[0];
142               setprop("/sim/multiplay/txhost", server);
143             </script> 
144           </binding>
145           <binding>
146             <command>reinit</command>
147             <subsystem>mp</subsystem>
148           </binding>
149         </button>
150         <button>
151           <legend>Disconnect</legend>
152           <enable>
153             <property>/sim/multiplay/online</property>
154           </enable>
155           <binding>
156             <command>dialog-apply</command>
157           </binding>
158           <binding>
159             <command>nasal</command>
160             <script>
161               setprop("/sim/multiplay/txhost", "0.0.0.0");
162             </script> 
163           </binding>
164           <binding>
165             <command>reinit</command>
166             <subsystem>mp</subsystem>
167           </binding>
168         </button>
169         <button>
170           <legend>Close</legend>
171           <equal>true</equal>
172           <binding>
173             <command>dialog-close</command>
174           </binding>
175         </button>
176
177         <empty><stretch>true</stretch></empty>
178     </group>
179     
180 </PropertyList>