YES! YES! YES! I have squashed the nasty right-click unhandled exception bug! I introduced several bugs when I added support to control the menu display via the left/right mouse buttons -- click on left mouse button to open a window/click the right mouse button to close a window.
Well, when I go to close the window, I call (GUIElement* x) x->remove(). I made the mistake of calling remove() on the child GUI element even when the parent GUI window that it belongs to have long been removed.
The other problem was because I failed to set the correct state for one of the window that I'm currently in. This cause the previous window to be removed. But when you reach the previous window and try to remove it, it's already removed so you get an unhandled exception runtime error.
I feel so silly. But I also feel good that I figured out the bug on my own.
![Wink :wink:](./images/smilies/icon_wink.gif)
Yet another hurtle overcometh!
Oh, I almost forgot. I added a "pause" option detailed elsewhere in the forum when accessing the command window options. Since the mouse moves where you look on the screen, it is not possible to select the command options on the command window. So, in the update(), I added the following code:
Code: Select all
...
if (m_bPause == false)
{
pManager->getSceneManager()->drawAll();
}
...
Thanks to GFXstyLER from this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... ause#56140
Unfortunately, everything goes blank except for the GUI elements. I was thinking maybe add in a static image. But ideally to be faithful to the original, the screen should not blank out -- but then again the original did not support a mouse (which is a pain to support by the way). The various game elements (mouse look disabled, NPC stop moving, etc.) should freeze in time. Oh, well. It will have to do for now.
![Sad :(](./images/smilies/icon_sad.gif)