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

  1. source "../res/scripts/vision.tcl"
  2.    
  3. class itf'vision {
  4.     proc itf'vision {this} oz'widget {itf'quit} {
  5.         set base "interface/[MODE]/vision"
  6.  
  7.         set ($this,bg)       [new oz'sprite "$base/vision.bg"]
  8.         set ($this,vision1)  [new oz'button "$base/vision.01"]
  9.         set ($this,vision2)  [new oz'button "$base/vision.02"]
  10.         set ($this,vision3)  [new oz'button "$base/vision.03"]
  11.         set ($this,vision4)  [new oz'button "$base/vision.04"]
  12.         set ($this,vision5)  [new oz'button "$base/vision.05"]
  13.         set ($this,vision6)  [new oz'button "$base/vision.06"]
  14.  
  15.         oz'widget::bind $this enter itf'quit::enter $this
  16.         oz'widget::bind $this leave itf'quit::leave $this
  17.         
  18.         oz'widget::property $this -isize [oz'widget::width $($this,bg)] [oz'widget::height $($this,bg)]
  19.  
  20.         oz'button::property $($this,vision1)    -pos 0.093750 0.000000 -alpha 1 -click itf'vision::play 1
  21.         oz'button::property $($this,vision2)    -pos 0.312500 0.000000 -alpha 1 -click itf'vision::play 2
  22.         oz'button::property $($this,vision3)    -pos 0.093750 0.222656 -alpha 1 -click itf'vision::play 3
  23.         oz'button::property $($this,vision4)    -pos 0.312500 0.222656 -alpha 1 -click itf'vision::play 4
  24.         oz'button::property $($this,vision5)    -pos 0.093750 0.444010 -alpha 1 -click itf'vision::play 5
  25.         oz'button::property $($this,vision6)    -pos 0.312500 0.444010 -alpha 1 -click itf'vision::play 6
  26.  
  27.         oz'widget::child $this $($this,bg)      1
  28.         oz'widget::child $this $($this,vision1) 0
  29.         oz'widget::child $this $($this,vision2) 0
  30.         oz'widget::child $this $($this,vision3) 0
  31.         oz'widget::child $this $($this,vision4) 0
  32.         oz'widget::child $this $($this,vision5) 0
  33.         oz'widget::child $this $($this,vision6) 0
  34.     }
  35.  
  36.     proc ~itf'vision {this} {
  37.         delete $($this,bg)
  38.         delete $($this,vision1)
  39.         delete $($this,vision2)
  40.         delete $($this,vision3)
  41.         delete $($this,vision4)
  42.         delete $($this,vision5)
  43.         delete $($this,vision6)
  44.     }
  45.  
  46.     proc play {n} {
  47.         CloseAllInterface
  48.         CloseAllSounds
  49.         oz'event {
  50.              freezePlayer
  51.              wizDisableMouse
  52.              oz'delay 0.5
  53.         }
  54.         oz'event {
  55.             standardFadeout
  56.         }
  57.         oz'event {
  58.             hideInterface
  59.             hideMouse
  60.             wizEntityHide Lydia
  61.             wizEntityHide Zak
  62.         }
  63.       
  64.         ::qPlayVision$n
  65.  
  66.         oz'event {
  67.             setScene [ozGet "sysScene"] [ozGet "sysWorld"]
  68.             oz'delay 0.001
  69.         }
  70.  
  71.         oz'event {
  72.             showInterface
  73.             showMouse
  74.             wizEntityShow Lydia
  75.             wizEntityShow Zak
  76.             standardFadein
  77.         }
  78.         oz'event {
  79.              unfreezePlayer
  80.              wizEnableMouse
  81.         }
  82.     }
  83.     
  84.     proc show {this} {
  85.         oz'widget::fadeto $this 1
  86.         
  87.         if {[ozGet "visionOne"] == "viewed"} {
  88.             oz'button::enable $($this,vision1)
  89.         } else {
  90.             oz'button::disable $($this,vision1)
  91.         }
  92.         
  93.         if {[ozGet "visionTwo"] == "viewed"} {
  94.             oz'button::enable $($this,vision2)
  95.         } else {
  96.             oz'button::disable $($this,vision2)
  97.         }
  98.         
  99.         if {[ozGet "visionThree"] == "viewed"} {
  100.             oz'button::enable $($this,vision3)
  101.         } else {
  102.             oz'button::disable $($this,vision3)
  103.         }
  104.         
  105.         if {[ozGet "visionFour"] == "viewed"} {
  106.             oz'button::enable $($this,vision4)
  107.         } else {
  108.             oz'button::disable $($this,vision4)
  109.         }
  110.         
  111.         if {[ozGet "visionFive"] == "viewed"} {
  112.             oz'button::enable $($this,vision5)
  113.         } else {
  114.             oz'button::disable $($this,vision5)
  115.         }
  116.         
  117.         if {[ozGet "visionSix"] == "viewed"} {
  118.             oz'button::enable $($this,vision6)
  119.         } else {
  120.             oz'button::disable $($this,vision6)
  121.         }
  122.     }
  123.  
  124.     proc hide {this} {
  125.         oz'widget::fadeto $this 0
  126.     }
  127.  
  128.     proc enter {this} {
  129.         oz'mouse::cursor +100
  130.     }
  131.  
  132.     proc leave {this} {
  133.         oz'mouse::cursor -100
  134.     }
  135. }
  136.  
  137.