Small modification for Yanfly Item Core (delenting sub-window)

● ARCHIVED · READ-ONLY
Started by vegetamaker 3 posts View original ↗
  1. Hello and thanks for your time. Let me explain what I am looking for. I am using Yanfly Item Core, but it has a feature that I don't like so much.

    When you use an item in game menu it appears a secondary window to confirm the use or cancel. It is there just in case you need add more things to do with them, but it isn't my case. So... it becomes really unfriendly for the player.

    Thats why I want to delete it and I tried it myself. Let me post what I was trying.

    The first thing I did was localize where the sub-window was creating. I am not complety sure how it works, but I located where the window was created (or called?). In the line 2035.

    After that I tried to localize where the "use" was called, It is in the line 2163.

    So I did a call ( Scene_Item.prototype.onActionUse.call(); ) to the function from 2163 inside 2035. Of course it crashed because, I suppose, it isn't taking the correct parameters in some way.

    I promise I was trying to understand it for many hours, but I must admit that I can't continue alone.

    Link to the plugin: http://yanfly.moe/2015/10/16/yep-11-item-core/

    Again, thanks for your time and sorry for my English.
  2. We might have different versions, because I found the function on a different line. Here's the function that is called when the player first clicks the item:
    Code:
    Scene_Item.prototype.onItemOk = function() {
        var item = this.item();
        this._itemActionWindow.setItem(item);
    };
    Normally, it opens the Window_ItemActionCommand that asks the player to 'use' or 'cancel'.

    Instead, you can just comment out those lines and call 'onActionUse' instead.
    Code:
    Scene_Item.prototype.onItemOk = function() {
        // var item = this.item();
        // this._itemActionWindow.setItem(item);
        this.onActionUse();
    };
  3. Oh my god, worked like a charm!

    We had the same version, but my "knowledge" show me the wrong way ^^.

    I guess I'll try to find a way to check if the items is usable or not (I saw a fuction over there for it). So items will not sound if they are't usable.

    Thanks so much for your time!