[TUTORIAL] Fullscreen Mod v2 for the AS3 Client

Posts 1–8 of 8 · Page 1 of 1
[TUTORIAL] Fullscreen Mod v2 for the AS3 Client
Ever wanted to give your players the option of going fullscreen? Well now you can.

This is nilly's Fullscreen Hack v2 painstakingly converted into an AS3 modification and tutorial by me.


 
Screenshot 2560x1440




This tutorial assumes you are using the original AS3 client and not the Seraph's Dominion client which has a few extra UI elements that need to be moved.

Let's begin.

Step 1:

Navigate to src\WebMain.as

Find this:

Code:
stage.scaleMode = StageScaleMode.EXACT_FIT;
Change to this:

Code:
stage.scaleMode = StageScaleMode.NO_SCALE;
Step 2:

Navigate to com\company\assembleegameclient\engine3d\Face3D.as

Find this:

Code:
	var _local3:Number = (_arg2._F_L_.x - 10);
        var _local4:Number = (_arg2._F_L_.y - 10);
        var _local5:Number = (_arg2._F_L_.right + 10);
        var _local6:Number = (_arg2._F_L_.bottom + 10);
        var _local7:Boolean = true;
        var _local8:int = this.vout_.length;
        var _local9:int;
Change to this:

Code:
	var _local3:Number = (_arg2._F_L_.x - 10);
        var _local4:Number = (_arg2._F_L_.y - 10);
        var _local5:Number = (_arg2._F_L_.right + 10);
        var _local6:Number = (_arg2._F_L_.bottom + 10);
        var _local7:Boolean = false;
        var _local8:int = this.vout_.length;
        var _local9:int;
Step 3:

Navigate to com\company\assembleegameclient\map\_0D_v.as

Find this:

Code:
	} else {
            _local8 = (this._F_L_.width / (2 * 50));
            _local9 = (this._F_L_.height / (2 * 50));
            this.maxDist_ = (Math.sqrt(((_local8 * _local8) + (_local9 * _local9))) + 1);
        }
        this._U_8 = (this.maxDist_ * this.maxDist_);
Change to this:

Code:
 } else {
            _local8 = (this._F_L_.width / (2 * 50));
            _local9 = (this._F_L_.height / (2 * 50));
            this.maxDist_ = (Math.sqrt(((_local8 * _local8) + (_local9 * _local9))) + 16); // 16 seems to be good for 1920x1080
        }
        this._U_8 = (this.maxDist_ * this.maxDist_);
Step 4:

Navigate to src\com\company\util\GraphicHelper.as

Find this:

Code:
	public static function _wj(_arg1:int, _arg2:int, _arg3:int, _arg4:int):GraphicsPath {
        return (new GraphicsPath(_H_2, new <Number>[_arg1, _arg2, (_arg1 + _arg3), _arg2, (_arg1 + _arg3), (_arg2 + _arg4), _arg1, (_arg2 + _arg4)]));
    }
Change to this:

Code:
	public static function _wj(_arg1:int, _arg2:int, _arg3:int, _arg4:int):GraphicsPath {
        new GraphicsPath(_H_2, new <Number>[_arg1, _arg2, (_arg1 + _arg3), _arg2, (_arg1 + _arg3), (_arg2 + _arg4), _arg1, (_arg2 + _arg4)]);
        return null;
    }
Step 5:

Navigate to src\_H_Z_\NexusBackground.as

Find this function:

Code:
    override public function draw(_arg1:_0D_v, _arg2:int):void {
        this.graphicsData_.length = 0;
        var _local3:Matrix = this.bitmapFill_.matrix;
        _local3.identity();
        _local3.translate((_arg2 * _cP_.x), (_arg2 * _cP_.y));
        _local3****tate(-(_arg1.angleRad_));
        this.bitmapFill_.bitmapData = this._T_k;
        this.graphicsData_.push(this.bitmapFill_);
        this.path_.data.length = 0;
        var _local4:Rectangle = _arg1._F_L_;
        this.path_.data.push(_local4.left, _local4.top, _local4.right, _local4.top, _local4.right, _local4.bottom, _local4.left, _local4.bottom);
        this.graphicsData_.push(this.path_);
        this.graphicsData_.push(GraphicHelper.END_FILL);
        this._0E_O_(_arg1, _arg2);
        graphics.clear();
        graphics.drawGraphicsData(this.graphicsData_);
    }
