home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CyberMycha 2006 April
/
SGP.iso
/
dema
/
Keepsake-Demo-en-li-v1.0.exe
/
res
/
interface
/
common
/
itf.option.tcl
< prev
next >
Wrap
Text File
|
2005-11-01
|
6KB
|
161 lines
proc update_var2 {} {
set master_volume [expr double([itf'slider2::get_pos $itfoption::($itf::option,music)]) / 10.0]
set ::config::user::gamma_correction [expr double([itf'slider2::get_pos $itfoption::($itf::option,gamma)]) / 10.0]
if {$master_volume == 0} {
set master_volume 0.01
}
set ::config::voice::volume [expr $::ref_voice_volume * $master_volume]
set ::config::soundfx::volume [expr $::ref_soundfx_volume * $master_volume]
set ::config::music::volume [expr $::ref_music_volume * $master_volume]
set ::config::ambient2d::volume [expr $::ref_ambient2d_volume * $master_volume]
masterVolume2 $master_volume
updateGamma
updateVolume
}
class itf'slider2 {
proc itf'slider2 {this} oz'widget {itf'slider2} {
set ($this,more) [new oz'button "interface/[MODE]/slider/slider.more"]
set ($this,less) [new oz'button "interface/[MODE]/slider/slider.less"]
set ($this,bar0) [new oz'sprite "interface/[MODE]/slider/slider.bar0"]
set ($this,bar1) [new oz'sprite "interface/[MODE]/slider/slider.bar1"]
set ($this,bar2) [new oz'sprite "interface/[MODE]/slider/slider.bar2"]
set ($this,bar3) [new oz'sprite "interface/[MODE]/slider/slider.bar3"]
set ($this,bar4) [new oz'sprite "interface/[MODE]/slider/slider.bar4"]
set ($this,bar5) [new oz'sprite "interface/[MODE]/slider/slider.bar5"]
set ($this,bar6) [new oz'sprite "interface/[MODE]/slider/slider.bar6"]
set ($this,bar7) [new oz'sprite "interface/[MODE]/slider/slider.bar7"]
set ($this,bar8) [new oz'sprite "interface/[MODE]/slider/slider.bar8"]
set ($this,bar9) [new oz'sprite "interface/[MODE]/slider/slider.bar9"]
oz'widget::property $($this,less) -pos 0.005859 0.010417
oz'widget::property $($this,more) -pos 0.213867 0.010417
oz'button::property $($this,less) -click itf'slider2::less $this
oz'button::property $($this,more) -click itf'slider2::more $this
oz'widget::property $($this,bar0) -pos 0.050781 0.010417 -alpha 0
oz'widget::property $($this,bar1) -pos 0.066406 0.010417 -alpha 0
oz'widget::property $($this,bar2) -pos 0.082031 0.010417 -alpha 0
oz'widget::property $($this,bar3) -pos 0.097656 0.010417 -alpha 0
oz'widget::property $($this,bar4) -pos 0.113281 0.010417 -alpha 0
oz'widget::property $($this,bar5) -pos 0.128906 0.010417 -alpha 0
oz'widget::property $($this,bar6) -pos 0.144531 0.010417 -alpha 0
oz'widget::property $($this,bar7) -pos 0.160156 0.010417 -alpha 0
oz'widget::property $($this,bar8) -pos 0.175781 0.010417 -alpha 0
oz'widget::property $($this,bar9) -pos 0.191406 0.010417 -alpha 0
set ($this,pos) 0
oz'widget::child $this $($this,less) 0
oz'widget::child $this $($this,more) 0
oz'widget::child $this $($this,bar0) 0
oz'widget::child $this $($this,bar1) 0
oz'widget::child $this $($this,bar2) 0
oz'widget::child $this $($this,bar3) 0
oz'widget::child $this $($this,bar4) 0
oz'widget::child $this $($this,bar5) 0
oz'widget::child $this $($this,bar6) 0
oz'widget::child $this $($this,bar7) 0
oz'widget::child $this $($this,bar8) 0
oz'widget::child $this $($this,bar9) 0
}
proc ~itf'slider2 {this} {
delete $($this,more)
delete $($this,less)
delete $($this,bar0)
delete $($this,bar1)
delete $($this,bar2)
delete $($this,bar3)
delete $($this,bar4)
delete $($this,bar5)
delete $($this,bar6)
delete $($this,bar7)
delete $($this,bar8)
delete $($this,bar9)
}
proc get_pos {this} {
return $($this,pos)
}
proc set_pos {this p} {
set ($this,pos) $p
for {set i 0} {$i < $p} {incr i} {
oz'widget::alpha $($this,bar$i) 1
}
for {set i $p} {$i < 10} {incr i} {
oz'widget::alpha $($this,bar$i) 0
}
}
proc less {this} {
oz'flush
if {$($this,pos) <= 0} return
incr ($this,pos) -1
oz'widget::fadeto $($this,bar$($this,pos)) 0
update_var2
oz'flush
}
proc more {this} {
oz'flush
if {$($this,pos) >= 10} return
oz'widget::fadeto $($this,bar$($this,pos)) 1
incr ($this,pos) 1
update_var2
oz'flush
}
}
class itfoption {
proc itfoption {this} oz'widget {itf'option} {
set base "interface/[MODE]/option"
set ($this,bg) [new oz'sprite "$base/option.bg"]
set ($this,music) [new itf'slider2]
set ($this,gamma) [new itf'slider2]
oz'widget::property $this -isize [oz'widget::width $($this,bg)] [oz'widget::height $($this,bg)]
oz'widget::property $($this,music) -pos 0.079102 [expr 0.054688 - 0.005]
oz'widget::property $($this,gamma) -pos 0.079102 [expr 0.169271 - 0.005]
oz'widget::child $this $($this,bg) 1
oz'widget::child $this $($this,music) 0
oz'widget::child $this $($this,gamma) 0
itf'slider2::set_pos $($this,music) 10
itf'slider2::set_pos $($this,gamma) [expr int($::config::user::gamma_correction * 10)]
}
proc ~itfoption {this} {
delete $($this,bg)
}
}