Game Development Community

Closing a MessageBoxOK from code

by Mark Brown · in Torque Game Engine · 01/09/2009 (6:25 am) · 2 replies

Can I close a MessageBoxOK from the code rather than by mouse click. I have bound the "h" key to give the player a hint about what direction to go. It would be nice to press the "h" key a second time to make the hint go away.

#1
01/09/2009 (11:23 am)
Well, you can set the accelerator for the OK button to be "H"
#2
01/09/2009 (5:25 pm)
Your solution works too. Many thanks!

I solved it this way:

if ( $hint_showing )
{
// Turn off hint
messageCallback(MessageBoxOKDlg,MessageBoxOKDlg.callback);
$hint_showing = 0;
return;
}
$hint_showing = 1;