Comment out everything inside the function so that it looks like this:

Code:
    override public function draw(_arg1:_0D_v, _arg2:int):void {
//        this.graphicsData_.length = 0;
//        var _local3:Matrix = this.bitmapFill_.matrix;
//        _local3.identity();
//        _local3.translate((_arg2 * _cP_.x), (_arg2 * _cP_.y));
//        _local3****tate(-(_arg1.angleRad_));
//        this.bitmapFill_.bitmapData = this._T_k;
//        this.graphicsData_.push(this.bitmapFill_);
//        this.path_.data.length = 0;
//        var _local4:Rectangle = _arg1._F_L_;
//        this.path_.data.push(_local4.left, _local4.top, _local4.right, _local4.top, _local4.right, _local4.bottom, _local4.left, _local4.bottom);
//        this.graphicsData_.push(this.path_);
//        this.graphicsData_.push(GraphicHelper.END_FILL);
//        this._0E_O_(_arg1, _arg2);
//        graphics.clear();
//        graphics.drawGraphicsData(this.graphicsData_);
    }
Step 6:

Navigate to src\_0D_B_\Menu.as

Find this function:

Code:
	private function position():void {
        if (stage == null) {
            return;
        }
        stage;
        if (stage.mouseX < (800 / 2)) {
            x = (stage.mouseX + 12);
        } else {
            x = ((stage.mouseX - width) - 1);
        }
        if (x < 12) {
            x = 12;
        }
        stage;
        if (stage.mouseY < (600 / 3)) {
            y = (stage.mouseY + 12);
        } else {
            y = ((stage.mouseY - height) - 1);
        }
        if (y < 12) {
            y = 12;
        }
    }
Comment out this line near the end:

Code:
//            y = 12;
Step 7:

Navigate to src\_E_7\_for.as

Find this function:

Code:
    private function position():void {
        if (stage == null) {
            return;
        }
        stage;
        if (stage.mouseX < (800 / 2)) {
            x = (stage.mouseX + 12);
        } else {
            x = ((stage.mouseX - width) - 1);
        }
        if (x < 12) {
            x = 12;
        }
        stage;
        if (stage.mouseY < (600 / 3)) {
            y = (stage.mouseY + 12);
        } else {
            y = ((stage.mouseY - height) - 1);
        }
        if (y < 12) {
            y = 12;
        }
    }
Comment out this line near the end:

Code:
//            y = 12;
Step 8:

Navigate to src\com\company\assembleegameclient\game\GameSprit e.as

Find this function:

Code:
        private function onEnterFrame(_arg1:Event):void{
            _gs.updateFade();
            var _local5:Number;
            var _local2:int = getTimer();
            var _local3:int = (_local2 - this.lastUpdate_);
            if (this._0H_R_.update(_local3))
            {
                dispatchEvent(new Event(Event.COMPLETE));
                return;
            };
            this._bA_ = (this._bA_ + _local3);
            this._qA_ = (this._qA_ + 1);
            if (this._bA_ > 300000)
            {
                _local5 = int(Math****und(((1000 * this._qA_) / this._bA_)));
                //GA.global().trackEvent("performance", "frameRate", this.map_.name_, _local5);
                this._qA_ = 0;
                this._bA_ = 0;
            };
            this.map_.update(_local2, _local3);
            this._on.update(_local3);
            var _local4:Player = this.map_.player_;
            if (_local4 != null)
            {
                this._on._K_g(_local4);
                this.map_.draw(this._on, _local2);
                this._H_t.draw(_local4.credits_, _local4._Q_7);
                this._V_1.draw();
                if (this.map_.showDisplays_)
                {
                    this._pg.draw(_local4.numStars_);
                    this._4v.draw(_local4.guildName_, _local4.guildRank_);
                };
                if (_local4.isPaused())
                {
                    this.map_.filters = [_oj];
                    this._V_1.filters = [_oj];
                    this.map_.mouseEnabled = false;
                    this.map_.mouseChildren = false;
                    this._V_1.mouseEnabled = false;
                    this._V_1.mouseChildren = false;
                } else
                {
                    if (this.map_.filters.length > 0)
                    {
                        this.map_.filters = [];
                        this._V_1.filters = [];
                        this.map_.mouseEnabled = true;
                        this.map_.mouseChildren = true;
                        this._V_1.mouseEnabled = true;
                        this._V_1.mouseChildren = true;
                    };
                };
                this.moveRecords_._F_5(_local2, _local4.x_, _local4.y_);
            };
            this.lastUpdate_ = _local2;
        }
