MV/MZ [SOLVED] Edit a little bit Synrec's Item Discard Plugin..

Hello! how's everyone? i hope good!
So i need some help.. i want to use this plugin (Synrec's Item Discard)
but when i click on empty space i don't want the menu to pop up..
1.png

can someone fix this? thanks! 😀
I kinda disable the entire selection on my own,
but you can try to alter the start here as it does check
item in possession.

Code:
//change in start
this._maxItemCount = $gameParty.numItems(item);

//to
this._maxItemCount = $gameParty.numItems(item) > 0;

//or

this._maxItemCount = $gameParty.numItems(item)>= 1;

see if that works.
Wow that was a fast reply!
pls forgive my slow brain, where do i place this code?
i save it as seperate plugin or i edit the main plugin placing it somewhere? 🙂 thanks!
In my opinion, the author did a mistake in this code section:

Code:
Scene_Item.prototype.modifyItemWindow = function(){
    this._itemWindow.isCurrentItemEnabled = function(){
        return true;
    }
}
This code means that you can open the menu on every item (which is correct), but ALSO when the item that you are clicking is blank (which is not correct, obviously).

Try replacing this section with this:
Code:
Scene_Item.prototype.modifyItemWindow = function(){
    this._itemWindow.isCurrentItemEnabled = function(){
        return !!this.item();
    }
}
Works like a charm! Thanks both of you!! 😀
I didn't know that, but you might be able to change this one too.
JavaScript:
Window_DiscardCount.prototype.isCancelEnabled = function() {
    return true;
}

//to (if working

Window_DiscardCount.prototype.isCancelEnabled = function() {
    if (this.item()?.meta["avoid"]) return false
    return true;
})

you can change "avoid" to avoid being discard if the item has any.
else, return true as if doesn't has any.

but unsure if that one works though as I use my own section.
if there is a code to lock selection of the category to even select
non-item, it would be even better and cleaner that way I have.

no items in the category in my case give a buzzer sound.
so if the above work, you can forbid player to discard certain items
outside key items =)
Hello, can i have another request? When i use the "no discard tag"
it leaves an empty spot on the menu that i don't want to be visible..
Can someone edit it so when the item has the "no discard" tag there will be no empty spot
on the selection menu? Thanks!!

1.png
Unfortunately, changing the window's height dynamically depending on the number of commands is a bit tricky. It's probably easier when "Discard" is always shown, but as a disabled command.

I also corrected a few other issues that appeared incorrect to me.
It's awesome! Thank you!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-edit-a-little-bit-synrecs-item-discard-plugin.179293/