]> git.zerfleddert.de Git - micropolis/blobdiff - res/micropolis.tcl
Add "Pause" to Priority menu
[micropolis] / res / micropolis.tcl
index b1379c1212f74aaf2675d3530011a3b703cfd8e7..773ceb3024ee1b14a95430295abea95f6b21f5d2 100644 (file)
@@ -97,6 +97,7 @@ set DemandCom 0
 set DemandInd 0
 set Priority 2
 set Time 3
+set Pause 0
 set AutoGoto 1
 set AutoBudget 1
 set Disasters 1
@@ -412,8 +413,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"
-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 +485,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!} \
-{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!} \
@@ -940,7 +941,9 @@ proc EchoPlaySound {soundspec} {
   # 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
+    exec res/sounds/player res/sounds/[string tolower [lindex $soundspec 0]].wav &
   }
 }
 
@@ -3099,8 +3102,10 @@ proc ShowSplashOf {head} {
 
 
 proc WithdrawSplashOf {head} {
-  set win WindowLink $head.splash]
-  wm withdraw $win
+  set win [WindowLink $head.splash]
+  if {$win != {}} {
+    wm withdraw $win
+  }
 }
 
 
@@ -3150,8 +3155,10 @@ proc ShowScenarioOf {head} {
 
 
 proc WithdrawScenarioOf {head} {
-  set win WindowLink $head.scenario]
-  wm withdraw $win
+  set win [WindowLink $head.scenario]
+  if {$win != {}} {
+    wm withdraw $win
+  }
 }
 
 
@@ -3542,6 +3549,10 @@ proc DoPickScenario {win param} {
   UILoadScenario $param
 }
 
+proc DeleteScenarioWindow {win} {
+  UIQuit $win
+}
+
 
 ########################################################################
 # Undo/Redo Facility
@@ -4907,12 +4918,14 @@ proc oops {} {
 
 
 proc TogglePause {} {
-  global State
+  global State Pause
 
   if {"$State" != "play" || [sim Speed]} {
     sim Speed 0
+    set Pause 1
   } else {
     sim Speed 3
+    set Pause 0
   }
   MakeRunningSound
 }
Impressum, Datenschutz