[FSoD] [Prod Client] Parallel Fame and Exp Bars

Posts 1–14 of 14 · Page 1 of 1
[FSoD] [Prod Client] Parallel Fame and Exp Bars
Ok, boys. I just figured this out and thought other people would enjoy it.

First open up src/kabam/rotmg/ui/view/StatMetersView.as
Replace the entire thing with this (replace the 4 stars with DOTTTrot)
Code:
package kabam****tmg.ui.view {
import com.company.assembleegameclient.objects.Player;
import com.company.assembleegameclient.ui.ExperienceBoostTimerPopup;
import com.company.assembleegameclient.ui.StatusBar;

import flash.display.Sprite;
import flash.events.Event;

import kabam****tmg.text.model.TextKey;

public class StatMetersView extends Sprite {

    private var expBar_:StatusBar;
    private var fameBar_:StatusBar;
    private var hpBar_:StatusBar;
    private var mpBar_:StatusBar;
    private var areTempXpListenersAdded:Boolean;
    private var curXPBoost:int;
    private var expTimer:ExperienceBoostTimerPopup;

    public function StatMetersView() {
        this.expBar_ = new StatusBar(176, 8, 5931045, 0x545454, TextKey.EXP_BAR_LEVEL);
        this.fameBar_ = new StatusBar(176, 8, 0xE25F00, 0x545454, TextKey.CURRENCY_FAME);
        this.hpBar_ = new StatusBar(176, 16, 14693428, 0x545454, TextKey.STATUS_BAR_HEALTH_POINTS);
        this.mpBar_ = new StatusBar(176, 16, 6325472, 0x545454, TextKey.STATUS_BAR_MANA_POINTS);
        this.expBar_.y = 12;
        this.hpBar_.y = 24;
        this.mpBar_.y = 48;
        this.expBar_.visible = true;
        this.fameBar_.visible = true;
        addChild(this.expBar_);
        addChild(this.fameBar_);
        addChild(this.hpBar_);
        addChild(this.mpBar_);
    }

    public function update(_arg_1:Player):void {
        this.expBar_.setLabelText(TextKey.EXP_BAR_LEVEL, {"level": _arg_1.level_});
        if (_arg_1.level_ != 20) {
            if (this.expTimer) {
                this.expTimer.update(_arg_1.xpTimer);
            }
            this.expBar_.draw(_arg_1.exp_, _arg_1.nextLevelExp_, 0);
            if (this.curXPBoost != _arg_1.xpBoost_) {
                this.curXPBoost = _arg_1.xpBoost_;
                if (this.curXPBoost) {
                    this.expBar_.showMultiplierText();
                }
                else {
                    this.expBar_.hideMultiplierText();
                }
            }
            if (_arg_1.xpTimer) {
                if (!this.areTempXpListenersAdded) {
                    this.expBar_.addEventListener("MULTIPLIER_OVER", this.onExpBarOver);
                    this.expBar_.addEventListener("MULTIPLIER_OUT", this.onExpBarOut);
                    this.areTempXpListenersAdded = true;
                }
            }
            else {
                if (this.areTempXpListenersAdded) {
                    this.expBar_.removeEventListener("MULTIPLIER_OVER", this.onExpBarOver);
                    this.expBar_.removeEventListener("MULTIPLIER_OUT", this.onExpBarOut);
                    this.areTempXpListenersAdded = false;
                }
                if (((this.expTimer) && (this.expTimer.parent))) {
                    removeChild(this.expTimer);
                    this.expTimer = null;
                }
            }
        }
        else
        {
            this.expBar_.setLabelText("Max Level")
            this.expBar_.draw(1, 1, 0, -1, false);
        }
        this.fameBar_.draw(_arg_1.currFame_, _arg_1.nextClassQuestFame_, 0);
        this.hpBar_.draw(_arg_1.hp_, _arg_1.maxHP_, _arg_1.maxHPBoost_, _arg_1.maxHPMax_);
        this.mpBar_.draw(_arg_1.mp_, _arg_1.maxMP_, _arg_1.maxMPBoost_, _arg_1.maxMPMax_);
    }

    private function onExpBarOver(_arg_1:Event):void {
        addChild((this.expTimer = new ExperienceBoostTimerPopup()));
    }

    private function onExpBarOut(_arg_1:Event):void {
        if (((this.expTimer) && (this.expTimer.parent))) {
            removeChild(this.expTimer);
            this.expTimer = null;
        }
    }


}
}//package kabam****tmg.ui.view
Then open up src/com/company/assembleegameclient/ui/StatusBar.as
Replace the entire thing with this (replace the 4 stars with DOTTTrot)
Code:
package com.company.assembleegameclient.ui {
import com.company.assembleegameclient.parameters.Parameters;

import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;

import kabam****tmg.text.view.TextFieldDisplayConcrete;
import kabam****tmg.text.view.stringBuilder.LineBuilder;
import kabam****tmg.text.view.stringBuilder.StaticStringBuilder;

import org.osflash.signals.Signal;

public class StatusBar extends Sprite {

    public static var barTextSignal:Signal = new Signal(Boolean);

    public var w_:int;
    public var h_:int;
    public var color_:uint;
    public var backColor_:uint;
    public var pulseBackColor:uint;
    public var textColor_:uint;
    public var val_:int = -1;
    public var max_:int = -1;
    public var boost_:int = -1;
    public var maxMax_:int = -1;
    public var drawText_:Boolean = true;
    private var labelText_:TextFieldDisplayConcrete;
    private var labelTextStringBuilder_:LineBuilder;
    private var valueText_:TextFieldDisplayConcrete;
    private var valueTextStringBuilder_:StaticStringBuilder;
    private var boostText_:TextFieldDisplayConcrete;
    private var multiplierText:TextFieldDisplayConcrete;
    public var multiplierIcon:Sprite;
    private var colorSprite:Sprite;
    private var defaultForegroundColor:Number;
    private var defaultBackgroundColor:Number;
    public var mouseOver_:Boolean = false;
    private var isPulsing:Boolean = false;
    private var repetitions:int;
    private var direction:int = -1;
    private var speed:Number = 0.1;

    public function StatusBar(_arg_1:int, _arg_2:int, _arg_3:uint, _arg_4:uint, _arg_5:String = null) {
        this.colorSprite = new Sprite();
        super();
        addChild(this.colorSprite);
        this.w_ = _arg_1;
        this.h_ = _arg_2;
        this.defaultForegroundColor = (this.color_ = _arg_3);
        this.defaultBackgroundColor = (this.backColor_ = _arg_4);
        this.textColor_ = 0xFFFFFF;
        if (((!((_arg_5 == null))) && (!((_arg_5.length == 0))))) {
            this.labelText_ = new TextFieldDisplayConcrete().setSize(14).setColor(this.textColor_);
            this.labelText_.setBold(true);
            this.labelTextStringBuilder_ = new LineBuilder().setParams(_arg_5);
            this.labelText_.setStringBuilder(this.labelTextStringBuilder_);
            this.centerVertically(this.labelText_);
            this.labelText_.filters = [new DropShadowFilter(0, 0, 0)];
            addChild(this.labelText_);
        }
        this.valueText_ = new TextFieldDisplayConcrete().setSize(14).setColor(0xFFFFFF);
        this.valueText_.setBold(true);
        this.valueText_.filters = [new DropShadowFilter(0, 0, 0)];
        this.centerVertically(this.valueText_);
        this.valueTextStringBuilder_ = new StaticStringBuilder();
        this.boostText_ = new TextFieldDisplayConcrete().setSize(14).setColor(this.textColor_);
        this.boostText_.setBold(true);
        this.boostText_.alpha = 0.6;
        this.centerVertically(this.boostText_);
        this.boostText_.filters = [new DropShadowFilter(0, 0, 0)];
        this.multiplierIcon = new Sprite();
        this.multiplierIcon.x = (this.w_ - 25);
        this.multiplierIcon.y = -3;
        this.multiplierIcon.graphics.beginFill(0xFF00FF, 0);
        this.multiplierIcon.graphics.drawRect(0, 0, 20, 20);
        this.multiplierIcon.addEventListener(MouseEvent.MOUSE_OVER, this.onMultiplierOver);
        this.multiplierIcon.addEventListener(MouseEvent.MOUSE_OUT, this.onMultiplierOut);
        this.multiplierText = new TextFieldDisplayConcrete().setSize(14).setColor(9493531);
        this.multiplierText.setBold(true);
        this.multiplierText.setStringBuilder(new StaticStringBuilder("x2"));
        this.multiplierText.filters = [new DropShadowFilter(0, 0, 0)];
        this.multiplierIcon.addChild(this.multiplierText);
        if (!Parameters.data_.toggleBarText) {
            addEventListener(MouseEvent****LL_OVER, this.onMouseOver);
            addEventListener(MouseEvent****LL_OUT, this.onMouseOut);
        }
        barTextSignal.add(this.setBarText);
    }

    public function centerVertically(_arg_1:TextFieldDisplayConcrete):void {
        _arg_1.setVerticalAlign(TextFieldDisplayConcrete.MIDDLE);
        _arg_1.y = ((this.h_ / 2) + 1);
    }

    private function onMultiplierOver(_arg_1:MouseEvent):void {
        dispatchEvent(new Event("MULTIPLIER_OVER"));
    }

    private function onMultiplierOut(_arg_1:MouseEvent):void {
        dispatchEvent(new Event("MULTIPLIER_OUT"));
    }

    public function draw(_arg_1:int, _arg_2:int, _arg_3:int, _arg_4:int = -1, drawText:Boolean = true):void {
        if (_arg_2 > 0) {
            _arg_1 = Math.min(_arg_2, Math.max(0, _arg_1));
        }
        if ((((((((_arg_1 == this.val_)) && ((_arg_2 == this.max_)))) && ((_arg_3 == this.boost_)))) && ((_arg_4 == this.maxMax_)))) {
            return;
        }
        this.val_ = _arg_1;
        this.max_ = _arg_2;
        this.boost_ = _arg_3;
        this.maxMax_ = _arg_4;
        this.drawText_ = drawText;
        this.internalDraw();
    }

    public function setLabelText(_arg_1:String, _arg_2:Object = null):void {
        this.labelTextStringBuilder_.setParams(_arg_1, _arg_2);
        this.labelText_.setStringBuilder(this.labelTextStringBuilder_);
    }

    private function setTextColor(_arg_1:uint):void {
        this.textColor_ = _arg_1;
        if (this.boostText_ != null) {
            this.boostText_.setColor(this.textColor_);
        }
        this.valueText_.setColor(this.textColor_);
    }

    public function setBarText(_arg_1:Boolean):void {
        this.mouseOver_ = false;
        if (_arg_1) {
            removeEventListener(MouseEvent****LL_OVER, this.onMouseOver);
            removeEventListener(MouseEvent****LL_OUT, this.onMouseOut);
        }
        else {
            addEventListener(MouseEvent****LL_OVER, this.onMouseOver);
            addEventListener(MouseEvent****LL_OUT, this.onMouseOut);
        }
        this.internalDraw();
    }

    private function internalDraw():void {
        graphics.clear();
        this.colorSprite.graphics.clear();
        var _local_1:uint = 0xFFFFFF;
        if ((((this.maxMax_ > 0)) && (((this.max_ - this.boost_) == this.maxMax_)))) {
            _local_1 = 0xFCDF00;
        }
        else {
            if (this.boost_ > 0) {
                _local_1 = 6206769;
            }
        }
        if (this.textColor_ != _local_1) {
            this.setTextColor(_local_1);
        }
        graphics.beginFill(this.backColor_);
        graphics.drawRect(0, 0, this.w_, this.h_);
        graphics.endFill();
        if (this.isPulsing) {
            this.colorSprite.graphics.beginFill(this.pulseBackColor);
            this.colorSprite.graphics.drawRect(0, 0, this.w_, this.h_);
        }
        this.colorSprite.graphics.beginFill(this.color_);
        if (this.max_ > 0) {
            this.colorSprite.graphics.drawRect(0, 0, (this.w_ * (this.val_ / this.max_)), this.h_);
        }
        else {
            this.colorSprite.graphics.drawRect(0, 0, this.w_, this.h_);
        }
        this.colorSprite.graphics.endFill();
        if (contains(this.valueText_)) {
            removeChild(this.valueText_);
        }
        if (contains(this.boostText_)) {
            removeChild(this.boostText_);
        }
        if (((Parameters.data_.toggleBarText) || (((this.mouseOver_) && ((this.h_ > 4)))))) {
            this.drawWithMouseOver();
        }
    }

    public function drawWithMouseOver():void {
        if (this.max_ > 0) {
            if(this.drawText_)
            {
                this.valueText_.setStringBuilder(this.valueTextStringBuilder_.setString(((this.val_ + "/") + this.max_)));
            }
            else
            {
                this.valueText_.setStringBuilder(this.valueTextStringBuilder_.setString(""));
            }
        }
        else {
            if(this.drawText_)
            {
                this.valueText_.setStringBuilder(this.valueTextStringBuilder_.setString(("" + this.val_)));
            }
            else
            {
                this.valueText_.setStringBuilder(this.valueTextStringBuilder_.setString(""));
            }
        }
        if (!contains(this.valueText_)) {
            this.valueText_.mouseEnabled = false;
            this.valueText_.mouseChildren = false;
            addChild(this.valueText_);
        }
        if (this.boost_ != 0) {
            this.boostText_.setStringBuilder(this.valueTextStringBuilder_.setString((((" (" + (((this.boost_ > 0)) ? "+" : "")) + this.boost_.toString()) + ")")));
            if (!contains(this.boostText_)) {
                this.boostText_.mouseEnabled = false;
                this.boostText_.mouseChildren = false;
                addChild(this.boostText_);
            }
            this.valueText_.x = ((this.w_ / 2) - ((this.valueText_.width + this.boostText_.width) / 2));
            this.boostText_.x = (this.valueText_.x + this.valueText_.width);
        }
        else {
            this.valueText_.x = ((this.w_ / 2) - (this.valueText_.width / 2));
            if (contains(this.boostText_)) {
                removeChild(this.boostText_);
            }
        }
    }

    public function showMultiplierText():void {
        this.multiplierIcon.mouseEnabled = false;
        this.multiplierIcon.mouseChildren = false;
        addChild(this.multiplierIcon);
        this.startPulse(3, 9493531, 0xFFFFFF);
    }

    public function hideMultiplierText():void {
        if (this.multiplierIcon.parent) {
            removeChild(this.multiplierIcon);
        }
    }

    public function startPulse(_arg_1:Number, _arg_2:Number, _arg_3:Number):void {
        this.isPulsing = true;
        this.color_ = _arg_2;
        this.pulseBackColor = _arg_3;
        this.repetitions = _arg_1;
        this.internalDraw();
        addEventListener(Event.ENTER_FRAME, this.onPulse);
    }

    private function onPulse(_arg_1:Event):void {
        if ((((this.colorSprite.alpha > 1)) || ((this.colorSprite.alpha < 0)))) {
            this.direction = (this.direction * -1);
            if (this.colorSprite.alpha > 1) {
                this.repetitions--;
                if (!this.repetitions) {
                    this.isPulsing = false;
                    this.color_ = this.defaultForegroundColor;
                    this.backColor_ = this.defaultBackgroundColor;
                    this.colorSprite.alpha = 1;
                    this.internalDraw();
                    removeEventListener(Event.ENTER_FRAME, this.onPulse);
                }
            }
        }
        this.colorSprite.alpha = (this.colorSprite.alpha + (this.speed * this.direction));
    }

    private function onMouseOver(_arg_1:MouseEvent):void {
        this.mouseOver_ = true;
        this.internalDraw();
    }

    private function onMouseOut(_arg_1:MouseEvent):void {
        this.mouseOver_ = false;
        this.internalDraw();
    }


}
}//package com.company.assembleegameclient.ui
Here is the final product:
Have fun and experiment with it. You can also do something like this with the HP and MP bars, but I don't know why you would.
I don't get the purpose of this......
Quote Originally Posted by Demon View Post
I don't get the purpose of this......
It's an entry level client UI edit. It's purpose is to show people the possibilities of client edits.
Quote Originally Posted by SlickEashy View Post
It's an entry level client UI edit. It's purpose is to show people the possibilities of client edits.
Still The Regular Level Bars Look Better
Oh no, my self-esteem just collapsed in on it's self. How could you every say something like that.
I'm going to look with this file.

Good job and thanks for idea.
Just figured out how to make the text smaller in the bars, it's very easy. You guys can probably figure it out yourselves.
Quote Originally Posted by SlickEashy View Post
Just figured out how to make the text smaller in the bars, it's very easy. You guys can probably figure it out yourselves.
Good post. Helps people get the ropes of UI design whilst simultaneously letting people use their own brains.
Quote Originally Posted by coolguy950 View Post
Good post. Helps people get the ropes of UI design whilst simultaneously letting people use their own brains.
no it does not, you literally replace the file with the code.
Quote Originally Posted by sgrawsreghawrhgwrhgr View Post
no it does not, you literally replace the file with the code.
depends whether or not you're just copying and pasting shit as opposed to understanding
someone who takes some time to review shit can probably clue themselves in on how to create more complex ui changes
Quote Originally Posted by coolguy950 View Post
depends whether or not you're just copying and pasting shit as opposed to understanding
someone who takes some time to review shit can probably clue themselves in on how to create more complex ui changes
? they will copy and paste because they are told to copy and paste, this post doesnt help with understanding how the ui works, anyone could work out by looking at the original file...
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?