BACKGROUND
I'm a heavy user of Yanfly's Engine Plugin (YEP). And I'm also not a fan of stretched out message & windows when RPG Maker game is forced to extend into a higher resolution than 816 x 624 px. It made my eyes tired and mad, scanning written things from left to right of my 60 cm screen each time I'm trying to read and input action.
So I'm trying to develop a simple extension plugin for YEP Battle Engine Core, which reposition all in-battle windows to the center of the screen, regardless of resolution being used, as well as attempting on reducing possible plugin conflict.
PROGRESS
Almost all things worked well as intended. Here's the screenshot:
I even be able to move and resize the battler name window, which are a modified version of Help Window (Still messed up but yeah, it worked):
PROBLEM
The battler name window is not working when used for self-targeting skill. Here Harold is about to use Combat Focus skill, which increase his own defense. The target of the skill is only Harold himself. Notice that the "battler name", here written as "self", is missing in the plugged-in version, although the battler name help window is successfully made:
This problem also arise when ally-targeting skill such as "Heal One Ally" or "Heal Everyone" is used.
CODE
The problematic code I used for the battler name window is taken from YEP Battle Engine Core after slight adjustment. I highlighted he problematic part in bold. Everything else is working.
The full code in development is attached. Note that it disable the default Attack and Guard options, too.
Any workaround for this problem? Any help will be appreciated
I'm a heavy user of Yanfly's Engine Plugin (YEP). And I'm also not a fan of stretched out message & windows when RPG Maker game is forced to extend into a higher resolution than 816 x 624 px. It made my eyes tired and mad, scanning written things from left to right of my 60 cm screen each time I'm trying to read and input action.
So I'm trying to develop a simple extension plugin for YEP Battle Engine Core, which reposition all in-battle windows to the center of the screen, regardless of resolution being used, as well as attempting on reducing possible plugin conflict.
PROGRESS
Almost all things worked well as intended. Here's the screenshot:
I even be able to move and resize the battler name window, which are a modified version of Help Window (Still messed up but yeah, it worked):
PROBLEM
The battler name window is not working when used for self-targeting skill. Here Harold is about to use Combat Focus skill, which increase his own defense. The target of the skill is only Harold himself. Notice that the "battler name", here written as "self", is missing in the plugged-in version, although the battler name help window is successfully made:
This problem also arise when ally-targeting skill such as "Heal One Ally" or "Heal Everyone" is used.
CODE
The problematic code I used for the battler name window is taken from YEP Battle Engine Core after slight adjustment. I highlighted he problematic part in bold. Everything else is working.
Window_Help.prototype.clear = function() {
Raith.Window_Help_clear.call(this);
this.contents.clear();
if (SceneManager._scene instanceof Scene_Battle) {
this.width = 529;
this.height = 92;
this.x = (Graphics.boxWidth - 816) / 2;
this.y = Graphics.boxHeight - this.height - 180
}
};
Window_Help.prototype.drawBattler = function(battler) {
var text = battler.name();
var textWidth = 256;
this.width = textWidth;
var wx = -18; //18 is the text padding
var wy = (this.contents.height - this.lineHeight()) / 2;
this.drawText(text, wx, wy, textWidth, 'center');
};
Window_Help.prototype.drawSpecialSelectionText = function(action) {
var text = '';
this.width = 256;
var wx = -18;
var wy = (this.contents.height - this.lineHeight()) / 2;
if (action.isForUser()) {text = Yanfly.Param.BECHelpUserTx;
} else if (action.isForRandom()) {
BattleManager.startAllSelection();
var fmt = Yanfly.Param.BECHelpRandTx;
if (action.isForOpponent() && action.numTargets() !== 1) {
var target = Yanfly.Param.BECHelpEnemiesTx;
} else if (action.isForOpponent() && action.numTargets() === 1) {
var target = Yanfly.Param.BECHelpEnemyTx;
} else if (action.isForFriend() && action.numTargets() !== 1) {
var target = Yanfly.Param.BECHelpAlliesTx;
} else {
var target = Yanfly.Param.BECHelpAllyTx;
}
text = fmt.format(target, Yanfly.Util.toGroup(action.numTargets()));
} else if (action.isForAll()) {
BattleManager.startAllSelection();
var fmt = Yanfly.Param.BECHelpAllTx;
if (action.isForOpponent()) {
var target = Yanfly.Param.BECHelpEnemiesTx;
} else {
var target = Yanfly.Param.BECHelpAlliesTx;
}
text = fmt.format(target);
}
this.drawText(text, wx, wy, 256, 'center');
};
Raith.Window_Help_clear.call(this);
this.contents.clear();
if (SceneManager._scene instanceof Scene_Battle) {
this.width = 529;
this.height = 92;
this.x = (Graphics.boxWidth - 816) / 2;
this.y = Graphics.boxHeight - this.height - 180
}
};
Window_Help.prototype.drawBattler = function(battler) {
var text = battler.name();
var textWidth = 256;
this.width = textWidth;
var wx = -18; //18 is the text padding
var wy = (this.contents.height - this.lineHeight()) / 2;
this.drawText(text, wx, wy, textWidth, 'center');
};
Window_Help.prototype.drawSpecialSelectionText = function(action) {
var text = '';
this.width = 256;
var wx = -18;
var wy = (this.contents.height - this.lineHeight()) / 2;
if (action.isForUser()) {text = Yanfly.Param.BECHelpUserTx;
} else if (action.isForRandom()) {
BattleManager.startAllSelection();
var fmt = Yanfly.Param.BECHelpRandTx;
if (action.isForOpponent() && action.numTargets() !== 1) {
var target = Yanfly.Param.BECHelpEnemiesTx;
} else if (action.isForOpponent() && action.numTargets() === 1) {
var target = Yanfly.Param.BECHelpEnemyTx;
} else if (action.isForFriend() && action.numTargets() !== 1) {
var target = Yanfly.Param.BECHelpAlliesTx;
} else {
var target = Yanfly.Param.BECHelpAllyTx;
}
text = fmt.format(target, Yanfly.Util.toGroup(action.numTargets()));
} else if (action.isForAll()) {
BattleManager.startAllSelection();
var fmt = Yanfly.Param.BECHelpAllTx;
if (action.isForOpponent()) {
var target = Yanfly.Param.BECHelpEnemiesTx;
} else {
var target = Yanfly.Param.BECHelpAlliesTx;
}
text = fmt.format(target);
}
this.drawText(text, wx, wy, 256, 'center');
};
The full code in development is attached. Note that it disable the default Attack and Guard options, too.
Any workaround for this problem? Any help will be appreciated