hiding a user mode

Started by PatientRock, Mon 20/12/2010 14:06:40

Previous topic - Next topic

PatientRock

I've created a user mode which has a corresponding image in the icon bar.  Have managed to get it working beautifully.  Now, I don't want the user mode to be available in the beginning of the game but later at a chosen moment. 

How would I hide this user mode in the icon bar and later make it available?  A gentle push in the right direction would be appreciated.

Thanks

Ghost

#1
By setting the VISIBLE flag of the button to false in game_start and later to true. That will leave a gap in the GUI's design though, so a workaround would be to change the buton's graphics (NormalGraphic) to look like the GUI background and ONLY respond to clicks when the graphic is different:

if (BUTTON.NormalGraphic == BackgroundGraphic)
{
  // do nothing!
}
else
{
  // set the mode
}

Hope that helps!

monkey0506

Instead of having to change the NormalGraphic, you could just have a "disabled" version of the button image flattened into the GUI background. Whenever the Button was visible it would cover up the disabled version..

..but, Ghost..if the alternate NormalGraphic looked like the GUI background..wouldn't that be the same (visually) as having the Visible property set to false?

Ghost

Quote from: monkey_05_06 on Mon 20/12/2010 15:52:14
..but, Ghost..if the alternate NormalGraphic looked like the GUI background..wouldn't that be the same (visually) as having the Visible property set to false?

It would, yes, but since Rock asked for pointers, I saw no harm in giving two. It's almost Xmas, after all  ;)

PatientRock

Thanks guys - quite helpful!

SMF spam blocked by CleanTalk