Merge remote-tracking branch 'origin/fixes' into atys

ryzom/ui/improvements
Nuno 4 years ago
commit dfe051a8df

@ -2296,7 +2296,7 @@ namespace NLGUI
// Hide menu if the key is pushed // Hide menu if the key is pushed
// if ((eventDesc.getKeyEventType() == CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift()) // if ((eventDesc.getKeyEventType() == CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift())
// Hide menu (or popup menu) is ESCAPE pressed // 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() ) if( hasModal() )
{ {
@ -2307,7 +2307,7 @@ namespace NLGUI
} }
// Manage "quit window" If the Key is ESCAPE, no captureKeyboard // 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. // Get the last escapable active top window. NB: this is ergonomically better.
CInterfaceGroup *win= getLastEscapableTopWindow(); CInterfaceGroup *win= getLastEscapableTopWindow();

@ -172,16 +172,12 @@ void CEventsListener::operator()(const CEvent& event)
// Get in pixel space, centered // Get in pixel space, centered
uint32 drW, drH; uint32 drW, drH;
Driver->getWindowSize(drW, drH); Driver->getWindowSize(drW, drH);
float fX = mouseEvent->X; // from 0 to 1.0 sint scX = (sint32)(mouseEvent->X * (float)drW) - ((sint32)drW >> 1); // in pixels, centered
float fY = (ClientCfg.FreeLookInverted ? -mouseEvent->Y : mouseEvent->Y); sint scY = (sint32)(mouseEvent->Y * (float)drH) - ((sint32)drH >> 1);
sint scX = (sint32)(fX * (float)drW) - ((sint32)drW >> 1); // in pixels, centered
sint scY = (sint32)(fY * (float)drH) - ((sint32)drH >> 1);
if (!s_MouseFreeLookReady) if (!s_MouseFreeLookReady)
{ {
float pfX = _MouseX; sint pscX = (sint32)(_MouseX * (float)drW) - ((sint32)drW >> 1); // in pixels, centered
float pfY = (ClientCfg.FreeLookInverted ? -_MouseY : _MouseY); sint pscY = (sint32)(_MouseY * (float)drH) - ((sint32)drH >> 1);
sint pscX = (sint32)(pfX * (float)drW) - ((sint32)drW >> 1); // in pixels, centered
sint pscY = (sint32)(pfY * (float)drH) - ((sint32)drH >> 1);
s_MouseFreeLookReady = true; s_MouseFreeLookReady = true;
s_MouseFreeLookLastX = pscX; s_MouseFreeLookLastX = pscX;
s_MouseFreeLookLastY = pscY; s_MouseFreeLookLastY = pscY;
@ -199,13 +195,12 @@ void CEventsListener::operator()(const CEvent& event)
} }
// Get delta since last center // Get delta since last center
sint scXd = scX - s_MouseFreeLookLastX; s_MouseFreeLookFrameX += (scX - s_MouseFreeLookLastX);
sint scYd = scY - s_MouseFreeLookLastY; s_MouseFreeLookFrameY += (scY - s_MouseFreeLookLastY) * (ClientCfg.FreeLookInverted ? -1 : 1);
s_MouseFreeLookLastX = scX; s_MouseFreeLookLastX = scX;
s_MouseFreeLookLastY = scY; s_MouseFreeLookLastY = scY;
s_MouseFreeLookFrameX += scXd;
s_MouseFreeLookFrameY += scYd;
// updateFreeLookPos is called in updateMouseSmoothing per frame // updateFreeLookPos is called in updateMouseSmoothing per frame
// Center cursor // Center cursor

@ -588,7 +588,8 @@ void CBotChatPageTrade::updateTradeModal()
if ((_BuyMean == MoneyGuildXP) || (_BuyMean == GuildMoney) || (_BuyMean == GuildMoneyGuildXP)) if ((_BuyMean == MoneyGuildXP) || (_BuyMean == GuildMoney) || (_BuyMean == GuildMoneyGuildXP))
{ {
uint64 totalPrice = (uint64) priceWithoutFame * (uint64) quantity; uint64 totalPrice = (uint64) priceWithoutFame * (uint64) quantity;
NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TRADE_ITEM:PRICE")->setValue64(totalPrice); NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TRADE_ITEM:UNIT_PRICE")->setValue64(totalPrice);
NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TRADE_ITEM:UNIT_PRICE_WITH_FAME")->setValue64(totalPrice);
uint64 totalXP = (uint64) getCurrItemXP() * (uint64) quantity; uint64 totalXP = (uint64) getCurrItemXP() * (uint64) quantity;
CGuildManager *pGM = CGuildManager::getInstance(); CGuildManager *pGM = CGuildManager::getInstance();

Loading…
Cancel
Save