]> git.zerfleddert.de Git - micropolis/blob - res/weval.tcl
src/tclx/ucbsrc/tclexpr.sed: Micropolis build fixes for recent macOS
[micropolis] / res / weval.tcl
1 # Window: Player evaluation, for Unix Micropolis.
2 #
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.
8 #
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.
13 #
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/>.
20 #
21 # ADDITIONAL TERMS per GNU GPL Section 7
22 #
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.
28 #
29 # Any propagation or conveyance of this program must include this
30 # copyright notice and these terms.
31 #
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.
36 #
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.
40 #
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
60 # NOT APPLY TO YOU.
61 global EvaluationWindows
62 set n [Unique]
63 set parent [WindowLink $head.col2]
64 set win $parent.evaluation$n
65 set EvaluationWindows [linsert $EvaluationWindows 0 $win]
66
67 LinkWindow $head.evaluation $win
68 LinkWindow $win.head $head
69 LinkWindow $win.parent $parent
70 LinkWindow $win.top $win
71
72 catch "destroy $win"
73 frame $win
74
75 SetHelp $win Evaluation
76
77 global [set var $win.visible]
78 set $var 0
79
80 bind $win <Visibility> {EvaluationVisible %W [string compare %s FullyObscured]}
81 bind $win <Map> {EvaluationVisible %W 1}
82 bind $win <Unmap> {EvaluationVisible %W 0}
83
84 #wm title $win {Micropolis Evaluation}
85 #wm iconname $win {Micropolis Evaluation}
86 #wm group $win $head
87 #wm geometry $win 480x240+5-5
88 #wm withdraw $win
89 #wm maxsize $win 700 700
90 #wm minsize $win 400 200
91 #wm protocol $win delete "DeleteWindow evaluation EvaluationWindows"
92
93
94 frame $win.leftframe\
95 -borderwidth 1\
96 -relief raised
97
98 SetHelp $win.leftframe Evaluation.Opinion
99
100 label $win.leftframe.title\
101 -font [Font $win Big]\
102 -padx 0\
103 -relief flat\
104 -text {Public Opinion}\
105 -width 5
106
107 label $win.leftframe.isthe\
108 -font [Font $win Large]\
109 -text {Is the mayor doing a good job?}
110
111 SetHelp $win.leftframe.isthe Evaluation.GoodJob
112
113 frame $win.leftframe.goodjobframe\
114 -borderwidth 1
115
116 SetHelp $win.leftframe.goodjobframe Evaluation.GoodJob
117
118 message $win.leftframe.goodjobframe.yesno\
119 -aspect 1500\
120 -justify right\
121 -padx 5\
122 -pady 2\
123 -font [Font $win Medium]\
124 -text {YES
125 NO}
126
127 message $win.leftframe.goodjobframe.percents\
128 -aspect 1500\
129 -justify left\
130 -padx 5\
131 -pady 2\
132 -font [Font $win Medium]\
133 -text {100%
134 0%}
135 LinkWindow $win.goodjob $win.leftframe.goodjobframe.percents
136
137 pack append $win.leftframe.goodjobframe\
138 $win.leftframe.goodjobframe.percents {right frame w expand} \
139 $win.leftframe.goodjobframe.yesno {right frame e expand}
140
141 label $win.leftframe.whatare\
142 -font [Font $win Large]\
143 -text {What are the worst problems?}
144
145 SetHelp $win.leftframe.whatare Evaluation.WorstProblems
146
147 frame $win.leftframe.worstproblems\
148 -borderwidth 1
149
150 SetHelp $win.leftframe.worstproblems Evaluation.WorstProblems
151
152 message $win.leftframe.worstproblems.problemnames\
153 -aspect 1500\
154 -justify right\
155 -padx 5\
156 -pady 2\
157 -font [Font $win Medium]\
158 -text {
159
160
161
162 }
163 LinkWindow $win.problemnames $win.leftframe.worstproblems.problemnames
164
165 message $win.leftframe.worstproblems.problempercents\
166 -aspect 1500\
167 -justify left\
168 -padx 5\
169 -pady 2\
170 -font [Font $win Medium]\
171 -text {
172
173
174
175 }
176 LinkWindow $win.problempercents $win.leftframe.worstproblems.problempercents
177
178 pack append $win.leftframe.worstproblems\
179 $win.leftframe.worstproblems.problempercents {right frame w expand} \
180 $win.leftframe.worstproblems.problemnames {right frame e expand}
181
182 pack append $win.leftframe\
183 $win.leftframe.title {top frame center fillx expand} \
184 $win.leftframe.isthe {top frame center fillx expand} \
185 $win.leftframe.goodjobframe {top frame center fillx expand} \
186 $win.leftframe.whatare {top frame center fillx expand} \
187 $win.leftframe.worstproblems {top frame center fillx expand}
188
189 frame $win.rightframe\
190 -borderwidth 1\
191 -relief raised
192
193 SetHelp $win.rightframe Evaluation.Statistics
194
195 label $win.rightframe.title\
196 -font [Font $win Big]\
197 -padx 0\
198 -relief flat\
199 -text {Statistics}\
200 -width 5
201
202 frame $win.rightframe.statsframe\
203 -borderwidth 1
204
205 message $win.rightframe.statsframe.statlabels\
206 -aspect 1500\
207 -justify right\
208 -padx 5\
209 -pady 2\
210 -font [Font $win Medium]\
211 -text {Population:
212 Net Migration:
213 (last year)
214 Assessed Value:
215 Category:
216 Game Level:}
217
218 message $win.rightframe.statsframe.stats\
219 -aspect 1500\
220 -justify left\
221 -padx 5\
222 -pady 2\
223 -font [Font $win Medium]\
224 -text {
225
226
227
228
229 }
230 LinkWindow $win.stats $win.rightframe.statsframe.stats
231
232 pack append $win.rightframe.statsframe\
233 $win.rightframe.statsframe.statlabels {left frame e expand} \
234 $win.rightframe.statsframe.stats {right frame w expand}
235
236 message $win.rightframe.cityscore\
237 -aspect 1500\
238 -justify center\
239 -padx 5\
240 -pady 2\
241 -font [Font $win Medium]\
242 -text {Overall City Score
243 (0 - 1000)}
244
245 SetHelp $win.rightframe.cityscore Evaluation.Score
246
247 frame $win.rightframe.scoreframe\
248 -borderwidth 1
249
250 SetHelp $win.rightframe.scoreframe Evaluation.Score
251
252 message $win.rightframe.scoreframe.scorelabels\
253 -aspect 1500\
254 -justify right\
255 -padx 5\
256 -pady 2\
257 -font [Font $win Medium]\
258 -text {Current Score:
259 Annual Change:}
260
261 message $win.rightframe.scoreframe.scores\
262 -aspect 1500\
263 -justify left\
264 -padx 5\
265 -pady 2\
266 -font [Font $win Medium]\
267 -text {
268
269 }
270 LinkWindow $win.score $win.rightframe.scoreframe.scores
271
272 pack append $win.rightframe.scoreframe\
273 $win.rightframe.scoreframe.scorelabels {left frame e expand} \
274 $win.rightframe.scoreframe.scores {right frame w expand}
275
276 pack append $win.rightframe\
277 $win.rightframe.title {top frame center fillx expand} \
278 $win.rightframe.statsframe {top frame center fillx expand} \
279 $win.rightframe.cityscore {top frame center fillx expand} \
280 $win.rightframe.scoreframe {top frame center fillx expand}
281
282 frame $win.bottomframe\
283 -borderwidth 0
284
285 SetHelp $win.bottomframe Evaluation.Dismiss
286
287 button $win.bottomframe.button\
288 -font [Font $win Large]\
289 -text {Dismiss Evaluation}\
290 -command "pack unpack $win"
291
292 pack append $win.bottomframe\
293 $win.bottomframe.button {top frame center expand fillx}
294
295 pack append $win\
296 $win.bottomframe {bottom frame center fillx}\
297 $win.leftframe {left frame center expand fill} \
298 $win.rightframe {right frame center expand fill}
299
300 sim UpdateEvaluation
301
302 update idletasks
Impressum, Datenschutz