Job Points in the correct place

Discussion in 'Javascript/Plugin Support' started by Tatsumaro, Sep 12, 2017.

  1. Tatsumaro

    Tatsumaro Veteran

    Messages:
    172
    Likes Received:
    34
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    this should be easy to anyone whit coding skills. sadly that is not my case. my game mechanics uses Job Points from yanfly and Equipment Learning from Moogle_X, its all working and i'm rely pleased whit the outcome off this :thumbsup-left:.

    But not all are roses, when a batel end the players must endure YEP_VictoryAftermath exp | Ap Gain After Battle | JP window | YEP_VictoryAftermath drops. What i need is:

    //=============================================================================
    // Window_VictoryJp
    //=============================================================================

    if (Imported.YEP_VictoryAftermath && Yanfly.Param.JpEnableAftermath) {

    function Window_VictoryJp() {
    this.initialize.apply(this, arguments);
    }

    Window_VictoryJp.prototype = Object.create(Window_VictoryExp.prototype);
    Window_VictoryJp.prototype.constructor = Window_VictoryJp;

    Window_VictoryJp.prototype.drawActorGauge = function(actor, index) {
    this.clearGaugeRect(index);
    var rect = this.gaugeRect(index);
    this.changeTextColor(this.normalColor());
    this.drawActorName(actor, rect.x + 2, rect.y);
    this.drawLevel(actor, rect);
    this.drawJpGained(actor, rect);
    };

    Window_VictoryJp.prototype.drawJpGained = function(actor, rect) {
    var wy = rect.y + this.lineHeight() * 1;
    this.changeTextColor(this.systemColor());
    this.drawText(Yanfly.Param.JpAftermathEarn, rect.x + 2, wy, rect.width - 4,
    'left');
    var bonusJp = 1.0 * actor.battleJp() * this._tick /
    Yanfly.Param.VAGaugeTicks;
    var value = Yanfly.Util.toGroup(parseInt(bonusJp));
    var fmt = Yanfly.Param.JpAftermathFmt;
    var icon = '\\i[' + Yanfly.Icon.Jp + ']';
    var JpText = fmt.format(value, Yanfly.Param.Jp, icon);
    this.changeTextColor(this.normalColor());
    wx = rect.x + rect.width - this.textWidthEx(JpText);
    this.drawTextEx(JpText, wx, wy);
    };

    in the Equipment Learning so in only one window the player can see Jp and Ap.
    The code shod be placed in this part, i think:

    //=============================================================================
    // Window_EqlVictoryAp
    //=============================================================================

    if (Imported.YEP_VictoryAftermath && Moogle_X.EQL.useAft) {

    function Window_EqlVictoryAp() {
    this.initialize.apply(this, arguments);
    }

    Window_EqlVictoryAp.prototype = Object.create(Window_VictoryExp.prototype);
    Window_EqlVictoryAp.prototype.constructor = Window_EqlVictoryAp;

    Window_EqlVictoryAp.prototype.drawActorGauge = function(actor, index) {
    this.clearGaugeRect(index);
    var rect = this.gaugeRect(index);
    this.changeTextColor(this.normalColor());
    this.drawActorName(actor, rect.x + 2, rect.y);
    this.drawLevel(actor, rect);
    this.drawApGained(actor, rect);
    this.drawGainedSkills(actor, rect);
    };

    Window_EqlVictoryAp.prototype.drawApGained = function(actor, rect) {
    var wy = rect.y + this.lineHeight() * 1;
    this.changeTextColor(this.systemColor());
    this.drawText(Moogle_X.EQL.aftApGainText, rect.x + 2, wy, rect.width - 4,
    'left');
    var bonusAp = 1.0 * actor.eqlBattleAp() * this._tick /
    Yanfly.Param.VAGaugeTicks;
    var value = Yanfly.Util.toGroup(parseInt(bonusAp));
    var fmt = Moogle_X.EQL.aftApFmt;
    var apText = fmt.format(value, Moogle_X.EQL.apVocab);
    this.changeTextColor(this.normalColor());
    wx = rect.x + rect.width - this.textWidthEx(apText);
    this.drawTextEx(apText, wx, wy);
    };

    Any suggestions? SumRndmDde as a tone off this things on is plugins but i just don't have the knowledge to copy is process and apply it to this situation.
     
    #1
  2. Tatsumaro

    Tatsumaro Veteran

    Messages:
    172
    Likes Received:
    34
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    [​IMG]
    Equipment Learning
    +

    [​IMG]
    Job Points
    =

    [​IMG]

    PERFECT :mrsatan:
     
    #2
  3. Moogle_X

    Moogle_X Veteran

    Messages:
    153
    Likes Received:
    292
    First Language:
    English
    You need to do 3 things:

    1. Turn off "Enable Aftermath" parameter from YEP_JobPoints. Yanfly specifically state to type "false" which actually doesn't actually turning off the parameter (bug). You need to type empty string instead (don't type anything) in order to prevent the JP Aftermath window to show up after battle.

    2. Add new line of code below "this.drawApGained(actor, rect);" (line 1381)
    You need to put "this.drawJpGained(actor, rect);" code below it. The end result is like this.
    [​IMG]

    3. You need add this new function. Copy paste this new code directly at line 1385 (refer to picture above).

    Window_EqlVictoryAp.prototype.drawJpGained = function(actor, rect) {
    var wy = rect.y + this.lineHeight() * 2;
    this.changeTextColor(this.systemColor());
    this.drawText(Yanfly.Param.JpAftermathEarn, rect.x + 2, wy, rect.width - 4,
    'left');
    var bonusJp = 1.0 * actor.battleJp() * this._tick /
    Yanfly.Param.VAGaugeTicks;
    var value = Yanfly.Util.toGroup(parseInt(bonusJp));
    var fmt = Yanfly.Param.JpAftermathFmt;
    var icon = '\\i[' + Yanfly.Icon.Jp + ']';
    var JpText = fmt.format(value, Yanfly.Param.Jp, icon);
    this.changeTextColor(this.normalColor());
    wx = rect.x + rect.width - this.textWidthEx(JpText);
    this.drawTextEx(JpText, wx, wy);
    };

    [​IMG]

    This will be the final scene. Enjoy! ;)

    [​IMG]
     
    #3
    Raol, falken14, ramza and 2 others like this.
  4. dbchest

    dbchest Beast Master

    Messages:
    425
    Likes Received:
    277
    Location:
    Pennsylvania
    First Language:
    English
    Primarily Uses:
    RMMV
    #4
    Tatsumaro likes this.
  5. Tatsumaro

    Tatsumaro Veteran

    Messages:
    172
    Likes Received:
    34
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    OMG thank you, for this and for this amazing plugin. Mate you :rock-left:rock:rock-right:

    PS: Moogle_X himself, i never imagine this outcome. THANKS
     
    #5
  6. Raol

    Raol Cat Magic Wizard

    Messages:
    47
    Likes Received:
    88
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMMV
    Sorry, wrong topic. If you are a moderator, please delete this comment.
     
    #6
    Tatsumaro likes this.

Share This Page