home *** CD-ROM | disk | FTP | other *** search
- package RES.WINDOWS
- {
- import ENGINE.INTERFACE.OButton;
- import ENGINE.INTERFACE.ODialog;
- import ENGINE.INTERFACE.OListBox;
- import ENGINE.INTERFACE.OWindow;
- import flash.events.Event;
-
- public class OWChoosePlayer extends ODialog
- {
-
-
- public var iCancel:OButton;
-
- public var iDelete:OButton;
-
- public var iNew:OButton;
-
- public var iListBox:OListBox;
-
- public var iAccept:OButton;
-
- private var iData:*;
-
- private var iCurPlayer:String;
-
- public function OWChoosePlayer()
- {
- super(ClusterzL.OWChoosePlayer);
- }
-
- override public function Init() : void
- {
- super.Init();
- this.iData = ClusterzL.iGAME.prPlayersData;
- this.iCurPlayer = ClusterzL.iGAME.prPlayerName;
- this.iListBox.SetCurrentElement(ClusterzL.iGAME.prPlayerName,ClusterzL.iGAME.prPlayerNames);
- }
-
- override public function set prActive(param1:Boolean) : void
- {
- if(param1)
- {
- this.iListBox.SetCurrentElement(ClusterzL.iGAME.prPlayerName,ClusterzL.iGAME.prPlayerNames);
- }
- super.prActive = param1;
- }
-
- override public function OnPress(param1:Event, param2:*) : void
- {
- if(!this.prMouseEnabled)
- {
- return;
- }
- if(param2 == this.iNew)
- {
- (this.parent as OWindow).OnPress(null,ClusterzL.miEnterNewName);
- this.prActive = false;
- return;
- }
- if(param2 == this.iDelete)
- {
- (this.parent as OWindow).OnPress(null,ClusterzL.miDeletePlayerConfirm);
- this.prActive = false;
- return;
- }
- if(param2 == this.iCancel)
- {
- ClusterzL.iGAME.prPlayersData = this.iData;
- ClusterzL.iGAME.prPlayerName = this.iCurPlayer;
- (this.parent as OWindow).OnPress(null,ClusterzL.miMenu);
- this.prVisible = false;
- return;
- }
- if(param2 == this.iAccept)
- {
- if(ClusterzL.iMP.isConnected)
- {
- ClusterzL.iMP.disconnect();
- }
- (this.parent as OWindow).OnPress(null,ClusterzL.miMenu);
- this.prVisible = false;
- return;
- }
- if(param2 == this.iListBox && ClusterzL.iGAME.prPlayerName != this.iListBox.prCurrentLBParam)
- {
- ClusterzL.iGAME.prPlayerName = this.iListBox.prCurrentLBParam;
- return;
- }
- }
-
- override public function Free() : void
- {
- this.iListBox = null;
- this.iNew = null;
- this.iDelete = null;
- this.iAccept = null;
- this.iCancel = null;
- super.Free();
- }
- }
- }
-