home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2006 April / SGP.iso / dema / Keepsake-Demo-en-li-v1.0.exe / res / interface / common / itf.quit.tcl < prev    next >
Text File  |  2005-11-01  |  4KB  |  136 lines

  1. class itf'quit {
  2.     proc itf'quit {this} oz'widget {itf'quit} {
  3.         set base "interface/[MODE]/quit"
  4.  
  5.         set ($this,bg)               [new oz'sprite "$base/quit.bg"]
  6.         set ($this,save.label)       [new oz'label  "save" 0.480460 0.057291]
  7.         set ($this,save.butt)        [new oz'button "$base/quit.save"]
  8.         set ($this,quit.label)       [new oz'label  "quit" 0.480460 0.057291]
  9.         set ($this,quit.butt)        [new oz'button "$base/quit.quit"]
  10.         set ($this,quitsave.label)   [new oz'label  "quitsave" 0.480460 0.057291]
  11.         set ($this,quitsave.butt)    [new oz'button "$base/quit.quitsave"]
  12.  
  13.         oz'widget::bind $this enter itf'quit::enter $this
  14.         oz'widget::bind $this leave itf'quit::leave $this
  15.         
  16.         oz'widget::property $this -isize [oz'widget::width $($this,bg)] [oz'widget::height $($this,bg)]
  17.  
  18.         oz'label::property  $($this,save.label) -pos 0.095703 0.029948 -alpha 1 -font caligula.ttf -fsize 24 \
  19.                                                   -color 1 1 1 -text $::lng::q_save
  20.         oz'button::property $($this,save.butt)  -pos 0.061523 0.029948 -alpha 1 -click itf'quit::save $this
  21.         oz'label::property  $($this,quit.label)   -pos 0.095703 0.093750 -alpha 1 -font caligula.ttf  -fsize 24 \
  22.                                                   -color 1 1 1 -text $::lng::q_quit
  23.         oz'button::property $($this,quit.butt)    -pos 0.061523 0.093750 -alpha 1 -click itf'quit::quit $this
  24.  
  25.         oz'label::property  $($this,quitsave.label)   -pos 0.095703 0.157552 -alpha 1 -font caligula.ttf  -fsize 24 \
  26.                                                   -color 1 1 1 -text $::lng::q_savequit
  27.         oz'button::property $($this,quitsave.butt)    -pos 0.061523 0.157552 -alpha 1 -click itf'quit::quitsave $this
  28.         
  29.         oz'widget::child $this $($this,bg)           1
  30.         oz'widget::child $this $($this,save.label) 0
  31.         oz'widget::child $this $($this,save.butt)  0
  32.         oz'widget::child $this $($this,quit.label)   0
  33.         oz'widget::child $this $($this,quit.butt)    0
  34.         oz'widget::child $this $($this,quitsave.label)   0
  35.         oz'widget::child $this $($this,quitsave.butt)    0
  36.     }
  37.  
  38.     proc ~itf'quit {this} {
  39.         delete $($this,bg)
  40.         delete $($this,save.label)
  41.         delete $($this,save.butt)
  42.         delete $($this,quit.label)
  43.         delete $($this,quit.butt)
  44.         delete $($this,quitsave.label)
  45.         delete $($this,quitsave.butt)
  46.     }
  47.  
  48.     proc save {this} {
  49.         set config "set soundfx_volume $::config::user::soundfx_volume\nset voice_volume $::config::user::voice_volume\nset music_volume $::config::user::music_volume\nset gamma_correction $::config::user::gamma_correction"
  50.  
  51.         set fid [open "../res/user.tcl" "w"]
  52.         puts $fid $config
  53.         close $fid
  54.         
  55.         oz'event {
  56.             wizDisableMouse
  57.             CloseAllInterface
  58.         }
  59.         oz'event {
  60.             oz'delay 0.5
  61.         }
  62.         oz'event {
  63.             oz'delay 0.001
  64.         }
  65.         oz'event {
  66.             saveGame
  67.         }
  68.         oz'event {
  69.             wizEnableMouse
  70.         }
  71.     }
  72.     
  73.     proc quit {this} {
  74.         oz'event {
  75.             wizDisableMouse
  76.             CloseAllInterface
  77.         }
  78.         oz'event {
  79.             oz'delay 0.5
  80.         }
  81.         oz'event {
  82.             hideInterface
  83.             hideMouse
  84.         }
  85.         oz'event {
  86.             oz'delay 0.001
  87.         }
  88.         oz'event {
  89.             closeGameNoSave
  90.         }
  91.     }
  92.     
  93.     proc quitsave {this} {
  94.         set config "set soundfx_volume $::config::user::soundfx_volume\nset voice_volume $::config::user::voice_volume\nset music_volume $::config::user::music_volume\nset gamma_correction $::config::user::gamma_correction"
  95.  
  96.         set fid [open "../res/user.tcl" "w"]
  97.         puts $fid $config
  98.         close $fid
  99.         
  100.         oz'event {
  101.             wizDisableMouse
  102.             CloseAllInterface
  103.         }
  104.         oz'event {
  105.             oz'delay 0.5
  106.         }
  107.         oz'event {
  108.             hideInterface
  109.             hideMouse
  110.         }
  111.         oz'event {
  112.             oz'delay 0.001
  113.         }
  114.         oz'event {
  115.             closeGame
  116.         }
  117.     }
  118.  
  119.     proc enter {this} {
  120.         oz'mouse::cursor +100
  121.     }
  122.  
  123.     proc leave {this} {
  124.         oz'mouse::cursor -100
  125.     }
  126. }
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.