Yanfly's CTB - Hide Turn Order Window

Discussion in 'Javascript/Plugin Support' started by shukiri, Nov 25, 2019.

  1. shukiri

    shukiri Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMMV
    Hi,

    I need some help hiding the turn order display in some specific circumstances such as on the victory screen and when text is displayed in battle (temporarily hiding). If someone could either point out how to do it, I would be extremely grateful.

    Script: http://www.yanfly.moe/wiki/Battle_System_-_CTB_(YEP)

    Thanks.
     
    #1
  2. shukiri

    shukiri Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMMV
    Update: I've solved half of the problem by using the patch here: https://forums.rpgmakerweb.com/inde...attle-result-with-yanfly-plugins-rmmv.104946/ -- It now hides when displaying battle results.

    Code:
    var Imported = Imported || {};
    Imported.MRP_MOG_YEP_BattleResultHide = true;
    
    (function() {
        var MRP_BATTLERESULTHIDE_SB_CREATEBRESULT_OLD = Scene_Battle.prototype.createBResult;
        Scene_Battle.prototype.createBResult = function() {
            MRP_BATTLERESULTHIDE_SB_CREATEBRESULT_OLD.call(this);
            
            if(Imported.YEP_BattleEngineCore) BattleManager._victoryPhase = true;
            if(Imported.YEP_BattleStatusWindow)
            {
                this._statusWindow.hide();       
            }       
        };   
    })();
    Can anyone use this to also hide the CTB order window when text is being shown in battle?

    I read somewhere that is might have to do with $gameMessage.isBusy()... how would I use that?

    Thanks.
     
    #2
  3. shukiri

    shukiri Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMMV
    So the setting "BattleManager._victoryPhase = true;" hides it permanently. I need a way to turn it off and on when text shows in battle.

    Code:
    Window_CTBIcon.prototype.updateOpacity = function() {
        var rate = this.opacityFadeRate();
        
        if (this._foreverHidden) return this.reduceOpacity();
        if (this.isReduceOpacity()) return this.reduceOpacity();
        if (BattleManager._victoryPhase) {
          this._foreverHidden = true;
          return this.reduceOpacity();
        }
        if (BattleManager._escaped) {
          this._foreverHidden = true;
          return this.reduceOpacity();
        }
        if (this._battler) {
          var index = BattleManager.ctbTurnOrder().reverse().indexOf(this._battler);
          if (index < 0) return this.reduceOpacity();
        }
        this.contentsOpacity += rate;
    };
    In the plugin settings, there is a parameter to show hide the turn order "Yanfly.Param.CTBTurnOrder" but I think it only checks this at the battle start...

    Code:
    Sprite_Battler.prototype.createCTBIcon = function() {
        if (!Yanfly.Param.CTBTurnOrder) return;
        this._ctbIcon = new Window_CTBIcon(this);
    };
    Is there something we can put in the updateOpacity function to hide when "$gameMessage.isBusy()" or whatever the appropriate condition for that is?
     
    #3

Share This Page