check if the main menu is open
I want to show/hide my own HUD overlay based on whether the game's main menu is open while in a save. I found a "Is in Main Menu" bp function, but it always returns true, although I'm not sure what World Context to give it anyway.
7 Replies
Main Menu usually means the starting screen you get after launching the game. Do you mean the pause menu?
What does your mod's UI element do and what does the user do with it? That changes the best ways to display it
Easiest way is using it as your mod's custom config widget, but that could be more clicks than the user wants
If you actually want it in the pause menu I suggest widget hooks. Sml uses one of the data driven ones to put the mods button into the pause menu (it's in smls game instance module)
its just an overlay, the user doesnt interact with it other than looking at what it displays, which is your current speed for now. And yes I guess I mean the pause menu. Currently my HUD gets displayed over top of it.
This is my mod: https://ficsit.app/mod/SpeedoSama
Havent worked on it in a long time, but I wanted to finally do a bit more with it now.
Speedo - SMR
Your personal Speedometer HUD overlay!
ah, you don't want it to appear on the pause menu. in that case I suggest using widget hooks to insert it somewhere in the player hud, then the pause menu will naturally draw over it
hmm ok gonna have to look into that
Mam Enhancer source code shows how to do it with both the old (bind on bp function: construct) and new (data driven) ways
yeah ok no idea what to even look for there. Cant really go through entire unfamiliar mods and then try to copy stuff using trial and error to hook into something different than that mod.
I just shoved my widget onto Z-order -20 now which puts it behind all the game's UI elements and developed more meaningful stuff in the mean time. Thanks for the pointers.
if you want a more contained example, ExampleMod's
BP_ExampleModHUD
shows how to do it the data driven way with much less to get confused by, look at RootInstance_ExampleMod