关于装备中物品栏的显示

在 MZ 的默认设定下

装备品一旦装备,应该会从物品的装备栏消失,并移至装备管理画面。

例如,如果持有 1 把【短剑】,在未装备的状态下,物品栏的武器项目中会显示【短剑】;但如果将其装备给某个角色,物品栏武器项目中的这把【短剑】显示就会消失。

我正在寻找一种方法,即使在角色装备着【短剑】时,也能让物品栏的武器项目中继续显示这把已装备的【短剑】。(类似现有游戏中显示的【E:短剑】那种样式。)

如果默认功能或现有插件已经能实现,那很抱歉打扰了,但希望能告知具体方法,包括这种情况。谢谢。

据我所知,MZ 仅根据队伍当前持有的物品构建物品列表,因此一旦武器被装备,它就不再包含在该列表中。我找不到能完全实现此功能的插件,于是我自己编写了一个小插件。请将其保存为 js/plugins 文件夹中的 ShowEquippedItems.js,并在插件管理器中启用它:

/*:
 * @target MZ
 * @plugindesc Shows equipped weapons and armor in the Item menu with an E: mark.
 */
(() => {
    const mark = "E:";

    const _createItemWindow = Scene_Item.prototype.createItemWindow;
    Scene_Item.prototype.createItemWindow = function() {
        _createItemWindow.call(this);
        this._itemWindow._showEquips = true;
        this._itemWindow.refresh();
    };

    const _makeItemList = Window_ItemList.prototype.makeItemList;
    Window_ItemList.prototype.makeItemList = function() {
        _makeItemList.call(this);
        this._equipCount = 0;
        if (this._showEquips) {
            const equips = $gameParty.members()
                .flatMap(actor => actor.equips())
                .filter(item => item && this.includes(item));
            this._equipCount = equips.length;
            this._data = equips.concat(this._data);
        }
    };

    const _drawItem = Window_ItemList.prototype.drawItem;
    Window_ItemList.prototype.drawItem = function(index) {
        if (index < this._equipCount) {
            const item = this.itemAt(index);
            const rect = this.itemLineRect(index);
            const markWidth = this.textWidth(mark);
            this.changePaintOpacity(this.isEnabled(item));
            this.resetTextColor();
            this.drawText(mark, rect.x, rect.y, markWidth);
            this.drawItemName(item, rect.x + markWidth, rect.y, rect.width - markWidth);
            this.changePaintOpacity(1);
        } else {
            _drawItem.call(this, index);
        }
    };
})();

装备中的装备会显示在“武器”和“防具”标签页的顶部,格式为 E:ショートソード,且不显示数量;而未装备的物品仍会像往常一样显示在其下方并带有数量。该插件仅影响物品菜单,因此商店的出售列表和装备界面保持不变。如果你想使用不同的标记,只需修改 mark 那一行中的“E:”即可。

如果你已经在使用会修改物品菜单的插件,例如 VisuStella 的 Items and Equips Core,我不确定这些插件是否能良好兼容,所以建议你先在一个全新的项目中进行测试。

谢谢您的回复。
我尝试了您制作的插件,
结果发现,即使在装备状态下,
所装备的武器和防具都能正确显示在物品栏的装备栏中。

我查阅了很多资料都没能解决,所以真的帮了大忙。
非常感谢。