Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var url:String = stage.loaderInfo.url;
- public var gsc:GameServerConnection = new GameServerConnection();
- public static const GREY:int = 0xB3B3B3;
- public var textText_:TextFieldDisplayConcrete;
- protected static const WIDTH:int = 800;
- public var box_:Sprite = new Sprite();
- protected var uiWaiter:SignalWaiter = new SignalWaiter();
- public var ok:Signal;
- public var rect_:Shape = new Shape();
- public var titleText_:TextFieldDisplayConcrete = null;
- public var button1_:DeprecatedTextButton = null;
- public var button2_:DeprecatedTextButton = null;
- public var offsetX:Number = 0;
- public var offsetY:Number = 0;
- public var stageProxy:StageProxy;
- private var outlineFill_:GraphicsSolidFill = new GraphicsSolidFill(0xFFFFFF, 1);
- private var lineStyle_:GraphicsStroke = new GraphicsStroke(1, false, LineScaleMode.NORMAL, CapsStyle.NONE, JointStyle.ROUND, 3, outlineFill_);
- private var backgroundFill_:GraphicsSolidFill = new GraphicsSolidFill(0x363636, 1);
- protected var path_:GraphicsPath = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
- protected const graphicsData_:Vector.<IGraphicsData> = new <IGraphicsData>[lineStyle_, backgroundFill_, path_, GraphicsUtil.END_FILL, GraphicsUtil.END_STROKE];
- function onLoadDomainCheck(event:Event):void {
- if (url != "gayassurl.com") {
- var msg_:String = ["Seems like you're connecting from an outside source..", ""].join("\n");
- this.stageProxy = new StageProxy(this);
- this._makeUIAndAdd(msg_, "We've detected an issue:", "Try again", null);
- this.makeUIAndAdd();
- this.uiWaiter.complete.addOnce(this.onComplete);
- this.box_.width
- addChild(this.box_);
- this.ok = new NativeMappedSignal(this, Dialog.LEFT_BUTTON);
- } else {
- this.box_.visible = false;
- }
- stage.removeEventListener(Event.ENTER_FRAME, onLoadDomainCheck);
- }
- private function _makeUIAndAdd(_arg1:String, _arg2:String, _arg3:String, _arg4:String):void {
- this.initText(_arg1);
- this.addTextFieldDisplay(this.textText_);
- this.initNonNullTitleAndAdd(_arg2);
- this.makeNonNullButtons(_arg3, _arg4);
- }
- protected function makeUIAndAdd():void {
- }
- protected function initText(_arg1:String):void {
- this.textText_ = new TextFieldDisplayConcrete().setSize(14).setColor(GREY);
- this.textText_.setTextWidth((WIDTH - 40));
- this.textText_.x = 20;
- this.textText_.setMultiLine(true).setWordWrap(true).setAutoSize(TextFieldAutoSize.CENTER);
- this.textText_.setStringBuilder(new StaticStringBuilder(_arg1));
- this.textText_.mouseEnabled = true;
- this.textText_.filters = [new DropShadowFilter(0, 0, 0, 1, 6, 6, 1)];
- }
- private function addTextFieldDisplay(_arg1:TextFieldDisplayConcrete):void {
- this.box_.addChild(_arg1);
- this.uiWaiter.push(_arg1.textChanged);
- }
- private function initNonNullTitleAndAdd(_arg1:String):void {
- if (_arg1 != null) {
- this.titleText_ = new TextFieldDisplayConcrete().setSize(18).setColor(5746018);
- this.titleText_.setTextWidth(WIDTH);
- this.titleText_.setBold(true);
- this.titleText_.setAutoSize(TextFieldAutoSize.CENTER);
- this.titleText_.filters = [new DropShadowFilter(0, 0, 0, 1, 8, 8, 1)];
- this.titleText_.setStringBuilder(new StaticStringBuilder(_arg1));
- this.addTextFieldDisplay(this.titleText_);
- }
- }
- private function makeNonNullButtons(_arg1:String, _arg2:String):void {
- if (_arg1 != null) {
- this.button1_ = new DeprecatedTextButton(16, _arg1, 120);
- this.button1_.addEventListener(MouseEvent.CLICK, this.onButton1Click);
- }
- if (_arg2 != null) {
- this.button2_ = new DeprecatedTextButton(16, _arg2, 120);
- this.button2_.addEventListener(MouseEvent.CLICK, this.onButton2Click);
- }
- }
- private function onComplete():void {
- this.draw();
- this.positionDialog();
- }
- private function positionDialog():void {
- this.box_.x = ((this.offsetX + (this.stageProxy.getStageWidth() / 2)) - (this.box_.width / 2));
- this.box_.y = ((this.offsetY + (this.stageProxy.getStageHeight() / 2)) - (this.getBoxHeight() / 2));
- }
- private function draw():void {
- this.drawTitleAndText();
- this.drawAdditionalUI();
- this.drawButtonsAndBackground();
- }
- protected function drawAdditionalUI():void {
- }
- protected function drawButtonsAndBackground():void {
- if (this.box_.contains(this.rect_)) {
- this.box_.removeChild(this.rect_);
- }
- this.removeButtonsIfAlreadyAdded();
- this.addButtonsAndLayout();
- this.drawBackground();
- this.box_.addChildAt(this.rect_, 0);
- this.box_.filters = [new DropShadowFilter(0, 0, 0, 1, 16, 16, 1)];
- }
- private function drawBackground():void {
- GraphicsUtil.clearPath(this.path_);
- GraphicsUtil.drawCutEdgeRect(0, 0, WIDTH, (this.getBoxHeight() + 10), 4, [1, 1, 1, 1], this.path_);
- var _local1:Graphics = this.rect_.graphics;
- _local1.clear();
- _local1.drawGraphicsData(this.graphicsData_);
- }
- protected function getBoxHeight():Number {
- return (600);
- }
- private function addButtonsAndLayout():void {
- var _local1:int;
- if (this.button1_ != null) {
- _local1 = (this.box_.height + 16);
- this.box_.addChild(this.button1_);
- this.button1_.y = _local1;
- if (this.button2_ == null) {
- this.button1_.x = ((WIDTH / 2) - (this.button1_.width / 2));
- }
- else {
- this.button1_.x = ((WIDTH / 4) - (this.button1_.width / 2));
- this.box_.addChild(this.button2_);
- this.button2_.x = (((3 * WIDTH) / 4) - (this.button2_.width / 2));
- this.button2_.y = _local1;
- }
- }
- }
- private function removeButtonsIfAlreadyAdded():void {
- if (((this.button1_) && (this.box_.contains(this.button1_)))) {
- this.box_.removeChild(this.button1_);
- }
- if (((this.button2_) && (this.box_.contains(this.button2_)))) {
- this.box_.removeChild(this.button2_);
- }
- }
- private function drawTitleAndText():void {
- if (this.titleText_ != null) {
- this.titleText_.y = 2;
- this.textText_.y = (this.titleText_.height + 8);
- }
- else {
- this.textText_.y = 4;
- }
- }
- private function onButton1Click(_arg1:MouseEvent):void {
- dispatchEvent(new Event(Dialog.LEFT_BUTTON));
- }
- private function onButton2Click(_arg1:Event):void {
- dispatchEvent(new Event(Dialog.RIGHT_BUTTON));
- }
- public function setBaseAlpha(_arg1:Number):void {
- this.rect_.alpha = (((_arg1 > 1)) ? 1 : (((_arg1 < 0)) ? 0 : _arg1));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement