Hello there,
I have a quite advanced js question:
I'm currently trying to fix the big slowdown that happens when I am navigating the skills/items windows in battle and there are a lot of options to choose from (at least enough to make the 8 spaces available not enough to display everything, see the linked video to see the slowdown in action).
I think I have found the cause of it: in YEP_BattleStatusWindow line 251 there is code added when an action is cleared or its skill/item/itemobject is set.
This code causes the subject to refresh itself, which means the game has to recompute a lot of stuff needed for other plugins, in particular the target selection for YEP_X_SelectionControl. All of that adds up to cause a noticeable slowdown.
Making a refresh just for that seems quite excessive, I was thinking about replacing those 4 refresh by the following code:
This modification indeed gets rid of the slowdown, but I am a bit worrying concerning potential unwanted side-effects.
Do you see any reason why a refresh is absolutely necessary rather than a simpler battleStatusWindowRefresh?
I have a quite advanced js question:
I'm currently trying to fix the big slowdown that happens when I am navigating the skills/items windows in battle and there are a lot of options to choose from (at least enough to make the 8 spaces available not enough to display everything, see the linked video to see the slowdown in action).
I think I have found the cause of it: in YEP_BattleStatusWindow line 251 there is code added when an action is cleared or its skill/item/itemobject is set.
JavaScript:
//=============================================================================
// Game_Battler
//=============================================================================
Yanfly.BSW.Game_Action_clear = Game_Action.prototype.clear;
Game_Action.prototype.clear = function() {
Yanfly.BSW.Game_Action_clear.call(this);
this.subject().refresh();
};
Yanfly.BSW.Game_Action_setSkill = Game_Action.prototype.setSkill;
Game_Action.prototype.setSkill = function(skillId) {
Yanfly.BSW.Game_Action_setSkill.call(this, skillId);
this.subject().refresh();
};
Yanfly.BSW.Game_Action_setItem = Game_Action.prototype.setItem;
Game_Action.prototype.setItem = function(itemId) {
Yanfly.BSW.Game_Action_setItem.call(this, itemId);
this.subject().refresh();
};
Yanfly.BSW.Game_Action_setItemObject = Game_Action.prototype.setItemObject;
Game_Action.prototype.setItemObject = function(object) {
Yanfly.BSW.Game_Action_setItemObject.call(this, object);
this.subject().refresh();
};
This code causes the subject to refresh itself, which means the game has to recompute a lot of stuff needed for other plugins, in particular the target selection for YEP_X_SelectionControl. All of that adds up to cause a noticeable slowdown.
Making a refresh just for that seems quite excessive, I was thinking about replacing those 4 refresh by the following code:
JavaScript:
if (this.subject().isActor()) {
this.subject().battleStatusWindowRefresh();
}
This modification indeed gets rid of the slowdown, but I am a bit worrying concerning potential unwanted side-effects.
Do you see any reason why a refresh is absolutely necessary rather than a simpler battleStatusWindowRefresh?