For my current project I'm removing default battle windows and editing BattleSkills and BattleItems windows, and I've encountered strange and yet simple problem I cannot solve. Take a look at this piece of code:
As you can see, the sole purpose of this snippet is to add _battleShow variable, which I could use in defining conditions of displaying certain HUD objects in battle, the problem is, method isVisible keeps returning undefined result, but when I open skill list in battle and hide it, value is set to false as should be, but when I open skill list again, and check the result, _battleShow keeps false result, I didn't code anything in JS for 4 months, so I might forget something, and any help or guide would be helpful.
JavaScript:
var alias_init = Window_BattleSkill.prototype.initialize;
Window_BattleSkill.prototype.initialize = function(x, y, width, height){
alias_init.call(this, x, y, width, height);
this._battleShow = false;
};
var alias_show = Window_BattleSkill.prototype.show;
Window_BattleSkill.prototype.show = function(){
alias_show.call(this);
this._battleShow = true;
};
var alias_hide = Window_BattleSkill.prototype.hide;
Window_BattleSkill.prototype.hide = function(){
alias_hide.call(this);
this._battleShow = false;
};
Window_BattleSkill.prototype.isVisible = function(){
return this._battleShow;
};
As you can see, the sole purpose of this snippet is to add _battleShow variable, which I could use in defining conditions of displaying certain HUD objects in battle, the problem is, method isVisible keeps returning undefined result, but when I open skill list in battle and hide it, value is set to false as should be, but when I open skill list again, and check the result, _battleShow keeps false result, I didn't code anything in JS for 4 months, so I might forget something, and any help or guide would be helpful.