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

vegetamaker

Warper
Member
Joined
Jul 9, 2018
Messages
3
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
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.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
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();
};
 

vegetamaker

Warper
Member
Joined
Jul 9, 2018
Messages
3
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
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!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top