GUI not eating input
Posted: Thu Jul 23, 2009 20:04
Good day!
And now again for more trouble with the CEGUI-input.
First off, I use the deactivation-hack described somewhere in the forums, which works fine (the right window gets the right input).
But now, that I implemented a state-handler for my game (up to now it's Intro, Main Menu and Play-states). Since the best solution for passing on GUI-input and hiding/showing the right elements of the GUI easily was to make a DefaultWindow for each state that is active (more than one state can be active at the same time).
That means input is checked as follows:
with injectMouseButtonDown going this way:
root-window -> gamestate-base-window -> actual GUI
The gamestate-base-window has been created as follows:
Now, the problem is, that injectMouseButtonDown always returns false, even if a Window has handled its input correctly (which ends in having 3D-mouse-picking happening everywhere on the screen).
Is there any hack so that I can make distributed inputs tell that they have handled the click?
Or is there any "right" way to implement game-state-handling (with keeping some state alive while switching to another (actual game should not end, just because I switch to the main-menu) )?
Greetings 3-R4Z0R
And now again for more trouble with the CEGUI-input.
First off, I use the deactivation-hack described somewhere in the forums, which works fine (the right window gets the right input).
But now, that I implemented a state-handler for my game (up to now it's Intro, Main Menu and Play-states). Since the best solution for passing on GUI-input and hiding/showing the right elements of the GUI easily was to make a DefaultWindow for each state that is active (more than one state can be active at the same time).
That means input is checked as follows:
Code: Select all
if(mGUI->injectMouseButtonDown((CEGUI::MouseButton)0)==false && BypassGUIBug())
gamestate->getCurrentState()->OnLMouseDown();
with injectMouseButtonDown going this way:
root-window -> gamestate-base-window -> actual GUI
The gamestate-base-window has been created as follows:
Code: Select all
this->base_window = gui->getWindowManager()->createWindow("DefaultWindow", name+"_Game_State/Container");
this->base_window->setMousePassThroughEnabled(true);
Now, the problem is, that injectMouseButtonDown always returns false, even if a Window has handled its input correctly (which ends in having 3D-mouse-picking happening everywhere on the screen).
Is there any hack so that I can make distributed inputs tell that they have handled the click?
Or is there any "right" way to implement game-state-handling (with keeping some state alive while switching to another (actual game should not end, just because I switch to the main-menu) )?
Greetings 3-R4Z0R