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

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