Alias the Cancel Functions
const alias_PKonEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
Scene_Battle.prototype.onEnemyCancel = function() {
alias_PKonEnemyCancel.call(this);
$gameParty.select(null);
$gameTroop.select(null);
};
const alias_PKonActorCancel = Scene_Battle.prototype.onActorCancel;
Scene_Battle.prototype.onActorCancel = function() {
alias_PKonActorCancel.call(this);
$gameParty.select(null);
$gameTroop.select(null);
};
const alias_PKonItemCancel = Scene_Battle.prototype.onItemCancel;
Scene_Battle.prototype.onItemCancel = function() {
alias_PKonActorCancel.call(this);
$gameParty.select(null);
$gameTroop.select(null);
};
Oh neat! However, I would suggest a scope change to avoid potential naming conflicts (untested):
edited code
JavaScript:/*:
* @target MZ
* @plugindesc Cae_OnUseEffects + VisuStella Battle Core patch.
* @author Puppet Knight
* @url https://forums.rpgmakerweb.com/posts/1439065/
*/
;void (() => {
const alias_PKonEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
Scene_Battle.prototype.onEnemyCancel = function() {
alias_PKonEnemyCancel.call(this);
$gameParty.select(null);
$gameTroop.select(null);
};
const alias_PKonActorCancel = Scene_Battle.prototype.onActorCancel;
Scene_Battle.prototype.onActorCancel = function() {
alias_PKonActorCancel.call(this);
$gameParty.select(null);
$gameTroop.select(null);
};
const alias_PKonItemCancel = Scene_Battle.prototype.onItemCancel;
Scene_Battle.prototype.onItemCancel = function() {
alias_PKonItemCancel.call(this);
$gameParty.select(null);
$gameTroop.select(null);
};
})();
Otherwise, if that solves the problem, great!
:kaojoy:
[Edit: corrected a typo pointed out by Puppet Knight in the following post.]
I have a question: actually, I only use the "Cae on Use Effects" plugin for the "action Popups" part.
Is there any possibility of greatly simplifying your plugin so that I can only use those functions?
In theory you could go through the code and remove or comment out the unwanted sections, starting at the
// ========== Alterations ========== // comment.
Like, there's a part that is commented
// +Battle popups //: you would want to keep that. But the 2 parts after it are commented
// +Subskills // and
// +Target restrictions //: you could try deleting those (and similar), and hope that doesn't break the popup stuff.
Alternatively:
If not, what I absolutely need is the ability to edit the "Popup Width Mult" and the Popup Font Size.
This may be much easier, especially since those are fixed values. Just need to find the relevant code, which I think is this:
cae_onuseeffects 1.6 excerpt
JavaScript: // Override! Redefine the popup text seen when an action is missed/evaded.
void (() => { // unconditional bcuz multiple shared aspects here
Sprite_Damage.prototype.createMiss = function() {
const txt = $.getMissText();
if (!txt) return;
const h = this.fontSize();
const w = Math.floor(h * $.popups.widthMult);
const sprite = this.createChildSprite(w, h);
sprite.bitmap.drawText(txt, 0, 0, w, h, "center");
sprite.dy = 0;
};
})();
// Override! Change battle popup font size.
void (() => { if (!$.popups.fontSize) return;
Sprite_Damage.prototype.fontSize = function() { return $.popups.fontSize; };
})();
Reformatted to remove dependence on other parts of the plugin (untested):
independent plugin code
JavaScript:/*:
* @target MZ
* @plugindesc Change battle popup font size.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/index.php?threads/125657/
* @help Reformatted snippet from Cae_OnUseEffects.
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Terms of use:
* This plugin is free to use and/or modify, under these conditions:
* - None of the original plugin header is removed.
* - Credit is given to Caethyril for the original work.
*/
// Override! Apply width multiplier for "miss" popup.
Sprite_Damage.prototype.createMiss = function() {
const txt = "Miss"
if (!txt) return;
const h = this.fontSize();
const w = Math.floor(h * 6); // apply mult
const sprite = this.createChildSprite(w, h);
sprite.bitmap.drawText(txt, 0, 0, w, h, "center");
sprite.dy = 0;
};
// Override! Change battle popup font size.
Sprite_Damage.prototype.fontSize = function() { return 30; };
(Note that setting the
Popup Font Size parameter to
0 causes it to skip that patch, so according to your screenshot you're not actually using that feature.)