MV Menu Filters (currently Item Menu only)

Introduction:
I guess if you have ever played a game with a large inventory (for example any Yu-Gi-Oh game or an Atelier game) I guess you were always grateful for these games to have some kind of filter option, so you could find the item you were searching for more easily.
RPG Maker MV does not provide this option by default, so let's add it.
The plugin is not particularly easy to use and requires some Javascript and Engine knowlegde, but I will be glad to help in implementing your required filters.

Terms of Use:
  1. This plugin may be used and redistributed with both free and commercial games.
  2. This plugin may be redistributed only for free otherwise, but I would appreciate linking back to the original thread instead.
  3. You may take code from this plugin for your own free plugins, but not for commercial plugins.
  4. You may alter this plugin, but BurningOrca has still to be mentioned in the author section. You may not rename this plugin. You may redistribute the alterations for free.
  5. You may port this plugin to MZ.
Features:
The plugin basically adds the following pop-up window, which can be activated by a certain button press on the keyboard or gamepad to the Item Menu while the Item Window is active:
1721194892698.png

Everything about this window can be adjusted in plugin parameters. The screenshot shows the default settings for this window.
So let's go over them:

Filters Pop-Up Window Properties:
1721195006387.png

Defines the width and the number of filter group rows shown at the same time in the window. However still more filter groups can be defined.

Headline and Colors:
1721195198769.png

Next up we have the head line text for the filter window and some colors.
The first color is for the headline.
The next color is for the filter group names. (The blue one shown in the screen shot above).
The next one this for the "Apply filters" and "Reset filters" commands.

Some terms:
1721195338079.png

Here you can adjust how the None option in the filter groups is called and how the Apply and Reset commands are called.

Filter Status Text:
1721195413561.png

You can adjust how many pixels of space the status text of each filter group takes up.

The filter groups:
Each group is a row on the filter window and here is where the javascript comes into play as the logic of the filters has to be defined in the plugin parameters:
1721195615100.png

Each group consists of:
  • A name
  • A help text for the item menu help window, to further describe the filters functionality
  • A Group Logic, which is javascript code that is valid for every single option within the filter.
  • And the following three fields which all exclude each other:
    1. Javascript Options: Allows to enter either a new array containing all the available options or the name of an existing array from the database, e.g. '$dataSystem.elements' or '["No Element"].concat($dataSystem.elments.slice(1));' which will for example show the names of the elements from the dabase. Requires Group Logic to be set. The Javascript Code within Group Logic has access to the following parameters:
      - item: The item, weapon or armor to be filtered
      - id: The index of chosen filter option.
      A good group logic for the element filter would for example be:

      Spoiler: Group Logic for Element Filter
      JavaScript:
      if( DataManager.isItem(item) ) // When item, check if damaging element is the given element
         return item.damage.elementId === id;
      else // When Armor or Weapon check if it has traits to change Attack Element or Elemental Weakness to the given element
         return item.traits.some(trait => (trait.code === Game_BattlerBase.TRAIT_ATTACK_ELEMENT || trait.code === Game_BattlerBase.TRAIT_ELEMENT_RATE) && trait.dataId === id);

    2. Filter Options: An array of filter options, each with their own name, help text and javascript logic. If these are filled then Group Logic must be empty. The javascript function here has only access to the parameter item.
      1721196452907.png
      Spoiler: Sample Javascript code for Recovery Item Option
      JavaScript:
      return DataManager.isItem(item) // It is an item    && ([3,4,5,6].contains(item.damage.type) // It has either Recovery or drain damage or positive recovery effect on HP or MP
          ||  item.effects.some(effect => (effect.code === Game_Action.EFFECT_RECOVER_HP || effect.code === Game_Action.EFFECT_RECOVER_MP) && (effect.value1 > 0 || effect.value2 > 0)));

    3. Allow user entry: When set to true, then this filter does not have any options and instead will show a name entry window similar to the actor name entry window when the player clicks on the filter. This will use the group logic and the id field will then contain the search string instead of a number.
      Spoiler: Group Logic for Includes filter
      JavaScript:
      return item.name.includes(id);

Filter menu button:
1721197060830.png

The button to be pressed on keyboard and/or gamepad to open the filter pop-up window when the item window is active.

Button help window:
1721196991224.png

1721197020811.png

This parameter is blank by default, which means now button help window is shown to inform the user about the button to be pressed.
You can double click on this entry to created the defaults as shown above. For gamepads please create an icon of the button you use and replace the default of 89 in the parameters.
The default options place the window below the item window, with the same width as the item window. Also when the item window gets activated/deactivated its height gets dynamically adjusted.
1721197290155.png

