Celebrien
05-10-2008 13:58:57
Hi all!
My question is not exactly MyGUI performance-related, but I know that if I posted it on the main forum ppl would send me here
Anyways, what I'm trying to do is to load inventory.layout on press of Tab key, and on the second press to unload this layout. It does work, here's a snippet of code which loads/unloads the layout:
But my problem is that when i press Tab the second time, for the inventory to disappear, it reacts too quickly and as a result the layout disappears and immediately appears again. So I have to press the key, like, super fast to get back to the game (i pause the game when the inventory layout is loaded). Does anyone know how to fix this problem? I tried using a timer (not Ogre::Timer), but that didn't fix it... I really need to find a solution asap, since the game has to be finished in two weeks
I'd really appreciate any thoughts and suggestions. Thanks!
My question is not exactly MyGUI performance-related, but I know that if I posted it on the main forum ppl would send me here

( in the .h file):
MyGUI::VectorWidgetPtr inventoryHUD;
(in the .cpp):
inventoryHUD = LayoutManager::getInstance().load("inventory.layout");
....
....
WidgetManager::getInstance().destroyWidgetsVector(inventoryHUD);
But my problem is that when i press Tab the second time, for the inventory to disappear, it reacts too quickly and as a result the layout disappears and immediately appears again. So I have to press the key, like, super fast to get back to the game (i pause the game when the inventory layout is loaded). Does anyone know how to fix this problem? I tried using a timer (not Ogre::Timer), but that didn't fix it... I really need to find a solution asap, since the game has to be finished in two weeks

I'd really appreciate any thoughts and suggestions. Thanks!