MV How to get the current option on a switch? Not yet chosen!

Hi,
I'm a developer in a adveture through the RPG Maker.
So, I've searched for many times but without any sucess.

I have one switch that my friend and partner dev made, and I want to get the name (or even 'obj' properties) of the current option where the 'cursor' it's over.
For example:
imaging that the 3 menu options:
new game
>continue<
options

The cursor it's over continue, so, what I want is: get the current object option with name, position and other atributs.

Is that possible?
I read the javascript doc but I can't found any especific info about this, could you help me?
You can get the current hovered index in a window with its index method. For example, if you're on the title screen (the one with New Game, Continue, etc.), you'd use something like:
JavaScript:
SceneManager._scene._commandWindow.index()
SceneManager._scene gives you the current scene, Scene_Title in this case. That scene creates a Window Command instance, the one that contains the menu options, and stores it in _commandWindow variable. Options are stored as objects inside a _list variable in the window object.
If you call index() method for that window, it will return the current hovered index, so if you're over continue, it will return 1 (0 is New Game, 1 is Continue, 2 is Options).
You can also use:
JavaScript:
SceneManager._scene._commandWindow.currentData()
To get the current object. You can try this from the console (press f12 after running the game from the editor), and you can also use this to take a peek at the objects and figure out if it's what you need.
You can get the current hovered index in a window with its index method. For example, if you're on the title screen (the one with New Game, Continue, etc.), you'd use something like:
JavaScript:
SceneManager._scene._commandWindow.index()
SceneManager._scene gives you the current scene, Scene_Title in this case. That scene creates a Window Command instance, the one that contains the menu options, and stores it in _commandWindow variable. Options are stored as objects inside a _list variable in the window object.
If you call index() method for that window, it will return the current hovered index, so if you're over continue, it will return 1 (0 is New Game, 1 is Continue, 2 is Options).
You can also use:
JavaScript:
SceneManager._scene._commandWindow.currentData()
To get the current object. You can try this from the console (press f12 after running the game from the editor), and you can also use this to take a peek at the objects and figure out if it's what you need.
Cool! Thanks man.
Hello @DawnStar ! Thanks for your time.

I'm the partner of @cpusam.

What we want to do actually is a system like New Game+. Something like:
New Game
>New Game +<
Continue
Etc

If the player selects the New Game+ in the menu, we turn the "NewGame+" Switch = ON, so we can do some neat stuff in-game through the events.

How can we achieve this?
I guess you'd need to modify the Title Scene and its Command Window to add the New Game+ command, and create the function that will be executed when said command is pressed. In the function you can set the switch you want with something like:
JavaScript:
$gameSwitches.setValue(#, true) // replace # with the switch id you want to use for NG+

Before loading the first map, but I think it might be a lot more complicated than that.

However, there are a few available plugins (like Galv's New Game Plus Plugin) that already provide this functionality. You could just use that, but if you want to write it yourself, you'll need to know how to modify the title screen, basically how to make your own custom plugin. I recommend you check Poryg's Scripting Tutorial series on youtube, there are one or two videos dedicated to Window and Scene Creation and it's pretty good for learning javascript in MV overall.
@DawnStar thank you for help. (I saw the video of Poryg, but my listen of english it's not so good)
I want to make another menu before the firts map, so, should I use the Scene_Menu to make such thing?
And one last question, how to put text windows with scroll by the code? I'm using ES 6 to code some parts of a plugin.
@DawnStar thank you for help. (I saw the video of Poryg, but my listen of english it's not so good)
You can watch Poryg's videos with subtitles, that way you can read what he's saying.
I want to make another menu before the firts map, so, should I use the Scene_Menu to make such thing?
Yes, you should create an instance of Scene_Menu class to create your own menus. The same for your Windows, use Window_Selectable or Window_Command. As an example, take a look at how Scene_Title is defined inside rpg_scenes.js file in the js folder of your project, and Window_TitleCommand in rpg_windows.js file.
And one last question, how to put text windows with scroll by the code? I'm using ES 6 to code some parts of a plugin.
I'm afraid that is not something I know much of, and I'm not too familiar with ES6, so I'm sorry I can't help you with this particular question. You could open another thread with this question, hopefully someone will be able to answer.
You can watch Poryg's videos with subtitles, that way you can read what he's saying.

Yes, you should create an instance of Scene_Menu class to create your own menus. The same for your Windows, use Window_Selectable or Window_Command. As an example, take a look at how Scene_Title is defined inside rpg_scenes.js file in the js folder of your project, and Window_TitleCommand in rpg_windows.js file.

I'm afraid that is not something I know much of, and I'm not too familiar with ES6, so I'm sorry I can't help you with this particular question. You could open another thread with this question, hopefully someone will be able to answer.
Ok man, thank you again.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-get-the-current-option-on-a-switch-not-yet-chosen.133539/