Replace it with this:

Code:
        private function onEnterFrame(_arg1:Event):void{
	    this.textBox_.x = 400 - (stage.stageWidth) / (2);
	    this.textBox_.y = (stage.stageHeight) / (2) - 300;
            _gs.updateFade();
            var _local5:Number;
            var _local2:int = getTimer();
            var _local3:int = (_local2 - this.lastUpdate_);
            if (this._0H_R_.update(_local3))
            {
                dispatchEvent(new Event(Event.COMPLETE));
                return;
            };
            this._bA_ = (this._bA_ + _local3);
            this._qA_ = (this._qA_ + 1);
            if (this._bA_ > 300000)
            {
                _local5 = int(Math****und(((1000 * this._qA_) / this._bA_)));
                //GA.global().trackEvent("performance", "frameRate", this.map_.name_, _local5);
                this._qA_ = 0;
                this._bA_ = 0;
            };
            this.map_.update(_local2, _local3);
            this._on.update(_local3);
            var _local4:Player = this.map_.player_;
            if (_local4 != null)
            {
                this._on._K_g(_local4);
                this.map_.draw(this._on, _local2);
				this._H_t.x = 194 + (stage.stageWidth) / (2);
				this._H_t.y = 300 - (stage.stageHeight) / (2);
                this._H_t.draw(_local4.credits_, _local4._Q_7);
				this._V_1.x = 200 + (stage.stageWidth) / (2);
                this._V_1.draw();
                if (this.map_.showDisplays_) {
                this._pg.x = 408 - (stage.stageWidth) / (2);
                this._pg.y = 304 - (stage.stageHeight) / (2);
                this._pg.draw(_local4.numStars_);
                this._4v.x = 464 - (stage.stageWidth) / (2);
                this._4v.y = 306 - (stage.stageHeight) / (2);
                this._4v.draw(_local4.guildName_, _local4.guildRank_);
				}
                if (_local4.isPaused())
                {
                    this.map_.filters = [_oj];
                    this._V_1.filters = [_oj];
                    this.map_.mouseEnabled = false;
                    this.map_.mouseChildren = false;
                    this._V_1.mouseEnabled = false;
                    this._V_1.mouseChildren = false;
                } else
                {
                    if (this.map_.filters.length > 0)
                    {
                        this.map_.filters = [];
                        this._V_1.filters = [];
                        this.map_.mouseEnabled = true;
                        this.map_.mouseChildren = true;
                        this._V_1.mouseEnabled = true;
                        this._V_1.mouseChildren = true;
                    };
                };
                this.moveRecords_._F_5(_local2, _local4.x_, _local4.y_);
            };
            this.lastUpdate_ = _local2;
        }
Next find this function:

Code:
    public function _dO_(_arg1:MapInfo):void {
        if (!this._rz) {
            this._rz = new _02a();
        }
        addChild(this._rz);
        _D_L_.getInstance().dispatch(_arg1);
    }
Replace it with this:

Code:
    public function _dO_(_arg1:MapInfo):void {
        if (!this._rz) {
            this._rz = new _02a();
        }
        this._rz.width = stage.stageWidth;
        this._rz.height = stage.stageHeight;
        this._rz.x = 400 - (stage.stageWidth) / (2);
        this._rz.y = 300 - (stage.stageHeight) / (2);
        addChild(this._rz);
        addChild(this.textBox_);
        _D_L_.getInstance().dispatch(_arg1);
    }
Step 9:

Click File>Save All. Then Build>Rebuild.

That's it. Enjoy!

 
Credits

Snuffleupagus - For the AVM2 Bytecode conversion and tutorial.
@nilly - For the original Fullscreen Hack v2.
@Kithio - For the AS3 source code.
@Travoos - For the AS3 source code.
Thanks. Useful tutorial
Nice tutorial! I'm glad to see you're producing useful content
Quote Originally Posted by Prince Zuko View Post
Nice tutorial! I'm glad to see you're producing useful content
Shut the fuck up <3
Quote Originally Posted by Prince Zuko View Post
Nice tutorial! I'm glad to see you're producing useful content
yeh Shut the fuck up
Extra UI changes for Seraphs:

