]> git.zerfleddert.de Git - micropolis/blobdiff - res/micropolis.tcl
allow scenario window to be closed
[micropolis] / res / micropolis.tcl
index ff1ad9b0acd3a6501d4fb05d9f2f664a8dc80110..dc7d352e5123107f4c808ce54f2b265e99bac4d4 100644 (file)
@@ -412,8 +412,8 @@ sim ResetDynamic
 # the font in res (because it's already in the system fonts).  These lines
 # are for other systems that lack the font.
 set FontPath "[pwd]/res/dejavu-lgc"
 # the font in res (because it's already in the system fonts).  These lines
 # are for other systems that lack the font.
 set FontPath "[pwd]/res/dejavu-lgc"
-system "xset -fp $FontPath >&/dev/null"
-system "xset +fp $FontPath >&/dev/null"
+system "xset -fp $FontPath >/dev/null 2>&1"
+system "xset +fp $FontPath >/dev/null 2>&1"
 
 
 ########################################################################
 
 
 ########################################################################
@@ -484,7 +484,7 @@ Either clean up your act or open a gas mask concession at city hall.} \
 {{view {PanView $v [sim PolMaxX] [sim PolMaxY]}}}
 
 Message 11 #ff4f4f {CRIME ALERT!} \
 {{view {PanView $v [sim PolMaxX] [sim PolMaxY]}}}
 
 Message 11 #ff4f4f {CRIME ALERT!} \
-{Crime in your city is our of hand.  Angry mobs are looting and vandalizing the central city.  The president will send in the national guard soon if you cannot control the problem.} \
+{Crime in your city is out of hand.  Angry mobs are looting and vandalizing the central city.  The president will send in the national guard soon if you cannot control the problem.} \
 {{view {PanView $v [sim CrimeMaxX] [sim CrimeMaxY]}}}
 
 Message 12 #ff4f4f {TRAFFIC WARNING!} \
 {{view {PanView $v [sim CrimeMaxX] [sim CrimeMaxY]}}}
 
 Message 12 #ff4f4f {TRAFFIC WARNING!} \
@@ -940,9 +940,9 @@ proc EchoPlaySound {soundspec} {
   # Temporary workaround to tell Python Sugar app to play sound.
   global Sound
   if {$Sound} {
   # Temporary workaround to tell Python Sugar app to play sound.
   global Sound
   if {$Sound} {
-    echo PlaySound [lindex $soundspec 0]
+    #echo PlaySound [lindex $soundspec 0]
     signal ignore SIGCHLD
     signal ignore SIGCHLD
-    exec play res/sounds/[string tolower [lindex $soundspec 0]].wav &
+    exec res/sounds/player res/sounds/[string tolower [lindex $soundspec 0]].wav &
   }
 }
 
   }
 }
 
@@ -3101,8 +3101,10 @@ proc ShowSplashOf {head} {
 
 
 proc WithdrawSplashOf {head} {
 
 
 proc WithdrawSplashOf {head} {
-  set win WindowLink $head.splash]
-  wm withdraw $win
+  set win [WindowLink $head.splash]
+  if {$win != {}} {
+    wm withdraw $win
+  }
 }
 
 
 }
 
 
@@ -3152,8 +3154,10 @@ proc ShowScenarioOf {head} {
 
 
 proc WithdrawScenarioOf {head} {
 
 
 proc WithdrawScenarioOf {head} {
-  set win WindowLink $head.scenario]
-  wm withdraw $win
+  set win [WindowLink $head.scenario]
+  if {$win != {}} {
+    wm withdraw $win
+  }
 }
 
 
 }
 
 
@@ -3544,6 +3548,10 @@ proc DoPickScenario {win param} {
   UILoadScenario $param
 }
 
   UILoadScenario $param
 }
 
+proc DeleteScenarioWindow {win} {
+  UIQuit $win
+}
+
 
 ########################################################################
 # Undo/Redo Facility
 
 ########################################################################
 # Undo/Redo Facility
Impressum, Datenschutz