MV Separate main menu entries for normal items & key items, close to a solution

(tl;dr: How can I hide or bypass the item category selection window, while preserving separate item categories?)

Hello!

In my game, "Key Items" have been renamed "Apps" and allows players to access tutorials screens, music player, note-taking, fast travel, etc. Apps are accessible from the main menu because there will be some situations where players might need to access Apps repeatedly (solving puzzles etc).

I'm using CGMV's menu plugin, as well as this bit of script that I figured out from searching these forums:

Code:
const alias = Scene_Item.prototype.start;
Scene_Item.prototype.start = function() {
    alias.call(this);
     if($gameSwitches.value(5)){
         const symbol = $gameVariables.value(1);
        this._categoryWindow.selectSymbol('keyItem');
    }
};

app.png


From the main menu, selecting "Items" will open up normal Item inventory and selecting "Apps" opens up the Key Items inventory -- so far so good!

However, I want to hide / bypass the item category selection window, to save players the button press and to prevent players from switching between items/equipment/key items.

I tried Mr. Trivel's No Item Categories plugin (by the way huge thanks to Mr. Trivel for so many excellent plugins), but it presents two problems for me: firstly it collapses all the item categories together, and secondly it conflicts with the script I posted above.

I'd be fine with collapsing Items / Weapons / Armor into the same menu category, but keeping Apps separate will keep the user experience tidy.

How can I hide or bypass the item category selection window, while preserving separate item categories? I feel like this is probably pretty simple, but I'm quite new to working with javascript and code in general.
Open the Trivel plugin in a text editor and change line 46 to read:
Code:
return item.itypeId!=2;

In what other way does it conflict with the other plugin?
Thanks, I made that edit. The other conflict seems to be with SumRndmDde's debug/window editor, or might be a plugin order issue?:

Screenshot 2022-06-25 101414.png
I don't see anything in there that references SRD's debug window, it's referencing the exact line you just edited, line 46 in NoItemCategories.

I'm not sure why it's looking at a null item, but change your edit to say
Code:
return item && item.itypeId!=2;
That fixed it when I access the Items menu! Still not there, though... When I access apps/keyitems, I get this:
Screenshot 2022.png


The line it's referencing from keyitem2.js is
Code:
        this._categoryWindow.selectSymbol('keyItem');
Thank you for the help thus far, this is adding to my understanding.
I was able to prevent the crash by adding a line:
Code:
const alias = Scene_Item.prototype.start;
Scene_Item.prototype.start = function() {
    alias.call(this);
     if($gameSwitches.value(5)){
        const symbol = $gameVariables.value(1);
        Scene_Item.prototype.createCategoryWindow = function() {
        this._categoryWindow.selectSymbol('keyItem');
    }
};

but now the main menu entry for keyitems/apps just pulls up normal items.
Still trying to get the above feature to work... ever closer, but still not there. I'm trying to edit rpg_scenes.js directly and I've turned off MrT's NoItemCategories. I added a couple lines to rpg_scenes after 1256, the last two lines in the block below:

JavaScript:
Scene_Item.prototype.createItemWindow = function() {
    var wy = this._categoryWindow.y + this._categoryWindow.height;
    var wh = Graphics.boxHeight - wy;
    this._itemWindow = new Window_ItemList(0, wy, Graphics.boxWidth, wh);
    this._itemWindow.setHelpWindow(this._helpWindow);
    this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
    this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
    this.addWindow(this._itemWindow);
    this._categoryWindow.setItemWindow(this._itemWindow);
    this._itemWindow.select(0);
    this._itemWindow.activate(0);
};

Window_ItemList appears to be active, but unfortunately the category window is simultaneously active. I feel like I'm one line away from getting it to do what I want?
The "start" function runs before the "create" one, so you're trying to do something with _categoryWindow before it exists.
I see -- but I'm not sure what to change. As far as I understand it, the code in my original post is executing what I intend (main menu options of "Apps" and "Items" bring up the correct item lists when SceneItem is pushed) it's just that Window_ItemCategory is active when SceneItem gets pushed, and I just want Window_ItemList to be active. I can't tell what is activating Window_ItemCategory, or if it just automatically gets selected when it gets made?
I see -- but I'm not sure what to change. As far as I understand it, the code in my original post is executing what I intend (main menu options of "Apps" and "Items" bring up the correct item lists when SceneItem is pushed) it's just that Window_ItemCategory is active when SceneItem gets pushed, and I just want Window_ItemList to be active. I can't tell what is activating Window_ItemCategory, or if it just automatically gets selected when it gets made?
The reason this happens by default is that Window_ItemCategory inherits from Window_Command, and Window_Command's initialize function calls the .activate() function at the end.
NEVER EVER edit the core files directly unless you know what you do,
its best to write a plugin and "overwrite" the function to do something else.

but if you have more, you also missing something:

as I use this line for the key items only (in my case)

JavaScript:
this._itemWindow.setCategory('keyItem');

which might work for you too?
I keep a backup of the core files whenever I mess with them, I appreciate your concern!

So, now knowing that Window_ItemCategory inherits from Window_Command, I'm still not sure how to get Window_ItemList to be active when SceneItem gets pushed.

I'm watching tutorials and slowly making my way through this but I've been asking here since I continuously feel like I have just one thing I'm missing. At least each time I ask, I learn about another thing I'm still missing, lol!

Original thread: https://forums.rpgmakerweb.com/threads/separate-main-menu-entries-for-normal-items-key-items-close-to-a-solution.148818/