YEP Item Core - "Skip" Use-Scene

Discussion in 'Javascript/Plugin Support' started by Zinnherz, Jun 13, 2019.

  1. Zinnherz

    Zinnherz Villager Member

    Messages:
    17
    Likes Received:
    2
    First Language:
    German
    Primarily Uses:
    RMMV
    Hey guys,

    I'm using Yanfly's Item Core and it's great so far. However, I noticed that whenever I want to use an item, it opens a new window asking me if I want to use it - basically making the player confirm the action.
    I know that this is for actions like strengthening items or whatnot, but I don't use that feature in my project, so I was wondering if it's possible for me to basically "skip" the use-window and go to the character selection immediately.

    I could be wrong about this, but I think it has to do with this snippet from the plugin;
    Code:
    //=============================================================================
    // Window_ItemActionCommand
    //=============================================================================
    
    function Window_ItemActionCommand() {
        this.initialize.apply(this, arguments);
    }
    
    Window_ItemActionCommand.prototype = Object.create(Window_Command.prototype);
    Window_ItemActionCommand.prototype.constructor = Window_ItemActionCommand;
    
    Window_ItemActionCommand.prototype.initialize = function(x, y) {
        this._windowHeight = Graphics.boxHeight - y;
        Window_Command.prototype.initialize.call(this, x, y);
        this._item = null;
        this.hide();
        this.deactivate();
    };
    
    Window_ItemActionCommand.prototype.windowWidth = function() {
        return Graphics.boxWidth / 2;
    };
    
    Window_ItemActionCommand.prototype.update = function() {
      Window_Command.prototype.update.call(this);
    };
    
    Window_ItemActionCommand.prototype.setItem = function(item) {
        this._item = item;
        this.refresh();
        this.show();
        this.activate();
        this.select(0);
    };
    
    Window_ItemActionCommand.prototype.windowHeight = function() {
        return this._windowHeight;
    };
    
    Window_ItemActionCommand.prototype.makeCommandList = function() {
        if (!this._item) return;
        this.addUseCommand();
        this.addCustomCommandsA();
        this.addCustomCommandsB();
        this.addCustomCommandsC();
        this.addCustomCommandsD();
        this.addCustomCommandsE();
        this.addCustomCommandsF();
        this.addCancelCommand();
    };
    
    Window_ItemActionCommand.prototype.addUseCommand = function() {
        var enabled = this.isEnabled(this._item);
        var fmt = Yanfly.Param.ItemUseCmd;
        text = '\\i[' + this._item.iconIndex + ']';
        if (this._item.textColor !== undefined) {
          text += '\\c[' + this._item.textColor + ']';
        }
        text += this._item.name;
        text = fmt.format(text);
        this.addCommand(text, 'use', enabled);
    };
    
    Window_ItemActionCommand.prototype.isEnabled = function(item) {
        if (!item) return false;
        return $gameParty.canUse(item);
    };
    
    Window_ItemActionCommand.prototype.addCustomCommandsA = function() {
    };
    
    Window_ItemActionCommand.prototype.addCustomCommandsB = function() {
    };
    
    Window_ItemActionCommand.prototype.addCustomCommandsC = function() {
    };
    
    Window_ItemActionCommand.prototype.addCustomCommandsD = function() {
    };
    
    Window_ItemActionCommand.prototype.addCustomCommandsE = function() {
    };
    
    Window_ItemActionCommand.prototype.addCustomCommandsF = function() {
    };
    
    Window_ItemActionCommand.prototype.addCancelCommand = function() {
        this.addCommand(TextManager.cancel, 'cancel');
    };
    
    Window_ItemActionCommand.prototype.drawItem = function(index) {
        var rect = this.itemRectForText(index);
        var align = this.itemTextAlign();
        this.resetTextColor();
        this.changePaintOpacity(this.isCommandEnabled(index));
        this.drawTextEx(this.commandName(index), rect.x, rect.y);
    };

    Any form of advice or fix would be greatly appreciated.
    Thanks in advance! :)
     
    #1
  2. SimProse

    SimProse Veteran Veteran

    Messages:
    363
    Likes Received:
    197
    Location:
    United States
    First Language:
    English
    I do the same in all my games; no need to confirm every time a player uses something. Saves clicks/button presses for sure.

    I use this version of Yanfly's Item Core (it's 1.26) and I have it fixed so that the extra confirmation thing has been eliminated. Hope it helps you!
    https://www.dropbox.com/s/ujygf0x9028y93e/YEP_ItemCore.js?dl=0
     
    #2
    Zinnherz likes this.
  3. Zinnherz

    Zinnherz Villager Member

    Messages:
    17
    Likes Received:
    2
    First Language:
    German
    Primarily Uses:
    RMMV
    Oh, this really does get rid of the "item confirmation", thank you.
    However, I noticed that the game still opens that window when checking armors/weapons.
    Does anyone have a fix for that as well?
     
    #3

Share This Page