大家好!我是第一次发帖,之前一直是潜水党(如果算上旧论坛的话)。
我一直在使用 Visustella 的核心插件,非常喜欢它们,但商店和装备商店部分给我的麻烦比其他任何插件都多。所以以下是我遇到的一些问题要点:
- 我有 4 个额外的自定义参数。只有使用“比较”数据样式时,它们才会显示。
- 这很酷!对吧?但现在的问题是,它只显示当前战斗成员。但这没什么用,因为我最终会有许多可玩角色。
- 理想情况下,我希望它只显示可玩角色/队伍成员(无论他们是否在战斗队伍中),并且这些角色必须能够使用所选的武器类型,同时将显示的最大角色数量扩展到 5 或 6 人
我猜测这与 “actor.canEquip(this._item)” 有关,但我对此完全一头雾水!
以下是 JS 中未编辑的代码:绘制装备数据
// 设置变量
const lineHeight = this.lineHeight();
const paramheight = this.gaugeLineHeight() + 8;
let x = 0;
let y = 0;
let width = this.innerWidth;
let height = this.innerHeight;
let hw = Math.floor(width / 2);
let hx = x + width - hw;
// 绘制物品名称、类型和数量
this.drawItemName(this._item, x + this.itemPadding(), y, width - this.itemPadding() * 2);
this.drawItemDarkRect(x, y, width);
y += lineHeight;
if (this.drawItemEquipType(x, y, hw)) y += 0;
if (this.drawItemQuantity(hx, y, hw)) y += lineHeight;
// 绘制参数名称
const params = this.actorParams();
const backY = y;
y = height - (params.length * paramheight) - 4;
let paramX = x;
let paramWidth = 0;
let tableY = y;
for (const paramId of params) {
paramWidth = Math.max(this.drawParamName(paramId, x + 4, y + 4, width), paramWidth);
y += paramheight;
}
// 绘制角色数据
const actorMax = $gameParty.maxBattleMembers();
const actorWidth = Math.floor((width - paramWidth) / actorMax);
paramWidth = width - (actorWidth * actorMax);
for (const actor of $gameParty.battleMembers()) {
const index = $gameParty.battleMembers().indexOf(actor);
const actorX = paramX + paramWidth + (index * actorWidth);
this.changePaintOpacity(actor.canEquip(this._item));
this.drawActorCharacter(actor, actorX + (actorWidth / 2), tableY);
let actorY = tableY;
// 绘制参数变化
for (const paramId of params) {
const diffY = actorY - ((lineHeight - paramheight) / 2);
this.drawActorParamDifference(actor, paramId, actorX, diffY, actorWidth);
actorY += paramheight;
}
}
// 绘制背景矩形
this.drawItemDarkRect(paramX, backY, paramWidth, tableY - backY);
for (let i = 0; i < actorMax; i++) {
const actorX = paramX + paramWidth + (i * actorWidth);
this.drawItemDarkRect(actorX, backY, actorWidth, tableY - backY);
}
for (const paramId of params) {
this.drawItemDarkRect(paramX, tableY, paramWidth, paramheight);
for (let i = 0; i < actorMax; i++) {
const actorX = paramX + paramWidth + (i * actorWidth);
this.drawItemDarkRect(actorX, tableY, actorWidth, paramheight);
}
tableY += paramheight;
}
如果有人能提供建议或相关知识,我将不胜感激!非常感谢您的时间。


