script to check if main menu is open

fakepumpkins

Warper
Member
Joined
May 14, 2018
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello! I'm using SumRndmDde's HUD plugin to have a small menu of collectibles visible onscreen, however I want to use it specifically to only appear when the player has the main menu open, so that the player can see the totals of all the different kinds of items they've collected. I already figured out how to check the value of the item via javascript, but I don't understand what I would need to input into the conditional field to make it appear only in the menu.

Basically my question is, what is the script call to check if the main menu is open? Thanks in advance!

Here is a link to the plugin just in case: http://sumrndm.site/hud-maker
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
622
Reaction score
332
First Language
English
Primarily Uses
RMMV
Try
Code:
SceneManager._scene instanceof Scene_Menu
Should return a boolean of whether the current Scene is the main menu.
 

fakepumpkins

Warper
Member
Joined
May 14, 2018
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
That seems to be working, in that the HUD isn't visible when the menu isn't open, but it still won't show when the menu actually is open. I think that because of the difference between the map and menu scenes, the conditional might not actually be working the way I expect it to. And also I totally missed this before somehow, HUD Maker throws an error message if you try to use it while the menu is open lol. Thank you though, this is still a useful line of code to have for future reference!
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
622
Reaction score
332
First Language
English
Primarily Uses
RMMV
Could you clarify what you mean by the menu being open and what the difference between the HUD and the menu is?

All of the default windows have a property called active that gets toggled by activate() and deactivate() calls, that might be something to reference, as well. However, as far as I know, the menu is made up of a series of windows that all belong to the Scene_Menu Scene. Still, there might be a window you can reference to see if it's active.
 

fakepumpkins

Warper
Member
Joined
May 14, 2018
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
How I at least understand the plugin is that I'm drawing to the map scene to sit on top of it to show some kind of information. When I open the menu, I'm activating a new scene that stops all action from the map scene, but it's still visible underneath the menu.
I think the plugin is still accepting the conditional statement of the HUD item not appearing when the menu isn't open, but it since it runs on the map scene, it pauses running when the menu is open like everything else, so it doesn't truly have a way of activating.

I think if I wanted to get something to the effect I wanted, I would need to create custom windows inside of the menu scene.
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
622
Reaction score
332
First Language
English
Primarily Uses
RMMV
If the HUD Maker option of the Plugin doesn't operate unless your current Scene is Scene_Map or Scene_Battle, then you may indeed need to just create your own set of windows in the Scene_Menu Scene to display what you're looking for.

I downloaded Super Tools Engine and HUD Maker and just took a super cursory glance at them and it looks like you can't add anything to the Menu since, as you said, you get an error that says you must have a Map or Battle open in order to use the HUD Maker.

Perhaps you could make a Window_Collectible that extends Window_Base, though, and loop over any items that are tagged as collectibles and add it as a child to the Scene_Menu Scene? Are you supposed to be able to interact with the collectibles, or just see a count of items in your inventory that match some particular condition?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Ugh! I have a headache coming on--not sure if it's from the sudden change in weather or caffeine withdraw...only one way to fi d out--Coffee time!
Found this old picture in the plastic case with my medical documents. I don't remember who this character is (I draw a lot of original characters and forgot about them very soon), but I like the design, may be I'll add guy in my game.

reading what makes plugins tick, so you can use other plugins to trigger said plugin... setup up Luna MV to have my own custom ATB Gauges from Yanfly's ATB. cool
It's Easter on Monday. Anybody got any Easter quarantine eggs? It'll also be my birthday, I'll be 31.
Sometimes I feel like I'm using plugins feature the wrong way. But as long as it works tho.

Forum statistics

Threads
95,799
Messages
932,023
Members
126,221
Latest member
Tsume
Top