The window will display the same text as the head line text of the filters pop-up window.



Compatibility:
I found no problems with YEP_ItemCore yet.
Also the filter entry window works with YEP_KeyNameEntry.
This may be incompatible with my sorting plugin I've uploaded to the forum years ago, because both create a key help window seperately from each other.

Possible future extensions (if I feel motivated):
Add the feature to the Shop Sell Window
Add the feature to the Shop Buy Window
Add the feature to the Item Window in Battle
Maybe even create separate filters for the Skill Menu and Skill Window in Battle
Make it compatible with my sorting plugin.

Remarks:
As I was asked for help with previous plugins of mine via private conversations, I would like to ask you to please ask questions directly under this thread or create a seperate help topic instead, as other people might have the same problem and won't benefit from the private conversation! Also if I'm not around fellow developers might still be able to help you in this way.

The applied filters will be reset when switching the category.

The filter options are allowed include color coding and icons, but only at the start of the text, not in between and not at the end.
1721222339596.png
this seems nice, do you also have maybe a sample of the ingame item part for the look as you have no items,
what it looks like with items? or where you see it?
this seems nice, do you also have maybe a sample of the ingame item part for the look as you have no items,
what it looks like with items? or where you see it?
Sure:
This is before I filter:1721219626833.png
This is after I apply filters for recovery items:
1721219674017.png
Or this would be before and after I filter for Includes "Flower":
1721219799926.png

1721219828595.png

Sorry that the screenshots are partially german.

And I forgot in the original post to mention, that the filters are reset when switching the category. I will add that now.
I thought more color the text, but this seems pretty useful, while my game is
very low items use, between 12 and 30, it's not really required.

but the filter is added by notetag like <flower> or <recover> to find?
it's a really nice and really useful, wondering why no one did it before.
I thought more color the text, but this seems pretty useful, while my game is
very low items use, between 12 and 30, it's not really required.

but the filter is added by notetag like <flower> or <recover> to find?
it's a really nice and really useful, wondering why no one did it before.
I don't have a big inventory either, but I like this functionality and was eager to do it.

No, no notetags. By clicking with the mouse on this filter group or pressing enter or Z while the cursor is at this filter group a name input opens, just like the actor name input window, where you can enter any text to search for:
1721222533563.png

Unlike the actor name input windows, it allows to enter blank text.
When the window is closed, the filter pop-up window will be displayed again.
YEP_KeyNameEntry from Yanfly thankfully also works for this window without any changes or additionas and offers key board support for it.

Also maximum input width is configurable in the plugin parameters. I guess I forgot to mention this plugin parameter in the initial post aswell.
that makes sense, I though more, notetag <potion> and this can be chosen
as filter group that way, if it's case Sensitive, they need to input it correctly
what they find as a simple "potion" or "potions" won't get simulant for example.

so they need to remember the name or the first 3 letters if its not lost
in the list 🙂

I mess around with it later on, I kind of like it, so I hope some people put it in good use.
In the item inquiry for the search my cursor starts off screen but i can press space till it shows in the window and still enter the letters just fine to search.
In the item inquiry for the search my cursor starts off screen but i can press space till it shows in the window and still enter the letters just fine to search.
Oh maybe the default maximum input length for the window from the plugin parameters does not fit your game resolution. This may happen. I don't know to fix this yet, you may have to use a smaller maximum input length.
Oh maybe the default maximum input length for the window from the plugin parameters does not fit your game resolution. This may happen. I don't know to fix this yet, you may have to use a smaller maximum input length.
Found the solution here https://forums.rpgmakerweb.com/index.php?threads/change-the-input-name-scene-size.139238/ .
Found the solution here https://forums.rpgmakerweb.com/index.php?threads/change-the-input-name-scene-size.139238/ .
Oh thanks for telling me. Have you applied that solution already? I am unsure if should introduce a new plugin parameter to be able to set the width of the window for the filters input.
Found the solution here https://forums.rpgmakerweb.com/index.php?threads/change-the-input-name-scene-size.139238/ .
Oh thanks for telling me. Have you applied that solution already? I am unsure if should introduce a new plugin parameter to be able to set the width of the window for the filters input.
Yes I applied the plugin and it worked great. My screen was set to 1280x720 so just increasing the width and centering the text worked.

Original thread: https://forums.rpgmakerweb.com/threads/menu-filters-currently-item-menu-only.170377/