Hi helpers,
I try to upgrade my BattleMessages plugin, but I stump into a weird confusion how exactly
the TextManager.useItem is called and where it is set up.
the original code for MV is like this (unsure for MZ)
so I alias this code, but the code like the next one
has somewhere called like:
where this "uses" come from and how exactly is set, only the getter, but altering for the item use,
doesn't seem to work in any.
I did so, for the skill without issues, which does it job, the code I use for that part is as follows (if relevant)
this called allias is called inside the displayAction.
so what do I miss, and where do I find the TextManager to make it work too as it always return
subject.name() uses item.name but question, where is that being drawn?
I try to upgrade my BattleMessages plugin, but I stump into a weird confusion how exactly
the TextManager.useItem is called and where it is set up.
the original code for MV is like this (unsure for MZ)
JavaScript:
Window_BattleLog.prototype.displayAction = function(subject, item) {
var numMethods = this._methods.length;
if (DataManager.isSkill(item)) {
if (item.message1) {
this.push('addText', subject.name() + item.message1.format(item.name));
}
if (item.message2) {
this.push('addText', item.message2.format(item.name));
}
} else {
this.push('addText', TextManager.useItem.format(subject.name(), item.name));
}
if (this._methods.length === numMethods) {
this.push('wait');
}
};
so I alias this code, but the code like the next one
JavaScript:
this.push('addText', TextManager.useItem.format(subject.name(), item.name));
has somewhere called like:
subject.name() + " uses " + item.name but I cannot findwhere this "uses" come from and how exactly is set, only the getter, but altering for the item use,
doesn't seem to work in any.
I did so, for the skill without issues, which does it job, the code I use for that part is as follows (if relevant)
JavaScript:
SDJB_Base["BMsg"].processBattleNotetags = function(subject, item) {
if (!item?.note) return;
const msgMatch = item.note.match(/<Custom Battle Text>([\s\S]*)<\/Custom Battle Text>/im);
if (msgMatch) {
let msg1 = "";
let msg2 = "";
const target = item;
const user = subject;
const a = subject;
const s = $gameSwitches._data;
const v = $gameVariables._data;
try {
eval(msgMatch[1]);
target.message1 = msg1;
target.message2 = msg2;
} catch (e) {
console.error("Error in processing custom eval text:", e, target);
}
}
};
this called allias is called inside the displayAction.
so what do I miss, and where do I find the TextManager to make it work too as it always return
subject.name() uses item.name but question, where is that being drawn?