Souls:

Find
Code:
            this.camera_._K_g(_local4);
            this.map_.draw(this.camera_, _local2);
            this._H_t.x = 194 + (stage.stageWidth) / (2);
            this._H_t.y = 300 - (stage.stageHeight) / (2);
            this._H_t.draw(_local4.credits_, _local4.fame_);
ADD this right under it

Code:
            this._H_T_.x = 194 + (stage.stageWidth) / (2);
            this._H_T_.y = 320 - (stage.stageHeight) / (2);
            this._H_T_.draw(_local4.souls_);

Mule/Update button:
Working on it... (5 AM so might take a break.)
Alright, so TBH, it's too much to have the position change when fullscreened. Atleast I found it that way when working on it. (Might of been because it was really late.)
So I just removed it. I doubt you will need to use the Mule/Update button anyways. Chances are you won't use the mule system, and if you do, you probably don't need a tutorial on this. I suggest disabling it.

To disable:
(This doesn't delete it all together, and is easily turned back on. Just reverse what you did.)

Find
Code:
if (this.evalIsNotInCombatMapArea()){
            this.initExtras();
        }
Add // in front of this.initExtras();
Like
Code:
if (this.evalIsNotInCombatMapArea()){
       //     this.initExtras();
        }



Step 8 gave me errors.
I'm using the Seraphs Dominion AS3, but either way.
If you are using original AS3, and this doesn't fix it, let me know.
To fix:

Use this for the first replacement instead
Code:
    private function onEnterFrame(_arg1:Event):void{
        this.textBox_.x = 400 - (stage.stageWidth) / (2);
        this.textBox_.y = (stage.stageHeight) / (2) - 300;
        _gs.updateFade();
        var _local5:Number;
        var _local2:int = getTimer();
        var _local3:int = (_local2 - this.lastUpdate_);
        if (this._0H_R_.update(_local3))
        {
            dispatchEvent(new Event(Event.COMPLETE));
            return;
        };
        this._bA_ = (this._bA_ + _local3);
        this._qA_ = (this._qA_ + 1);
        if (this._bA_ > 300000)
        {
            _local5 = int(Math****und(((1000 * this._qA_) / this._bA_)));
            //GA.global().trackEvent("performance", "frameRate", this.map_.name_, _local5);
            this._qA_ = 0;
            this._bA_ = 0;
        };
        this.map_.update(_local2, _local3);
        var _local4:Player = this.map_.player_;
        if (_local4 != null)
        {
            this.camera_._K_g(_local4);
            this.map_.draw(this.camera_, _local2);
            this._H_t.x = 194 + (stage.stageWidth) / (2);
            this._H_t.y = 300 - (stage.stageHeight) / (2);
            this._H_t.draw(_local4.credits_, _local4.fame_);
            this._V_1.x = 200 + (stage.stageWidth) / (2);
            this._V_1.draw();
            if (this.map_.showDisplays_) {
                this._pg.x = 408 - (stage.stageWidth) / (2);
                this._pg.y = 304 - (stage.stageHeight) / (2);
                this._pg.draw(_local4.numStars_);
                this._4v.x = 464 - (stage.stageWidth) / (2);
                this._4v.y = 306 - (stage.stageHeight) / (2);
                this._4v.draw(_local4.guildName_, _local4.guildRank_);
            }
            if (_local4.isPaused())
            {
                this.map_.filters = [_oj];
                this._V_1.filters = [_oj];
                this.map_.mouseEnabled = false;
                this.map_.mouseChildren = false;
                this._V_1.mouseEnabled = false;
                this._V_1.mouseChildren = false;
            } else
            {
                if (this.map_.filters.length > 0)
                {
                    this.map_.filters = [];
                    this._V_1.filters = [];
                    this.map_.mouseEnabled = true;
                    this.map_.mouseChildren = true;
                    this._V_1.mouseEnabled = true;
                    this._V_1.mouseChildren = true;
                };
            };
            this.moveRecords_._F_5(_local2, _local4.x_, _local4.y_);
        };
        this.lastUpdate_ = _local2;
    }

After you replace everything, find
Code:
Math****und
and replace it with
Code:
Math . round
without the space next to the .
MPGH thinks it's a link so messes it up.


This might of just been me. I'm glad to help either way.
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us