home *** CD-ROM | disk | FTP | other *** search
- package RES.WINDOWS
- {
- import ENGINE.INTERFACE.OButton;
- import ENGINE.INTERFACE.ODialog;
- import ENGINE.INTERFACE.OListBox;
- import flash.events.Event;
- import flash.system.Capabilities;
- import flash.system.fscommand;
-
- public class OWOptions extends ODialog
- {
-
-
- public var iSound:OListBox;
-
- private var iSRes:Array;
-
- public var iCancel:OButton;
-
- public var iMusic:OListBox;
-
- private var iSResList:Array;
-
- public var iAccept:OButton;
-
- public function OWOptions()
- {
- super(ClusterzL.OWOptions);
- }
-
- private function AddResolution(param1:int, param2:int) : void
- {
- if(param1 <= Capabilities.screenResolutionX && param2 <= Capabilities.screenResolutionY)
- {
- this.iSRes.push([param1,param2]);
- this.iSResList.push(param1.toString() + " X " + param2.toString());
- }
- }
-
- private function InitResolutions() : void
- {
- this.iSRes = new Array();
- this.iSResList = new Array();
- AddResolution(640,480);
- AddResolution(800,600);
- AddResolution(1024,600);
- AddResolution(1024,768);
- AddResolution(1280,768);
- AddResolution(1280,1024);
- AddResolution(Capabilities.screenResolutionX,Capabilities.screenResolutionY);
- }
-
- override public function Init() : void
- {
- super.Init();
- this.iSound.prCurrentInd = int(ClusterzL.iGAME.prSoundVolume * 10);
- this.iMusic.prCurrentInd = int(ClusterzL.iGAME.prMusicVolume * 10);
- this.InitResolutions();
- }
-
- override public function OnPress(param1:Event, param2:*) : void
- {
- if(param2 == this.iCancel)
- {
- this.prVisible = false;
- return;
- }
- if(param2 == this.iAccept)
- {
- this.prVisible = false;
- ClusterzL.iGAME.prSoundVolume = this.iSound.prCurrentInd / 10;
- ClusterzL.iGAME.prMusicVolume = this.iMusic.prCurrentInd / 10;
- ClusterzL.iGAME.prFullScreen = false;
- fscommand("fullscreen",ClusterzL.iGAME.prFullScreen.toString());
- return;
- }
- }
-
- override public function Free() : void
- {
- this.iSound = null;
- this.iMusic = null;
- this.iAccept = null;
- this.iCancel = null;
- this.iSRes = null;
- this.iSResList = null;
- super.Free();
- }
- }
- }
-