I have this code which should draw some enemies grayed out in the target selection menu, but for some reason it doesn't do anything, even though the paint opacity is clearly still 160 when it reaches the draw text call. Any idea what I'm missing here?
(In case you're wondering, the use-case for this is an "invisible" state.)
JavaScript:
Window_BattleEnemy.prototype.isCurrentItemEnabled = function() {
var canTarget = true, enemy = this.enemy();
if(enemy) canTarget = enemy.tgr > 0;
return canTarget && Window_Selectable.prototype.isCurrentItemEnabled.call(this);
};
const old_drawEnemyItem = Window_BattleEnemy.prototype.drawItem;
Window_BattleEnemy.prototype.drawItem = function(index) {
this.changePaintOpacity(this.isCurrentItemEnabled());
old_drawEnemyItem.call(this, index);
this.changePaintOpacity();
};
(In case you're wondering, the use-case for this is an "invisible" state.)