home *** CD-ROM | disk | FTP | other *** search
- package RES.WINDOWS
- {
- import ENGINE.INTERFACE.OButton;
- import ENGINE.INTERFACE.ODialog;
- import ENGINE.INTERFACE.OIObject;
- import ENGINE.INTERFACE.OInterface;
- import ENGINE.INTERFACE.OWindow;
- import ENGINE.SMARTFOX.OMultiplayer;
- import flash.events.Event;
- import flash.utils.getTimer;
-
- public class OWMenu extends ODialog
- {
-
-
- public var iGHighScores:OButton;
-
- public var iPlayOnline:OButton;
-
- public var iOptions:OButton;
-
- public var iBName:OButton;
-
- public var iGameName:OIObject;
-
- public var iTimer:int;
-
- public var iInstructions:OButton;
-
- public var iInfo:OIObject;
-
- public function OWMenu()
- {
- super(ClusterzL.OWMenu);
- }
-
- private function ShowUserReiting(param1:Boolean) : void
- {
- var _loc2_:String = null;
- var _loc3_:String = null;
- var _loc4_:Array = null;
- _loc2_ = String(ClusterzL.OWColors[Math.round(Math.random() * (ClusterzL.OWColors.length - 1))]);
- ClusterzL.OWMenuReiting[0][3] = _loc2_;
- if(param1)
- {
- ClusterzL.iMP.ClearOpponentTurn(true);
- ClusterzL.OWMenuReiting[0][4] = ClusterzL.iGAME.prPlayerName + ClusterzL.strReiting2 + ClusterzL.iGAME.prScore.toString();
- this.InitObject(ClusterzL.OWMenuReiting);
- }
- this.iTimer = getTimer();
- if(ClusterzL.iMP.State != OMultiplayer.stInZone)
- {
- return;
- }
- _loc3_ = ClusterzL.iMP.prOpponentTurn;
- ClusterzL.iMP.ClearOpponentTurn(true);
- ClusterzL.iMP.Turn(["rdr"]);
- if(!_loc3_)
- {
- return;
- }
- _loc4_ = _loc3_.split(/,/);
- ClusterzL.OWMenuReiting[0][4] = (int(_loc4_[0]) + 1).toString() + ClusterzL.strReiting1 + _loc4_[1] + ClusterzL.strReiting2 + _loc4_[2];
- this.InitObject(ClusterzL.OWMenuReiting);
- }
-
- override public function set prVisible(param1:Boolean) : void
- {
- super.prVisible = param1;
- }
-
- override public function Init() : void
- {
- ClusterzL.OWMenu[0][4] = ClusterzL.strWelcome + " " + ClusterzL.iGAME.prPlayerName;
- super.Init();
- }
-
- override public function set prActive(param1:Boolean) : void
- {
- super.prActive = param1;
- }
-
- override public function OnPress(param1:Event, param2:*) : void
- {
- if(param2 == this.iBName)
- {
- (this.parent as OWindow).OnPress(null,ClusterzL.miChoosePlayer);
- this.prVisible = false;
- return;
- }
- if(param2 == this.iPlayOnline)
- {
- (this.parent as OWindow).OnPress(null,ClusterzL.miPlayGame);
- this.prVisible = false;
- return;
- }
- if(param2 == this.iOptions)
- {
- (this.parent as OWindow).OnPress(null,ClusterzL.miOptions);
- this.prActive = false;
- return;
- }
- if(param2 == this.iInstructions)
- {
- (this.parent as OWindow).OnPress(null,ClusterzL.miInstructions);
- this.prActive = false;
- return;
- }
- if(param2 == this.iGHighScores)
- {
- (this.parent as OWindow).OnPress(null,ClusterzL.miGlobalScores);
- this.prActive = false;
- return;
- }
- (this.parent as OWindow).OnPress(null,ClusterzL.miCommingSoon);
- this.prActive = false;
- }
-
- override public function Free() : void
- {
- this.iBName = null;
- this.iGameName = null;
- this.iPlayOnline = null;
- this.iOptions = null;
- this.iInstructions = null;
- this.iGHighScores = null;
- this.InitObject(null);
- super.Free();
- }
-
- private function InitObject(param1:Array) : void
- {
- if(this.iInfo)
- {
- this.removeChild(this.iInfo);
- this.iInfo.Free();
- this.iInfo = null;
- }
- if(!param1)
- {
- return;
- }
- this.iInfo = new OIObject(param1,OInterface.iDefSlowAnimators);
- this.addChild(this.iInfo);
- this.iInfo.SetVisible(false);
- this.iInfo.prVisible = true;
- }
-
- override public function OnEnterFrame(param1:Event) : void
- {
- super.OnEnterFrame(param1);
- }
- }
- }
-