Friends! Folks! Coders!
I need some help on a game I'm working on, and having difficulty tracing the stack of calls around updating GUI buttons and actions on-screen. It would be awesome if someone understood the high-level flow of the GUI code and could talk through it.
Here's the scenario:
- For the beginning of the game, I have one character, and she uses the mainGui
- Later, a new character is introduced, a playable cat
- I want to be able to switch to a custom GUI (catGui, shown below) when you switch to the cat, and switch back to the mainGui when the primary character is in use
I
have been able to change the text overlay on the button when switching characters, as shown below. For example, when you click "Pick up," the label shows "Hiss at." (I have some code in
SetActionButtons() that implements this, as well as some other foundational code in other methods.)
I
have not been able to find the appropriate place in the code to switch GUIs. I'd like to add a code block somewhere that would relay something like the following pseudo-code:
if char == cCatgMaingui.Visible = falsegCatgui.Visible = trueAnd, likewise, I'd like to add a code block that would switch back to the main GUI when the cat is not selected.
I'm also not sure when I should use the method
SetAlternativeAction(), so if anyone has insight into that, that'd be helpful. I think I need to add some calls to
CheckDefaultAction(), but I'm still playing around there, and have some commented-out code.
Additionally, it'd be great to add documentation to the Starter Park wiki (
https://github.com/ManiacMansionMania/Bernard-SP/wiki) and document some of these high-level flows or niche problem areas for others. I'd be happy to contribute in any way I can, and thanks in advance for any help.