My GUI HUD is coming along, and I’ve got my first set of controls in and doing things (well, I can toggle between them). Here’s what I’m trying to do:
I’m going to have several functions on the HUD (Move, Talk, etc). During game play the player selects a function, and anything they click on performs this function until they select a different toggle (think the old Sierra point-and-click adventures). One of these functions, however, will have additional “sub-functions” that need to be linked directly to the main function. I’m thinking the best way to do this would be with toggles, and setting up my actual controls to reference which toggle is selected so it knows what to do.
What I want to do to prepare for this is:
-
Set it up so that the only way to deselect a function is to select a different one. I have it working so that selecting one toggle turns off the currently selected one, but nothing is stopping me from turning off a function by clicking on itself.
-
On the toggle with the “sub functions” I want to set it up so that selecting a sub-function changes what the main function does by default (IE, the Move toggle has three sub-functions: Run, Walk, Stealth. Clicking on Run should default Move to Run, etc). Selecting a sub-function should also turn on that main toggle and make it the active function (IE if the player currently has “Talk” selected, clicking on Run sets the movement type to run, and also make Move the active function).
-
If the player clicks on a different function after selecting a Move sub-function, they should be able to resume the previously selected move function JUST by clicking on the main Move toggle itself (IE the player was Running, then clicks the Talk icon to interact with an NPC. When finished, he clicks the main Move toggle again and resumes running without selecting).
-
Selecting a sub-function for a main function should also change the appearance (image) used by the main function.
I’m just not sure what the best approach to this would be.
Edit: Added a fourth point.