1 # Window: Scenarios, for Unix Micropolis.
3 # Micropolis, Unix Version. This game was released for the Unix platform
4 # in or about 1990 and has been modified for inclusion in the One Laptop
5 # Per Child program. Copyright (C) 1989 - 2007 Electronic Arts Inc. If
6 # you need assistance with this program, you may contact:
7 # http://wiki.laptop.org/go/Micropolis or email micropolis@laptop.org.
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or (at
12 # your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details. You should have received a
18 # copy of the GNU General Public License along with this program. If
19 # not, see <http://www.gnu.org/licenses/>.
21 # ADDITIONAL TERMS per GNU GPL Section 7
23 # No trademark or publicity rights are granted. This license does NOT
24 # give you any right, title or interest in the trademark SimCity or any
25 # other Electronic Arts trademark. You may not distribute any
26 # modification of this program using the trademark SimCity or claim any
27 # affliation or association with Electronic Arts Inc. or its employees.
29 # Any propagation or conveyance of this program must include this
30 # copyright notice and these terms.
32 # If you convey this program (or any modifications of it) and assume
33 # contractual liability for the program to recipients of it, you agree
34 # to indemnify Electronic Arts for any liability that those contractual
35 # assumptions impose on Electronic Arts.
37 # You may not misrepresent the origins of this program; modified
38 # versions of the program must be marked as such and not identified as
39 # the original program.
41 # This disclaimer supplements the one included in the General Public
42 # License. TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, THIS
43 # PROGRAM IS PROVIDED TO YOU "AS IS," WITH ALL FAULTS, WITHOUT WARRANTY
44 # OF ANY KIND, AND YOUR USE IS AT YOUR SOLE RISK. THE ENTIRE RISK OF
45 # SATISFACTORY QUALITY AND PERFORMANCE RESIDES WITH YOU. ELECTRONIC ARTS
46 # DISCLAIMS ANY AND ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES,
47 # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY,
48 # FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY
49 # RIGHTS, AND WARRANTIES (IF ANY) ARISING FROM A COURSE OF DEALING,
50 # USAGE, OR TRADE PRACTICE. ELECTRONIC ARTS DOES NOT WARRANT AGAINST
51 # INTERFERENCE WITH YOUR ENJOYMENT OF THE PROGRAM; THAT THE PROGRAM WILL
52 # MEET YOUR REQUIREMENTS; THAT OPERATION OF THE PROGRAM WILL BE
53 # UNINTERRUPTED OR ERROR-FREE, OR THAT THE PROGRAM WILL BE COMPATIBLE
54 # WITH THIRD PARTY SOFTWARE OR THAT ANY ERRORS IN THE PROGRAM WILL BE
55 # CORRECTED. NO ORAL OR WRITTEN ADVICE PROVIDED BY ELECTRONIC ARTS OR
56 # ANY AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SOME
57 # JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF OR LIMITATIONS ON IMPLIED
58 # WARRANTIES OR THE LIMITATIONS ON THE APPLICABLE STATUTORY RIGHTS OF A
59 # CONSUMER, SO SOME OR ALL OF THE ABOVE EXCLUSIONS AND LIMITATIONS MAY
62 global ScenarioWindows
64 set parent
[WindowLink
$head.col2
]
65 set win
$parent.scenario
$n
66 set ScenarioWindows
[linsert $ScenarioWindows 0 $win]
68 global ScenarioPanelWidth
69 global ScenarioPanelHeight
71 LinkWindow
$head.scenario
$win
72 LinkWindow
$win.head
$head
73 LinkWindow
$win.parent
$parent
77 -width $ScenarioPanelWidth \
78 -height $ScenarioPanelHeight
83 -borderwidth 0 -geometry 100x470
85 label $win.scen.micropolis
\
86 -bitmap "@images/micropolisl.xpm" \
87 -font [Font
$win Medium
]
89 button $win.scen.newcity
\
90 -command "UIGenerateNewCity" \
93 -bitmap "@images/scncty.xpm" \
94 -font [Font
$win Medium
]
96 SetHelp
$win.scen.newcity Scenario.NewCity
98 button $win.scen.loadcity
\
99 -command "UILoadCity $head" \
102 -bitmap "@images/sclcty.xpm" \
103 -font [Font
$win Medium
]
105 SetHelp
$win.scen.loadcity Scenario.LoadCity
107 button $win.scen.dullsville
\
108 -command {UILoadScenario
1} \
111 -bitmap "@images/scdull.xpm" \
112 -font [Font
$win Medium
]
114 SetHelp
$win.scen.dullsville Scenario.Dullsville
116 button $win.scen.sanfrancisco
\
117 -command {UILoadScenario
2} \
120 -bitmap "@images/scsfo.xpm" \
121 -font [Font
$win Medium
]
123 SetHelp
$win.scen.sanfrancisco Scenario.SanFran
125 button $win.scen.hamburg
\
126 -command {UILoadScenario
3} \
129 -bitmap "@images/scham.xpm" \
130 -font [Font
$win Medium
]
132 SetHelp
$win.scen.hamburg Scenario.Hamburg
134 button $win.scen.bern
\
135 -command {UILoadScenario
4} \
138 -bitmap "@images/scbern.xpm" \
139 -font [Font
$win Medium
]
141 SetHelp
$win.scen.bern Scenario.Bern
143 button $win.scen.tokyo
\
144 -command {UILoadScenario
5} \
147 -bitmap "@images/sctkyo.xpm" \
148 -font [Font
$win Medium
]
150 SetHelp
$win.scen.tokyo Scenario.Tokyo
152 button $win.scen.rio
\
153 -command {UILoadScenario
8} \
156 -bitmap "@images/scrio.xpm" \
157 -font [Font
$win Medium
]
159 SetHelp
$win.scen.rio Scenario.Rio
161 button $win.scen.boston
\
162 -command {UILoadScenario
7} \
165 -bitmap "@images/scbos.xpm" \
166 -font [Font
$win Medium
]
168 SetHelp
$win.scen.boston Scenario.Boston
170 button $win.scen.detroit
\
171 -command {UILoadScenario
6} \
174 -bitmap "@images/scdet.xpm" \
175 -font [Font
$win Medium
]
177 SetHelp
$win.scen.detroit Scenario.Detroit
179 message $win.scen.labeldullville
\
181 -font [Font
$win Small
] \
183 -text {Dullsville
1900
186 SetHelp
$win.scen.labeldullville Scenario.Dullsville
188 message $win.scen.labelsanfrancisco
\
190 -font [Font
$win Small
] \
192 -text {San Francisco
1906
195 SetHelp
$win.scen.labelsanfrancisco Scenario.SanFran
197 message $win.scen.labelhamburg
\
199 -font [Font
$win Small
] \
204 SetHelp
$win.scen.labelhamburg Scenario.Hamburg
206 message $win.scen.labelbern
\
208 -font [Font
$win Small
] \
213 SetHelp
$win.scen.labelbern Scenario.Bern
215 message $win.scen.labeltokyo
\
217 -font [Font
$win Small
] \
222 SetHelp
$win.scen.labeltokyo Scenario.Tokyo
224 message $win.scen.labelrio
\
226 -font [Font
$win Small
] \
228 -text {Rio de Janeiro
2047
231 SetHelp
$win.scen.labelrio Scenario.Rio
233 message $win.scen.labelboston
\
235 -font [Font
$win Small
] \
240 SetHelp
$win.scen.labelboston Scenario.Boston
242 message $win.scen.labeldetroit
\
244 -font [Font
$win Small
] \
249 SetHelp
$win.scen.labeldetroit Scenario.Detroit
251 place $win.scen.micropolis
-anchor n
-x 265 -y 25
252 place $win.scen.newcity
-x 160 -y 120
253 place $win.scen.loadcity
-x 300 -y 120
254 place $win.scen.dullsville
-x 20 -y 230
255 place $win.scen.sanfrancisco
-x 160 -y 230
256 place $win.scen.hamburg
-x 300 -y 230
257 place $win.scen.bern
-x 440 -y 230
258 place $win.scen.tokyo
-x 20 -y 350
259 place $win.scen.rio
-x 160 -y 350
260 place $win.scen.boston
-x 300 -y 350
261 place $win.scen.detroit
-x 440 -y 350
262 place $win.scen.labeldullville
-anchor n
-x 54 -y 290
263 place $win.scen.labelsanfrancisco
-anchor n
-x 194 -y 290
264 place $win.scen.labelhamburg
-anchor n
-x 334 -y 290
265 place $win.scen.labelbern
-anchor n
-x 474 -y 290
266 place $win.scen.labeltokyo
-anchor n
-x 54 -y 410
267 place $win.scen.labelrio
-anchor n
-x 194 -y 410
268 place $win.scen.labelboston
-anchor n
-x 334 -y 410
269 place $win.scen.labeldetroit
-anchor n
-x 474 -y 410
271 BindSimButton
$win.scen.newcity
272 BindSimButton
$win.scen.loadcity
273 BindSimButton
$win.scen.dullsville
274 BindSimButton
$win.scen.sanfrancisco
275 BindSimButton
$win.scen.hamburg
276 BindSimButton
$win.scen.bern
277 BindSimButton
$win.scen.tokyo
278 BindSimButton
$win.scen.rio
279 BindSimButton
$win.scen.boston
280 BindSimButton
$win.scen.detroit
286 SetHelp
$win.name Scenario.Name
288 label $win.name.namelabel
\
290 -font [Font
$win Text
]
292 entry $win.name.cityname
\
294 -textvariable CityName
\
295 -font [Font
$win Text
] \
297 bind $win.name.cityname
<Return
> "DoEnterCityName $win"
298 bind $win.name.cityname
<Any-Enter
> {focus %W
}
299 LinkWindow
$win.cityname
$win.name.cityname
301 pack append $win.name
\
302 $win.name.namelabel
{left
frame e
}\
303 $win.name.cityname
{left
frame e
}
309 SetHelp
$win.level Scenario.Level
311 label $win.level.levellabel
\
312 -text {Game Level
:} \
313 -font [Font
$win Text
]
315 frame $win.level.radio
\
319 radiobutton $win.level.radio.easy
\
320 -text "Easy" -variable GameLevel
-value 0 \
321 -command "DoSetGameLevel 0" \
322 -font [Font
$win Large
]
324 radiobutton $win.level.radio.medium
\
325 -text "Medium" -variable GameLevel
-value 1 \
326 -command "DoSetGameLevel 1" \
327 -font [Font
$win Large
]
329 radiobutton $win.level.radio.hard
\
330 -text "Hard" -variable GameLevel
-value 2 \
331 -command "DoSetGameLevel 2" \
332 -font [Font
$win Large
]
334 pack append $win.level.radio
\
335 $win.level.radio.easy
{top
frame e expand fillx
}\
336 $win.level.radio.medium
{top
frame e expand fillx
}\
337 $win.level.radio.hard
{top
frame e expand fillx
}
339 frame $win.level.
label \
343 label $win.level.
label.easylabel
\
344 -text {Initial Funds
: $20,000} \
345 -font [Font
$win Large
] \
348 label $win.level.
label.mediumlabel
\
349 -text {Initial Funds
: $10,000} \
350 -font [Font
$win Large
] \
353 label $win.level.
label.hardlabel
\
354 -text {Initial Funds
: $5,000} \
355 -font [Font
$win Large
] \
358 pack append $win.level.
label \
359 $win.level.
label.easylabel
{top
frame e expand fillx
} \
360 $win.level.
label.mediumlabel
{top
frame e expand fillx
} \
361 $win.level.
label.hardlabel
{top
frame e expand fillx
}
363 pack append $win.level
\
364 $win.level.levellabel
{left
frame ne
} \
365 $win.level.radio
{left
frame ne
} \
366 $win.level.
label {left
frame ne expand fillx
}
370 -relief flat
-borderwidth 2
372 button $win.buttons.previous
\
373 -text {Previous Map
}\
374 -font [Font
$win Large
]\
375 -command "PrevHistory"\
378 LinkWindow
$win.previous
$win.buttons.previous
380 SetHelp
$win.buttons.previous Scenario.Previous
382 frame $win.buttons.voteframe
\
385 LinkWindow
$win.voteframe
$win.buttons.voteframe
387 SetHelp
$win.buttons.voteframe Scenario.Use
389 button $win.buttons.voteframe.vote
\
390 -font [Font
$win Large
]\
391 -text { Use This Map
}\
392 -command "DoVote $win UseThisMap UIUseThisMap {}"\
396 LinkWindow
$win.vote
$win.buttons.voteframe.vote
398 pack append $win.buttons.voteframe
\
399 $win.buttons.voteframe.vote
{top
frame center
}
401 BindVotingButton
$win $win.buttons.voteframe.vote UseThisMap
403 button $win.buttons.next
\
404 -font [Font
$win Large
]\
406 -command "NextHistory"\
408 LinkWindow
$win.next
$win.buttons.next
410 SetHelp
$win.buttons.next Scenario.Next
412 pack append $win.buttons
\
413 $win.buttons.previous
{left
frame nw
}\
414 $win.buttons.voteframe
{left
frame nw
}\
415 $win.buttons.next
{left
frame nw
}
418 $win.scen
{top
frame center fillx
}\
419 $win.buttons
{top
frame center fillx
}\
420 $win.name
{top
frame center fillx
}\
421 $win.level
{top
frame center fillx
}\
423 #place configure $win -x 0 -y 0 -width $ScenarioPanelWidth -height $ScenarioPanelHeight