From 6b59fc0081699901a75f194b61ee0413fab614bb Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 15 Aug 2020 01:21:16 +0300 Subject: [PATCH 1/3] Fixed: ctrl+3 detected as KeyESCAPE when using keychar event --- code/nel/src/gui/widget_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index 864e4ef5b..a1da03b2e 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -2296,7 +2296,7 @@ namespace NLGUI // Hide menu if the key is pushed // if ((eventDesc.getKeyEventType() == CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift()) // Hide menu (or popup menu) is ESCAPE pressed - if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyESCAPE ) + if( eventDesc.getKeyEventType() == CEventDescriptorKey::keydown && eventDesc.getKey() == NLMISC::KeyESCAPE ) { if( hasModal() ) { @@ -2307,7 +2307,7 @@ namespace NLGUI } // Manage "quit window" If the Key is ESCAPE, no captureKeyboard - if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyESCAPE ) + if( eventDesc.getKeyEventType() == CEventDescriptorKey::keydown && eventDesc.getKey() == NLMISC::KeyESCAPE ) { // Get the last escapable active top window. NB: this is ergonomically better. CInterfaceGroup *win= getLastEscapableTopWindow(); From 9532fc3a81ba2bc8f499af3cbcaf8d5e85a98d0b Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 10 Sep 2020 20:16:28 +0300 Subject: [PATCH 2/3] Fixed: mouse free look when using inverted mouse --- code/ryzom/client/src/events_listener.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/code/ryzom/client/src/events_listener.cpp b/code/ryzom/client/src/events_listener.cpp index 879bd5a2a..cfa9d2b3c 100644 --- a/code/ryzom/client/src/events_listener.cpp +++ b/code/ryzom/client/src/events_listener.cpp @@ -172,16 +172,12 @@ void CEventsListener::operator()(const CEvent& event) // Get in pixel space, centered uint32 drW, drH; Driver->getWindowSize(drW, drH); - float fX = mouseEvent->X; // from 0 to 1.0 - float fY = (ClientCfg.FreeLookInverted ? -mouseEvent->Y : mouseEvent->Y); - sint scX = (sint32)(fX * (float)drW) - ((sint32)drW >> 1); // in pixels, centered - sint scY = (sint32)(fY * (float)drH) - ((sint32)drH >> 1); + sint scX = (sint32)(mouseEvent->X * (float)drW) - ((sint32)drW >> 1); // in pixels, centered + sint scY = (sint32)(mouseEvent->Y * (float)drH) - ((sint32)drH >> 1); if (!s_MouseFreeLookReady) { - float pfX = _MouseX; - float pfY = (ClientCfg.FreeLookInverted ? -_MouseY : _MouseY); - sint pscX = (sint32)(pfX * (float)drW) - ((sint32)drW >> 1); // in pixels, centered - sint pscY = (sint32)(pfY * (float)drH) - ((sint32)drH >> 1); + sint pscX = (sint32)(_MouseX * (float)drW) - ((sint32)drW >> 1); // in pixels, centered + sint pscY = (sint32)(_MouseY * (float)drH) - ((sint32)drH >> 1); s_MouseFreeLookReady = true; s_MouseFreeLookLastX = pscX; s_MouseFreeLookLastY = pscY; @@ -199,13 +195,12 @@ void CEventsListener::operator()(const CEvent& event) } // Get delta since last center - sint scXd = scX - s_MouseFreeLookLastX; - sint scYd = scY - s_MouseFreeLookLastY; + s_MouseFreeLookFrameX += (scX - s_MouseFreeLookLastX); + s_MouseFreeLookFrameY += (scY - s_MouseFreeLookLastY) * (ClientCfg.FreeLookInverted ? -1 : 1); + s_MouseFreeLookLastX = scX; s_MouseFreeLookLastY = scY; - s_MouseFreeLookFrameX += scXd; - s_MouseFreeLookFrameY += scYd; // updateFreeLookPos is called in updateMouseSmoothing per frame // Center cursor From 6ccd8853db5e83b324664d1aec721c7e3a2a74d3 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 19 Sep 2020 21:54:15 +0300 Subject: [PATCH 3/3] Fixed: setActive() did not invalidate table cell size. --- code/nel/src/gui/interface_element.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index cf5646077..4a736314d 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -1168,6 +1168,8 @@ namespace NLGUI { _Active = state; invalidateCoords(); + // force invalidate CViewText/CGroupTable inner elements + invalidateContent(); } }