EnemyBook as a menu command.

Right now, I have been using YEP_MainMenuCore to create a menu item to pull up the Enemybook as a common

But what I don't like is how it also exits the menu screen when calling and exiting Scene_EnemyBook.

Another thing I noticed is that when I use the commman SceneManager.push(Scene_EnemyBook) The game errors as if it doesn't exist. Using YEP MainMenuCore (as of now, I'm using it as a common event to pull it up) but I would like to directly Push the Scene, in hopes that when you cancel out of the screen it also goes back to the Menu.

This is also a thing I noticed when I try to put a background image for Scene_EnemyBook using Mr.Trivels SceneBackgrounds.

What do I have to recode and change for Scene_EnemyBook to exist before calling the plugin command?

Thanks.
You can create a menu in this system, and have it push a common event. Is this not what you would like to do? Here is my example using Yanfly's MainMenu Manager.

You can create a menu in this system, and have it push a common event. Is this not what you would like to do? Here is my example using Yanfly's MainMenu Manager.


This is already what I'm doing. But it leaves the menu and when I exit the EnemyBook, I'm brought the map scene, and not back to the menu.

What I get when I try doing SceneManager.push(Scene_EnemyBook) is that Scene_EnemyBook is undefined.

I'll check about setting it to Actor Bind after the Personal. Maybe That will work.

But at the moment, I already am using a common event using a plugin command to push the scene. It just feels clunky that... It exits the menu then opens up the scene, and then when I exit, the menu is already closed. What I would like is to have the scene already open.

Maybe its just a case with having a conflicting plugin... but I'm not sure. Seeing if anyone has a solution though.

Thanks for the reply tho
Yep. Still getting Scene_EnemyBook is undefined x.x
Anyway I got it... I spliced some code from Mr.TS monsterbook that pretty much registered it as a menu command without having to use YEP's Core.

For those who want a direct command from the menu without having to configure a common event here is the code that needs to be added:

This should be added at the end:
Spoiler: code
var _SceneMenu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
_SceneMenu_createCommandWindow.call(this);
this._commandWindow.setHandler('EnemyBook', this.commandEnemyBook.bind(this));
};

Scene_Menu.prototype.commandEnemyBook = function() {
SceneManager.push(Scene_EnemyBook);
};

var enabled = true

var _WindowMenuCommand_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
Window_MenuCommand.prototype.addOriginalCommands = function() {
_WindowMenuCommand_addOriginalCommands.call(this);
this.addCommand('Bestiary', 'EnemyBook', enabled);
};

Change 'Bestiary' to whatever you are calling your Monster/EnemyBook

Original thread: https://forums.rpgmakerweb.com/threads/enemybook-as-a-menu-command.92634/