initial draft

53-setting-to-change-tooltip-opacity
bensaine 3 years ago
parent 7df9b2f255
commit ddb4cce712

@ -271,6 +271,7 @@ namespace NLGUI
virtual sint32 getAlpha() const;
virtual void setAlpha (sint32 a);
virtual void setContainerAlpha (sint32 a);
/// Eval current clip coords. This is not incremental as with makeNewClip, and thus more slow. This also doesn't change the current clip window.
void getClip(sint32 &x, sint32 &y, sint32 &w, sint32 &h) const;

@ -489,6 +489,8 @@ namespace NLGUI
uint8 getGlobalContainerAlpha() const { return _GlobalContainerAlpha; }
uint8 getGlobalRolloverFactorContent() const { return _GlobalRolloverFactorContent; }
uint8 getGlobalRolloverFactorContainer() const { return _GlobalRolloverFactorContainer; }
uint8 getContextHelpContentAlpha() const { return _ContextHelpContentAlpha; }
uint8 getContextHelpContainerAlpha() const { return _ContextHelpContainerAlpha; }
void updateGlobalAlphas();
void resetGlobalAlphasProps();
@ -608,12 +610,16 @@ namespace NLGUI
NLMISC::CCDBNodeLeaf *_GlobalContainerAlphaDB;
NLMISC::CCDBNodeLeaf *_GlobalContentRolloverFactorDB;
NLMISC::CCDBNodeLeaf *_GlobalContainerRolloverFactorDB;
NLMISC::CCDBNodeLeaf * _ContextHelpContentAlphaDB;
NLMISC::CCDBNodeLeaf * _ContextHelpContainerAlphaDB;
uint8 _ContainerAlpha;
uint8 _GlobalContentAlpha;
uint8 _GlobalContainerAlpha;
uint8 _GlobalRolloverFactorContent;
uint8 _GlobalRolloverFactorContainer;
uint8 _ContextHelpContentAlpha;
uint8 _ContextHelpContainerAlpha;
bool _MouseHandlingEnabled;

@ -2153,6 +2153,18 @@ namespace NLGUI
}
}
// ------------------------------------------------------------------------------------------------
void CInterfaceGroup::setContainerAlpha (sint32 a)
{
vector<CViewBase*>::const_iterator itv;
for (itv = _Views.begin(); itv != _Views.end(); itv++)
{
CViewBase *pVB = *itv;
nlwarning("setContainerAlpha: %s %s", pVB->getShortID().c_str(), std::to_string(pVB->getRenderLayer()).c_str());
pVB->setAlpha(a);
}
}
// ------------------------------------------------------------------------------------------------
void CInterfaceGroup::setLeftClickHandler(const std::string &handler)
{

@ -1780,6 +1780,7 @@ namespace NLGUI
if(groupContextHelp)
{
groupContextHelp->setContainerAlpha(100);
/** If there's a modal box around, should be sure that the context help doesn't intersect it.
* If this is the case, we just disable it, unless the tooltip was generated by the current modal window
*/
@ -3338,11 +3339,17 @@ namespace NLGUI
nlassert(_GlobalContentRolloverFactorDB);
_GlobalContainerRolloverFactorDB = CDBManager::getInstance()->getDbProp("UI:SAVE:CONTAINER_ROLLOVER_FACTOR");
nlassert(_GlobalContainerRolloverFactorDB);
_ContextHelpContentAlphaDB = CDBManager::getInstance()->getDbProp("UI:SAVE:CONTEXT_HELP_CONTENT_ALPHA");
nlassert(_ContextHelpContentAlphaDB);
_ContextHelpContainerAlphaDB = CDBManager::getInstance()->getDbProp("UI:SAVE:CONTEXT_HELP_CONTAINER_ALPHA");
nlassert(_ContextHelpContainerAlphaDB);
}
_GlobalContentAlpha = (uint8)_GlobalContentAlphaDB->getValue32();
_GlobalContainerAlpha = (uint8)_GlobalContainerAlphaDB->getValue32();
_GlobalRolloverFactorContent = (uint8)_GlobalContentRolloverFactorDB->getValue32();
_GlobalRolloverFactorContainer = (uint8)_GlobalContainerRolloverFactorDB->getValue32();
_ContextHelpContentAlpha = (uint8)_ContextHelpContentAlphaDB->getValue32();
_ContextHelpContainerAlpha = (uint8)_ContextHelpContainerAlphaDB->getValue32();
}
void CWidgetManager::resetGlobalAlphasProps()
@ -3351,6 +3358,8 @@ namespace NLGUI
_GlobalContainerAlphaDB = NULL;
_GlobalContentRolloverFactorDB = NULL;
_GlobalContainerRolloverFactorDB = NULL;
_ContextHelpContentAlphaDB = NULL;
_ContextHelpContainerAlphaDB = NULL;
}
void CWidgetManager::registerNewScreenSizeHandler( INewScreenSizeHandler *handler )
@ -3884,6 +3893,8 @@ namespace NLGUI
_GlobalRolloverFactorContent = 255;
_GlobalRolloverFactorContainer = 255;
_AlphaRolloverSpeedDB = NULL;
_ContextHelpContentAlpha = 255;
_ContextHelpContainerAlpha = 255;
_MouseHandlingEnabled = true;
_MouseOverWindow = false;

Loading…
Cancel
Save