How send Game_Interpreter command to Scene_Map

Hi, everybody!

I'm trying to make a popup plugin. To this, I created a new Window and placed a function in the Scene_Map to show it. I want to use a plugin command to show the window with contents, so created this:


Game_Interpreter.prototype.pluginCommand = function(command, args) {
// Show popup.
if (command == "Popup") {
???
};
};


But I haven't idea of how to call the function. $gameMap seems don't be the correct. Some hint?
Have your own container, that handles these interactions. Then you have basically 2 options:


- Split between logic and rendering (the clean way). Add the render container to Scene_Map and have it observe the other container, which resides in your plugin.


- Store a reference to the container in your plugin and add it to the scene (less to write, has its upsides, but generally a bit more dirty).


In general, you should never access the scene directly from the outside. Also, i don't think that popups should be stored in the savefile, so $gameMap is the wrong place for them.

Original thread: https://forums.rpgmakerweb.com/threads/how-send-game_interpreter-command-to-scene_map.57049/