Yanfly Charge Turn Battle System /CTB) - Vertical Turn Order?

Hey guys 🙂


As I want my game to play in widescreen, changing it so that the turn order bar of Yanfly Charge Turn Battle System is not replaced horizontally, but vertically on either the right or the left side of the screen would look much better and use the available screen space much more efficiently. To clarify what I mean: Instead of the next character's icon on the turn order bar being on the left side of it, the next character's icon would be on top of a vertical bar.


I know that is not possible with Yanfly's plug-in out of the box, but does someone maybe have a modified version or could help me out with modifying the code responsible for displaying the turn order bar?


Any help would be greatly appreciated!
I just drop down the relevant codes for now:

Spoiler
Window_CTBIcon.prototype.update = function() {
Window_Base.prototype.update.call(this);
this.updateBattler();
this.updateIconIndex();
this.updateRedraw();
this.updateDestinationX();
this.updateOpacity();
this.updatePositionX();
this.updatePositionY();
};

Window_CTBIcon.prototype.updateDestinationX = function() {
if (!this._battler) return;
if (this._battler.isDead()) return;
if (this._position === 'left') this.updateDestinationLeftAlign();
if (this._position === 'center') this.updateDestinationCenterAlign();
if (this._position === 'right') this.updateDestinationRightAlign();
if (this._direction === 'left') this.updateDestinationGoingLeft();
if (this._direction === 'right') this.updateDestinationGoingRight();
};

Code:
Window_CTBIcon.prototype.updateDestinationGoingLeft = function(index) {
    var index = BattleManager.ctbTurnOrder().indexOf(this._battler);
    if (index < 0) index = BattleManager.ctbTurnOrder().length + 5;
    var constant = this.destinationXConstant();
    this._destinationX += index * constant;
    if (index !== 0) {
      this._destinationX += constant / 2;
    }
};

Window_CTBIcon.prototype.updateDestinationGoingRight = function(index) {
    var index = BattleManager.ctbTurnOrder().reverse().indexOf(this._battler);
    if (index < 0) index = -5;
    var constant = this.destinationXConstant();
    this._destinationX += index * constant;
    if (index === BattleManager.ctbTurnOrder().length - 1) {
      this._destinationX += constant / 2;
    }
};

Code:
Window_CTBIcon.prototype.destinationY = function() {
    var value = Yanfly.Param.CTBTurnPosY - this.standardPadding();
    var scene = SceneManager._scene;
    if (scene && scene._helpWindow.visible) {
        value = Math.max(value, scene._helpWindow.height);
    }
    if (!this._battler) return value;
    if (this._battler.isSelected()) {
        value -= this.contents.height / 4;
    }
    return value;
};

Window_CTBIcon.prototype.updatePositionY = function() {
    if (BattleManager._escaped) return;
    if (this._destinationX !== this.x) {
      var desX = this._destinationX;
      var cap1 = this.destinationY() - this.contents.height / 2;
      var cap2 = this.destinationY() + this.contents.height / 2;
      var moveAmount = Math.max(1, Math.abs(cap2 - this.y) / 4);
      if (this.x > desX) this.y = Math.max(this.y - moveAmount, cap1);
      if (this.x < desX) this.y = Math.min(this.y + moveAmount, cap2);
    } else if (this.destinationY() !== this.y) {
      var desY = this.destinationY();
      var moveAmount = Math.max(1, Math.abs(desY - this.y) / 4);
      if (this.y > desY) this.y = Math.max(this.y - moveAmount, desY);
      if (this.y < desY) this.y = Math.min(this.y + moveAmount, desY);
    }
};

So anyone interested(right now I'm extremely tired) can jump straight into the core of the request 🙂
Thank you 🙂 It would be really awesome if someone could find a feasible way of adapting the code to make the bar vertical instead of horizontal.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-charge-turn-battle-system-ctb-vertical-turn-order.66370/