home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Esportes / CrossingCup.swf / scripts / __Packages / COptionsScreen.as < prev    next >
Encoding:
Text File  |  2007-12-11  |  3.0 KB  |  100 lines

  1. class COptionsScreen extends CScreen
  2. {
  3.    var slVolume;
  4.    var slMusic;
  5.    var slEffect;
  6.    var slGame;
  7.    var txGame;
  8.    var slGraphic;
  9.    function COptionsScreen()
  10.    {
  11.       super();
  12.    }
  13.    function setup()
  14.    {
  15.       if(_global.AppStarted == undefined)
  16.       {
  17.          return undefined;
  18.       }
  19.       this._visible = true;
  20.       this.slVolume.setVal(CSessionManager.ins().sndOverallVolume);
  21.       this.slMusic.setVal(CSessionManager.ins().sndMusicVolume);
  22.       this.slEffect.setVal(CSessionManager.ins().sndEffectsVolume);
  23.       var _loc3_ = Math.round(CSessionManager.ins().numPlayPerGame / 20 * 100);
  24.       this.slGame.setVal(_loc3_);
  25.       if(CTournament.ins().tournamentPhase > 1)
  26.       {
  27.          this.slGame._visible = false;
  28.       }
  29.       else
  30.       {
  31.          this.slGame._visible = true;
  32.       }
  33.       this.txGame.text = String(CSessionManager.ins().numPlayPerGame);
  34.       switch(this._quality)
  35.       {
  36.          case "LOW":
  37.             this.slGraphic.setVal(0);
  38.             break;
  39.          case "MEDIUM":
  40.             this.slGraphic.setVal(50);
  41.             break;
  42.          case "HIGH":
  43.             this.slGraphic.setVal(100);
  44.       }
  45.       EventCenter.access().addEventListener("sliderpress",this);
  46.       EventCenter.access().addEventListener("sliderrelease",this);
  47.       EventCenter.access().addEventListener("slidermove",this);
  48.    }
  49.    function sliderrelease(ob)
  50.    {
  51.       switch(ob.param._name)
  52.       {
  53.          case "slVolume":
  54.             CSessionManager.ins().sndOverallVolume = this.slVolume.getVal();
  55.             trace("changing volume baibe  to " + CSessionManager.ins().sndOverallVolume);
  56.             SoundManager.ins().setOverallVolume();
  57.             break;
  58.          case "slMusic":
  59.             CSessionManager.ins().sndMusicVolume = this.slMusic.getVal();
  60.             SoundManager.ins().setMusicVolume();
  61.             break;
  62.          case "slEffect":
  63.             CSessionManager.ins().sndEffectsVolume = this.slEffect.getVal();
  64.             SoundManager.ins().setEffectVolume();
  65.             break;
  66.          case "slGraphic":
  67.             var _loc2_ = this.slGraphic.getVal();
  68.             if(_loc2_ < 33)
  69.             {
  70.                this._quality = "LOW";
  71.                this.slGraphic.setVal(0);
  72.             }
  73.             else if(_loc2_ > 66)
  74.             {
  75.                this._quality = "HIGH";
  76.                this.slGraphic.setVal(100);
  77.             }
  78.             else
  79.             {
  80.                this._quality = "MEDIUM";
  81.                this.slGraphic.setVal(50);
  82.             }
  83.             break;
  84.          case "slGame":
  85.             if(CTournament.ins().tournamentPhase > 1)
  86.             {
  87.                return undefined;
  88.             }
  89.             _loc2_ = Math.round(this.slGame.getVal() / 100 * 19);
  90.             if(_loc2_ < 2)
  91.             {
  92.                _loc2_ = 2;
  93.             }
  94.             CSessionManager.ins().numPlayPerGame = _loc2_;
  95.             this.txGame.text = String(_loc2_);
  96.             break;
  97.       }
  98.    }
  99. }
  100.