MV Prompt before equip

I'm looking for a plugin that will ask the player a question when they click an item to equip.
This will only be for cursed items, and I don't want to ask this question for all items. So I guess i'll need a note tag for the item. <Cursed>

I want them to be asked:
Are you sure you want to equip this item?

with the option of:
Yes | NO

If yes the item is equipped, if No nothing happens and the item remain unequipped.
Bump
Bump
Bump
[bump]@Fonixed[/bump]
Unfortunately I don't know how to open another window on top of the equip weapon screen so I could only write this much. This will open a textbox saying "Your weapon is cursed." after you equip an item with a the notetag <cursed> and close the equip menu. Maybe you or someone else can finish it.

Game_Actor.prototype.changeEquip = function(slotId, item) {
if (this.tradeItemWithParty(item, this.equips()[slotId]) &&
(!item || this.equipSlots()[slotId] === item.etypeId)) {
if (item.meta.cursed){
$gameMessage.add("Your weapon is cursed.")
}
this._equips[slotId].setObject(item);
this.refresh();
}
};

Inside the if (item.meta.cursed){} curly braces, you would have to write something like
open choice menu (yes, no);
if (yes){
this._equips[slotId].setObject(item);
this.refresh();
}
I think I've got it but it has taken me far too long I need to get better.

Capture.JPG
Capture2.JPG

I'm going to move the command list to the bottom right and put is side by side with the grid, and make the grid 1x5
Glad you figured it out. It would be helpful for any lurkers or Google searchers if you shared what you did in case anyone wants to implement something similar.
Glad you figured it out. It would be helpful for any lurkers or Google searchers if you shared what you did in case anyone wants to implement something similar.
Spoiler: Code
JavaScript:
(function() {
    var _Scene_Equip_createItemWindow = Scene_Equip.prototype.createItemWindow;
    Scene_Equip.prototype.createItemWindow = function() {
    _Scene_Equip_createItemWindow.call(this);
    this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
    };
    //Cursed meta
    var _Scene_Equip_onItemOk = Scene_Equip.prototype.onItemOk;
    Scene_Equip.prototype.onItemOk = function() {
        var item = this._itemWindow.item();
        if (item && item.meta.Cursed) {
            this.createConfirmWindow(item);
            this.createConfirmMessageWindow(item);
            this.toggleItemDescriptionWindow(false);
        } else {
            _Scene_Equip_onItemOk.call(this);
        }

    };
//----------------------------------------------------------
    //This is the conformation window for the cursed item Yes | No.
    Scene_Equip.prototype.createConfirmWindow = function() {
        // Create a semi-transparent black background
        this._confirmWindowBackground = new Sprite(new Bitmap(Graphics.width, Graphics.height));
        this._confirmWindowBackground.bitmap.fillRect(0, 0, Graphics.width, Graphics.height, '#000000');
        this._confirmWindowBackground.opacity = 200;
        this.addChild(this._confirmWindowBackground);
        
        // Create the confirm window
        this._confirmWindow = new Window_Confirm();
        this._confirmWindow.setHandler('ok', this.onConfirmOk.bind(this));
        this._confirmWindow.setHandler('cancel', this.onConfirmCancel.bind(this));
        this.addChild(this._confirmWindow);
    };
    
    //This is the conformation message window for the cursed item that asks a question.
    Scene_Equip.prototype.createConfirmMessageWindow = function(item) {
        // Create the confirm message window
        this._confirmMessageWindow = new Window_ConfirmMessage(item);
        this.addChild(this._confirmMessageWindow);
    };
    
    Scene_Equip.prototype.onConfirmOk = function() {
        _Scene_Equip_onItemOk.call(this);
        this.removeChild(this._confirmWindow);
        this._confirmWindow = null;
        this.removeChild(this._confirmMessageWindow);
        this._confirmMessageWindow = null;
        this.removeChild(this._confirmWindowBackground);
        this.toggleItemDescriptionWindow(true);
    };

    Scene_Equip.prototype.onConfirmCancel = function() {
        this._itemWindow.activate();
        this.removeChild(this._confirmWindow);
        this._confirmWindow = null;
        this.removeChild(this._confirmMessageWindow);
        this._confirmMessageWindow = null;
        this.removeChild(this._confirmWindowBackground);
        this.toggleItemDescriptionWindow(true);
    };
    
    Scene_Equip.prototype.toggleItemDescriptionWindow = function(visible) {
        this._itemWindow._helpWindow.visible = visible;
    };
//------------------------------------------------------------------------
    function Window_Confirm(item) {
        this.initialize.apply(this, arguments);
    }

    Window_Confirm.prototype = Object.create(Window_Command.prototype);
    Window_Confirm.prototype.constructor = Window_Confirm;

    Window_Confirm.prototype.initialize = function() {
    Window_Command.prototype.initialize.call(this, 0, 0);
        this.updatePlacement();
        this.select(0);
        this.open();
    };

    Window_Confirm.prototype.windowWidth = function() {
        return Graphics.boxWidth / 2;
    };
    
    Window_Confirm.prototype.numVisibleRows = function() {
        return 2;
    };
    
    Window_Confirm.prototype.windowHeight = function() {
        return this.fittingHeight(this.numVisibleRows() + 3) + 11;
    };

    Window_Confirm.prototype.makeCommandList = function() {
        this.addCommand('Yes', 'ok');
        this.addCommand('No', 'cancel');
    };

    Window_Confirm.prototype.itemTextAlign = function() {
        return 'center'; // Center the command text
    };

    Window_Confirm.prototype.updatePlacement = function() {
        this.width = this.windowWidth();
        this.height = this.windowHeight();
        this.x = (Graphics.boxWidth - this.width);
        this.y = (Graphics.boxHeight - this.height);
    };

    Window_Confirm.prototype.itemRect = function(index) {
        var rect = Window_Command.prototype.itemRect.call(this, index);
        rect.x = (this.contentsWidth() / 2) - 120;
        rect.y = (this.contentsHeight() - this.lineHeight() * 3 + 22) / 2 + index * this.lineHeight();
        rect.width = 240;
        return rect;
    };
//------------------------------------------------------------------------
    function Window_ConfirmMessage(item) {
        this._item = item;
        this.initialize.apply(this, arguments);
    }

    Window_ConfirmMessage.prototype = Object.create(Window_Base.prototype);
    Window_ConfirmMessage.prototype.constructor = Window_ConfirmMessage;

    Window_ConfirmMessage.prototype.initialize = function() {
        var x = 0;
        var y = 0;
        var width = Graphics.boxWidth;
        var height = this.fittingHeight(2);
        Window_Base.prototype.initialize.call(this, x, y, width, height);
        this.refresh();
    };

    Window_ConfirmMessage.prototype.refresh = function() {
        this.contents.clear();
        var text = "Are you sure you want to equip " + this._item.name + "?\nIt's a cursed item!";
        this.drawTextEx(text, 0, 0);
    };  
})();

I still need to figure out how to change the grid and size of Window_EquipItem (I think it's that window). I might just just use hud maker and do it that way.

If anyone wants to use it you need to put <Cursed> in the note area of the Item that you are going to equip.


Capture.JPG

Original thread: https://forums.rpgmakerweb.com/threads/prompt-before-equip.156879/