Fixed mouse closing containers, and injection/gui test order

Called setEnabled on channels now effects whether those channels
notify listeners, rather than whether they register changes to
their controls. This was making channels get stuck on "1" when the
GUI was activated.

Also ensured GUI activity can invalidate player controls even if
that activity is closing the GUI, by re-ordering a check.

And fixed a comment.
deque
Fil Krynicki 11 years ago
parent 1d3a220d94
commit cd693b6d37

@ -569,10 +569,10 @@ namespace MWInput
{
bool guiMode = false;
if (id == SDL_BUTTON_LEFT || id == SDL_BUTTON_RIGHT) // MyGUI has no use for these events
if (id == SDL_BUTTON_LEFT || id == SDL_BUTTON_RIGHT) // MyGUI only uses these mouse events
{
MyGUI::InputManager::getInstance().injectMousePress(mMouseX, mMouseY, sdlButtonToMyGUI(id));
guiMode = guiMode && MWBase::Environment::get().getWindowManager()->isGuiMode();
guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
guiMode = MyGUI::InputManager::getInstance().injectMousePress(mMouseX, mMouseY, sdlButtonToMyGUI(id)) && guiMode;
if (MyGUI::InputManager::getInstance ().getMouseFocusWidget () != 0)
{
MyGUI::Button* b = MyGUI::InputManager::getInstance ().getMouseFocusWidget ()->castType<MyGUI::Button>(false);
@ -596,8 +596,8 @@ namespace MWInput
{
mInputBinder->mouseReleased (arg, id);
} else {
bool guiMode = MyGUI::InputManager::getInstance().injectMouseRelease(mMouseX, mMouseY, sdlButtonToMyGUI(id));
guiMode = guiMode && MWBase::Environment::get().getWindowManager()->isGuiMode();
bool guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
guiMode = MyGUI::InputManager::getInstance().injectMouseRelease(mMouseX, mMouseY, sdlButtonToMyGUI(id)) && guiMode;
if(mInputBinder->detectingBindingState()) return; // don't allow same mouseup to bind as initiated bind

@ -84,7 +84,7 @@ namespace ICS
mValue = value;
if(previousValue != value)
if(previousValue != value && mEnabled)
{
notifyListeners(previousValue);
}
@ -130,9 +130,6 @@ namespace ICS
void Channel::update()
{
if(!mEnabled)
return;
if(this->getControlsCount() == 1)
{
ControlChannelBinderItem ccBinderItem = mAttachedControls.back();

Loading…
Cancel
Save