
public static var sWidth:Number = 800;
public static var sHeight:Number = 600;
stage.addEventListener(Event.RESIZE, this.onStageResize);
public function onStageResize(_arg_1:Event):void
{
if (stage.scaleMode == StageScaleMode.NO_SCALE)
{
this.scaleX = (stage.stageWidth / 800);
this.scaleY = (stage.stageHeight / 600);
this.x = ((800 - stage.stageWidth) / 2);
this.y = ((600 - stage.stageHeight) / 2);
}
else
{
this.scaleX = 1;
this.scaleY = 1;
this.x = 0;
this.y = 0;
}
sWidth = stage.stageWidth;
sHeight = stage.stageHeight;
}
public function configureCamera(_arg_1:GameObject, _arg_2:Boolean):void
{
var _local_3:Rectangle = this.correctViewingArea(Parameters.data_.centerOnPlayer);
var _local_4:Number = Parameters.data_.cameraAngle;
this.configure(_arg_1.x_, _arg_1.y_, 12, _local_4, _local_3);
this.isHallucinating_ = _arg_2;
}
public function correctViewingArea(_arg_1:Boolean):Rectangle
{
var _local_2:Number;
var _local_3:Number;
var _local_4:Number;
var _local_5:Number;
_local_2 = Parameters.data_.mscale;
_local_3 = (WebMain.sWidth / _local_2);
_local_4 = (WebMain.sHeight / _local_2);
_local_5 = ((Parameters.data_.uiscale) ? Number((((200 * WebMain.sHeight) / 600) / _local_2)) : Number((200 / _local_2)));
if (_arg_1)
{
return (new Rectangle(-((_local_3 - _local_5) / 2), -((_local_4 * 13) / 24), _local_3, _local_4));
}
return (new Rectangle(-((_local_3 - _local_5) / 2), -((_local_4 * 3) / 4), _local_3, _local_4));
}
public function correctMapView(_arg_1:Camera):Point
{
var _local_2:Rectangle = _arg_1.clipRect_;
if (stage.scaleMode == StageScaleMode.NO_SCALE)
{
x = ((-(_local_2.x) * 800) / (WebMain.sWidth / Parameters.data_.mscale));
y = ((-(_local_2.y) * 600) / (WebMain.sHeight / Parameters.data_.mscale));
}
else
{
x = (-(_local_2.x) * Parameters.data_.mscale);
y = (-(_local_2.y) * Parameters.data_.mscale);
}
var _local_3:Number = ((-(_local_2.x) - (_local_2.width / 2)) / 50);
var _local_4:Number = ((-(_local_2.y) - (_local_2.height / 2)) / 50);
var _local_5:Number = Math.sqrt(((_local_3 * _local_3) + (_local_4 * _local_4)));
var _local_6:Number = ((_arg_1.angleRad_ - (Math.PI / 2)) - Math.atan2(_local_3, _local_4));
return (new Point((_arg_1.x_ + (_local_5 * Math.cos(_local_6))), (_arg_1.y_ + (_local_5 * Math.sin(_local_6)))));
}
override public function draw(_arg_1:Camera, _arg_2:int):void
{
var _local_3:Square;
var _local_4:GameObject;
var _local_5:BasicObject;
var _local_6:int;
var _local_12:uint;
var _local_13:Render3D;
var _local_14:int;
var _local_15:Array;
var _local_7:Number = NaN;
var _local_8:Number = NaN;
var _local_9:Number = NaN;
var _local_10:Number = NaN;
var _local_11:Number = NaN;
var _local_16:Number = NaN;
if (wasLastFrameGpu != Parameters.isGpuRender())
{
if ((((wasLastFrameGpu == true) && (!(WebMain.STAGE.stage3Ds[0].context3D == null))) && (!((!(WebMain.STAGE.stage3Ds[0].context3D == null)) && (!(WebMain.STAGE.stage3Ds[0].context3D.driverInfo.toLowerCase().indexOf("disposed") == -1))))))
{
WebMain.STAGE.stage3Ds[0].context3D.clear();
WebMain.STAGE.stage3Ds[0].context3D.present();
}
else
{
map_.graphics.clear();
}
signalRenderSwitch.dispatch(wasLastFrameGpu);
wasLastFrameGpu = Parameters.isGpuRender();
}
var _local_17:Rectangle = _arg_1.clipRect_;
x = -(_local_17.x);
y = -(_local_17.y);
var _local_18:Number = ((-(_local_17.y) - (_local_17.height / 2)) / 50);
var _local_19:Point = this.correctMapView(_arg_1);
this.visible_.length = 0;
this.visibleUnder_.length = 0;
this.visibleSquares_.length = 0;
this.topSquares_.length = 0;
var _local_20:int = _arg_1.maxDist_;
var _local_21:int = Math.max(0, (_local_19.x - _local_20));
var _local_22:int = Math.min((width_ - 1), (_local_19.x + _local_20));
var _local_23:int = Math.max(0, (_local_19.y - _local_20));
var _local_24:int = Math.min((height_ - 1), (_local_19.y + _local_20));
this.graphicsData_.length = 0;
this.graphicsDataStageSoftware_.length = 0;
this.graphicsData3d_.length = 0;
var _local_25:int = _local_21;
while (_local_25 <= _local_22)
{
_local_6 = _local_23;
while (_local_6 <= _local_24)
{
_local_3 = squares_[(_local_25 + (_local_6 * width_))];
if (_local_3 != null)
{
_local_7 = (_local_19.x - _local_3.center_.x);
_local_8 = (_local_19.y - _local_3.center_.y);
_local_9 = ((_local_7 * _local_7) + (_local_8 * _local_8));
if (_local_9 <= _arg_1.maxDistSq_)
{
_local_3.lastVisible_ = _arg_2;
_local_3.draw(this.graphicsData_, _arg_1, _arg_2);
this.visibleSquares_.push(_local_3);
if (_local_3.topFace_ != null)
{
this.topSquares_.push(_local_3);
}
}
}
_local_6++;
}
_local_25++;
}
for each (_local_4 in goDict_)
{
_local_4.drawn_ = false;
if (!_local_4.dead_)
{
_local_3 = _local_4.square_;
if (!((_local_3 == null) || (!(_local_3.lastVisible_ == _arg_2))))
{
_local_4.drawn_ = true;
_local_4.computeSortVal(_arg_1);
if (_local_4.props_.drawUnder_)
{
if (_local_4.props_.drawOnGround_)
{
_local_4.draw(this.graphicsData_, _arg_1, _arg_2);
}
else
{
this.visibleUnder_.push(_local_4);
}
}
else
{
this.visible_.push(_local_4);
}
}
}
}
for each (_local_5 in boDict_)
{
_local_5.drawn_ = false;
_local_3 = _local_5.square_;
if (!((_local_3 == null) || (!(_local_3.lastVisible_ == _arg_2))))
{
_local_5.drawn_ = true;
_local_5.computeSortVal(_arg_1);
this.visible_.push(_local_5);
}
}
if (this.visibleUnder_.length > 0)
{
this.visibleUnder_.sortOn(VISIBLE_SORT_FIELDS, VISIBLE_SORT_PARAMS);
for each (_local_5 in this.visibleUnder_)
{
_local_5.draw(this.graphicsData_, _arg_1, _arg_2);
}
}
this.visible_.sortOn(VISIBLE_SORT_FIELDS, VISIBLE_SORT_PARAMS);
if (Parameters.data_.drawShadows)
{
for each (_local_5 in this.visible_)
{
if (_local_5.hasShadow_)
{
_local_5.drawShadow(this.graphicsData_, _arg_1, _arg_2);
}
}
}
for each (_local_5 in this.visible_)
{
_local_5.draw(this.graphicsData_, _arg_1, _arg_2);
if (Parameters.isGpuRender())
{
_local_5.draw3d(this.graphicsData3d_);
}
}
if (this.topSquares_.length > 0)
{
for each (_local_3 in this.topSquares_)
{
_local_3.drawTop(this.graphicsData_, _arg_1, _arg_2);
}
}
if ((((!(player_ == null)) && (player_.breath_ >= 0)) && (player_.breath_ < Parameters.BREATH_THRESH)))
{
_local_10 = ((Parameters.BREATH_THRESH - player_.breath_) / Parameters.BREATH_THRESH);
_local_11 = (Math.abs(Math.sin((_arg_2 / 300))) * 0.75);
BREATH_CT.alphaMultiplier = (_local_10 * _local_11);
hurtOverlay_.transform.colorTransform = BREATH_CT;
hurtOverlay_.visible = true;
hurtOverlay_.x = _local_17.left;
hurtOverlay_.y = _local_17.top;
}
else
{
hurtOverlay_.visible = false;
}
if (((!(player_ == null)) && (!(Parameters.screenShotMode_))))
{
gradientOverlay_.x = (_local_17.right - 210);
gradientOverlay_.y = _local_17.top;
}
else
{
gradientOverlay_.visible = false;
}
if (((Parameters.isGpuRender()) && (Renderer.inGame)))
{
_local_12 = this.getFilterIndex();
_local_13 = StaticInjectorContext.getInjector().getInstance(Render3D);
_local_13.dispatch(this.graphicsData_, this.graphicsData3d_, width_, height_, _arg_1, _local_12);
_local_14 = 0;
while (_local_14 < this.graphicsData_.length)
{
if (((this.graphicsData_[_local_14] is GraphicsBitmapFill) && (GraphicsFillExtra.isSoftwareDraw(GraphicsBitmapFill(this.graphicsData_[_local_14])))))
{
this.graphicsDataStageSoftware_.push(this.graphicsData_[_local_14]);
this.graphicsDataStageSoftware_.push(this.graphicsData_[(_local_14 + 1)]);
this.graphicsDataStageSoftware_.push(this.graphicsData_[(_local_14 + 2)]);
}
else
{
if (((this.graphicsData_[_local_14] is GraphicsSolidFill) && (GraphicsFillExtra.isSoftwareDrawSolid(GraphicsSolidFill(this.graphicsData_[_local_14])))))
{
this.graphicsDataStageSoftware_.push(this.graphicsData_[_local_14]);
this.graphicsDataStageSoftware_.push(this.graphicsData_[(_local_14 + 1)]);
this.graphicsDataStageSoftware_.push(this.graphicsData_[(_local_14 + 2)]);
}
}
_local_14++;
}
if (this.graphicsDataStageSoftware_.length > 0)
{
map_.graphics.clear();
map_.graphics.drawGraphicsData(this.graphicsDataStageSoftware_);
if (this.lastSoftwareClear)
{
this.lastSoftwareClear = false;
}
}
else
{
if (!this.lastSoftwareClear)
{
map_.graphics.clear();
this.lastSoftwareClear = true;
}
}
if ((_arg_2 % 149) == 0)
{
GraphicsFillExtra.manageSize();
}
}
else
{
map_.graphics.clear();
map_.graphics.drawGraphicsData(this.graphicsData_);
}
map_.filters.length = 0;
if (((!(player_ == null)) && (!((player_.condition_[ConditionEffect.CE_FIRST_BATCH] & ConditionEffect.MAP_FILTER_BITMASK) == 0))))
{
_local_15 = [];
if (player_.isDrunk())
{
_local_16 = (20 + (10 * Math.sin((_arg_2 / 1000))));
_local_15.push(new BlurFilter(_local_16, _local_16));
}
if (player_.isBlind())
{
_local_15.push(BLIND_FILTER);
}
map_.filters = _local_15;
}
else
{
if (map_.filters.length > 0)
{
map_.filters = [];
}
}
mapOverlay_.draw(_arg_1, _arg_2);
partyOverlay_.draw(_arg_1, _arg_2);
if (((player_) && (player_.isDarkness())))
{
this.darkness.x = -300;
this.darkness.y = ((Parameters.data_.centerOnPlayer) ? Number(-525) : Number(-515));
this.darkness.alpha = 0.95;
addChild(this.darkness);
}
else
{
if (contains(this.darkness))
{
removeChild(this.darkness);
}
}
}
public function onScreenResize(_arg_1:Event):void
{
var _local_2:Boolean = Parameters.data_.uiscale;
var _local_3:Number = (800 / stage.stageWidth);
var _local_4:Number = (600 / stage.stageHeight);
var _local_5:Number = (_local_3 / _local_4);
var _local_6:int = 66;
if (this.map != null)
{
this.map.scaleX = (_local_3 * Parameters.data_.mscale);
this.map.scaleY = (_local_4 * Parameters.data_.mscale);
}
if (this.hudView != null)
{
if (_local_2)
{
this.hudView.scaleX = _local_5;
this.hudView.scaleY = 1;
this.hudView.y = 0;
}
else
{
this.hudView.scaleX = _local_3;
this.hudView.scaleY = _local_4;
this.hudView.y = (300 * (1 - _local_4));
}
this.hudView.x = (800 - (200 * this.hudView.scaleX));
if (this.creditDisplay_ != null)
{
this.creditDisplay_.x = (this.hudView.x - (6 * this.creditDisplay_.scaleX));
}
}
if (this.chatBox_ != null)
{
if (_local_2)
{
this.chatBox_.scaleX = _local_5;
this.chatBox_.scaleY = 1;
}
else
{
this.chatBox_.scaleX = _local_3;
this.chatBox_.scaleY = _local_4;
}
this.chatBox_.y = (300 + (300 * (1 - this.chatBox_.scaleY)));
}
if (this.rankText_ != null)
{
if (_local_2)
{
this.rankText_.scaleX = _local_5;
this.rankText_.scaleY = 1;
}
else
{
this.rankText_.scaleX = _local_3;
this.rankText_.scaleY = _local_4;
}
this.rankText_.x = (8 * this.rankText_.scaleX);
this.rankText_.y = (2 * this.rankText_.scaleY);
}
if (this.giftStatusDisplay != null)
{
if (_local_2)
{
this.giftStatusDisplay.scaleX = _local_5;
this.giftStatusDisplay.scaleY = 1;
}
else
{
this.giftStatusDisplay.scaleX = _local_3;
this.giftStatusDisplay.scaleY = _local_4;
}
this.giftStatusDisplay.x = (6 * this.giftStatusDisplay.scaleX);
this.giftStatusDisplay.y = (_local_6 * this.giftStatusDisplay.scaleY);
_local_6 = (_local_6 + DISPLAY_AREA_Y_SPACE);
}
if (this.newsModalButton != null)
{
if (_local_2)
{
this.newsModalButton.scaleX = _local_5;
this.newsModalButton.scaleY = 1;
}
else
{
this.newsModalButton.scaleX = _local_3;
this.newsModalButton.scaleY = _local_4;
}
this.newsModalButton.x = (6 * this.newsModalButton.scaleX);
this.newsModalButton.y = (_local_6 * this.newsModalButton.scaleY);
_local_6 = (_local_6 + DISPLAY_AREA_Y_SPACE);
}
if (this.guildText_ != null)
{
if (_local_2)
{
this.guildText_.scaleX = _local_5;
this.guildText_.scaleY = 1;
}
else
{
this.guildText_.scaleX = _local_3;
this.guildText_.scaleY = _local_4;
}
this.guildText_.x = (64 * this.guildText_.scaleX);
this.guildText_.y = (2 * this.guildText_.scaleY);
}
if (this.creditDisplay_ != null)
{
if (_local_2)
{
this.creditDisplay_.scaleX = _local_5;
this.creditDisplay_.scaleY = 1;
}
else
{
this.creditDisplay_.scaleX = _local_3;
this.creditDisplay_.scaleY = _local_4;
}
}
}
public function connect():void
{
if (!this.isGameStarted)
{
this.isGameStarted = true;
Renderer.inGame = true;
gsc_.connect();
lastUpdate_ = getTimer();
stage.addEventListener(MoneyChangedEvent.MONEY_CHANGED, this.onMoneyChanged);
stage.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.parent.parent.setChildIndex((this.parent.parent as Layers).top, 0);
if (Parameters.data_.mscale == undefined)
{
Parameters.data_.mscale = "1.0";
}
if (Parameters.data_.stageScale == undefined)
{
Parameters.data_.stageScale = StageScaleMode.NO_SCALE;
}
if (Parameters.data_.uiscale == undefined)
{
Parameters.data_.uiscale = true;
}
Parameters.save();
stage.scaleMode = Parameters.data_.stageScale;
stage.addEventListener(Event.RESIZE, this.onScreenResize);
stage.dispatchEvent(new Event(Event.RESIZE));
LoopedProcess.addProcess(new LoopedCallback(100, this.updateNearestInteractive));
}
}
public function disconnect():void
{
if (this.isGameStarted)
{
this.isGameStarted = false;
Renderer.inGame = false;
stage.removeEventListener(MoneyChangedEvent.MONEY_CHANGED, this.onMoneyChanged);
stage.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
stage.removeEventListener(Event.RESIZE, this.onScreenResize);
stage.scaleMode = StageScaleMode.EXACT_FIT;
stage.dispatchEvent(new Event(Event.RESIZE));
LoopedProcess.destroyAll();
((contains(map)) && (removeChild(map)));
map.dispose();
CachingColorTransformer.clear();
TextureRedrawer.clearCache();
Projectile.dispose();
gsc_.disconnect();
}
}
import kabam.rotmg.core.view.Layers; import flash.display.StageScaleMode
public static const DISPLAY_AREA_Y_SPACE = 32;
public function correctQuestNote(_arg_1:Rectangle):Rectangle
{
var _local_2:Rectangle = _arg_1.clone();
if (((stage.scaleMode == StageScaleMode.NO_SCALE) && (Parameters.data_.uiscale)))
{
this.scaleY = (this.scaleX = ((((stage.stageWidth < stage.stageHeight) ? stage.stageWidth : stage.stageHeight) / Parameters.data_.mscale) / 600));
}
else
{
this.scaleX = 1;
this.scaleY = 1;
}
_local_2.right = (_local_2.right - ((((800 - this.go_.map_.gs_.hudView.x) * stage.stageWidth) / Parameters.data_.mscale) / 800));
return (_local_2);
}
import flash.display.StageScaleMode; import com.company.assembleegameclient.parameters.Parameters;
_local_3 = this.correctQuestNote(_arg_2.clipRect_);
//kabam.rotmg.chat.control.ParseChatMessageCommand
package kabam.rotmg.chat.control{
import com.company.assembleegameclient.parameters.Parameters;
import flash.display.DisplayObject;
import flash.display.StageScaleMode;
import flash.events.Event;
import kabam.rotmg.chat.model.ChatMessage;
import kabam.rotmg.game.signals.AddTextLineSignal;
import kabam.rotmg.text.model.TextKey;
import kabam.rotmg.ui.model.HUDModel;
public class ParseChatMessageCommand {
[Inject]
public var data:String;
[Inject]
public var hudModel:HUDModel;
[Inject]
public var addTextLine:AddTextLineSignal;
public function execute():void{
var _local1:Array;
var _local2:Number;
var _local3:Number;
if (this.fsCommands(this.data))
{
return;
}
if (this.data.charAt(0) == "/"){
_local1 = this.data.substr(1, this.data.length).split(" ");
switch (_local1[0]){
case "help":
this.addTextLine.dispatch(ChatMessage.make(Parameters.HELP_CHAT_NAME, TextKey.HELP_COMMAND));
return;
};
};
this.hudModel.gameSprite.gsc_.playerText(this.data);
}
private function fsCommands(_arg_1:String):Boolean
{
_arg_1 = _arg_1.toLowerCase();
var _local_2:DisplayObject = Parameters.root;
if (_arg_1 == "/fs")
{
if (_local_2.stage.scaleMode == StageScaleMode.EXACT_FIT)
{
_local_2.stage.scaleMode = StageScaleMode.NO_SCALE;
Parameters.data_.stageScale = StageScaleMode.NO_SCALE;
this.addTextLine.dispatch(ChatMessage.make(Parameters.HELP_CHAT_NAME, "Fullscreen: On"));
}
else
{
_local_2.stage.scaleMode = StageScaleMode.EXACT_FIT;
Parameters.data_.stageScale = StageScaleMode.EXACT_FIT;
this.addTextLine.dispatch(ChatMessage.make(Parameters.HELP_CHAT_NAME, "Fullscreen: Off"));
}
Parameters.save();
_local_2.dispatchEvent(new Event(Event.RESIZE));
return (true);
}
if (_arg_1 == "/mscale")
{
this.addTextLine.dispatch(ChatMessage.make(Parameters.HELP_CHAT_NAME, (("Map Scale: " + Parameters.data_.mscale) + " - Usage: /mscale <any decimal number>.")));
return (true);
}
var _local_3:Array = _arg_1.match("^/mscale (\\d*\\.*\\d+)$");
if (_local_3 != null)
{
Parameters.data_.mscale = _local_3[1];
Parameters.save();
_local_2.dispatchEvent(new Event(Event.RESIZE));
this.addTextLine.dispatch(ChatMessage.make(Parameters.HELP_CHAT_NAME, ("Map Scale: " + _local_3[1])));
return (true);
}
if (_arg_1 == "/scaleui")
{
Parameters.data_.uiscale = (!(Parameters.data_.uiscale));
Parameters.save();
_local_2.dispatchEvent(new Event(Event.RESIZE));
this.addTextLine.dispatch(ChatMessage.make(Parameters.HELP_CHAT_NAME, ("Scale UI: " + Parameters.data_.uiscale)));
return (true);
}
return (false);
}
}
}//package kabam.rotmg.chat.control
var _local_4:* = undefined;
_local_4 = Number(_local_3[1]);
_local_4 = _local_4 > 0.5? _local_4: 0.5;
_local_4 = _local_4 < 5? _local_4: 5;
Parameters.data_["mscale"] = _local_4;
protected function position():void
{
var _local_1:Number;
var _local_2:Number;
var _local_3:Number = (800 / stage.stageWidth);
var _local_4:Number = (600 / stage.stageHeight);
if ((this.parent is Options))
{
_local_1 = ((((stage.mouseX + (stage.stageWidth / 2)) - 400) / stage.stageWidth) * 800);
_local_2 = ((((stage.mouseY + (stage.stageHeight / 2)) - 300) / stage.stageHeight) * 600);
}
else
{
_local_1 = (((stage.stageWidth - 800) / 2) + stage.mouseX);
_local_2 = (((stage.stageHeight - 600) / 2) + stage.mouseY);
if (((this.parent is TooltipsView) || ((this is PlayerGroupToolTip) && (!(this.parent is PlayerArrow)))))
{
if (Parameters.data_.uiscale)
{
this.parent.scaleX = (_local_3 / _local_4);
this.parent.scaleY = 1;
_local_1 = (_local_1 * _local_4);
_local_2 = (_local_2 * _local_4);
}
else
{
this.parent.scaleX = _local_3;
this.parent.scaleY = _local_4;
}
}
}
if (stage == null)
{
return;
}
if (((stage.mouseX + (0.5 * stage.stageWidth)) - 400) < (stage.stageWidth / 2))
{
x = (_local_1 + 12);
}
else
{
x = ((_local_1 - width) - 1);
}
if (x < 12)
{
x = 12;
}
if (((stage.mouseY + (0.5 * stage.stageHeight)) - 300) < (stage.stageHeight / 3))
{
y = (_local_2 + 12);
}
else
{
y = ((_local_2 - height) - 1);
}
if (y < 12)
{
y = 12;
}
}
private function onAddedToStage(_arg_1:Event):void
{
this.continueButton_.x = 400;
this.continueButton_.y = Y_POSITION;
this.resetToDefaultsButton_.x = 20;
this.resetToDefaultsButton_.y = Y_POSITION;
this.homeButton_.x = 780;
this.homeButton_.y = Y_POSITION;
this.setSelected(this.tabs_[0]);
stage.addEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown, false, 1);
stage.addEventListener(KeyboardEvent.KEY_UP, this.onKeyUp, false, 1);
}
None

