Advertisement
Guest User

IsiahCGCEndButtonIndexFix

a guest
Aug 12th, 2022
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Window_SkillList.prototype.endTurnIndex = function ()
  2. {
  3.     return 0;
  4. };
  5.  
  6. Window_SkillList.prototype.itemButtonIndex = function ()
  7. {
  8.     return 1;
  9. };
  10.  
  11. Window_SkillList.prototype.makeItemList = function ()
  12. {
  13.     if (!$gameSystem._cardBattleEnabled)
  14.     {
  15.         Isiah.CGC.Window_SkillList_makeItemList.call(this);
  16.         return;
  17.     }
  18.     this._data = [];
  19.     this._itemsBeforeCards = 0;
  20.     var isBattle = SceneManager._scene instanceof Scene_Battle;
  21.     var cards = isBattle ? this._cardSprites.getCards() : this._cardSprites;
  22.     if (cards)
  23.     {
  24.         for (var i = 0; i < cards.length; i++)
  25.         {
  26.             this._data[i] = cards[i]._skill;
  27.             if (this.isEnabled(this._data[i]))
  28.                 cards[i]._enabledSprite.show();
  29.             else
  30.                 cards[i]._enabledSprite.hide();
  31.         }
  32.  
  33.         if (isBattle)
  34.         {
  35.             if (Isiah.CGC.showItemButton)
  36.             {
  37.                 this._data.unshift('itemMenu');
  38.                 this._itemsBeforeCards++;
  39.                 this._itemButton.setIndex(this.itemButtonIndex());
  40.             }
  41.             if (Isiah.CGC.showEndTurn)
  42.             {
  43.                 this._data.unshift($dataSkills[Isiah.CGC.endTurnSkill]);
  44.                 this._itemsBeforeCards++;
  45.                 this._endTurnButton.setIndex(this.endTurnIndex());
  46.             }
  47.         }
  48.     }
  49. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement