Skip to content
Snippets Groups Projects

Add option to control hover text fade distance and range.

Merged Ghost User requested to merge hovertext into master
All threads resolved!
@@ -89,8 +89,8 @@ LLHUDText::LLHUDText(const U8 type) :
{
mColor = LLColor4(1.f, 1.f, 1.f, 1.f);
mDoFade = TRUE;
mFadeDistance = 8.f;
mFadeRange = 4.f;
mFadeDistance = gSavedSettings.getF32("AlchemyHudTextFadeDistance");
mFadeRange = gSavedSettings.getF32("AlchemyHudTextFadeRange");
mZCompare = TRUE;
mOffscreen = FALSE;
mRadius = 0.1f;
@@ -129,7 +129,7 @@ void LLHUDText::renderText()
LLColor4 text_color = mColor;
if (mDoFade)
{
if (mLastDistance > mFadeDistance)
if (mLastDistance > mFadeDistance && mFadeRange > 0.f)
{
alpha_factor = llmax(0.f, 1.f - (mLastDistance - mFadeDistance)/mFadeRange);
text_color.mV[3] = text_color.mV[3]*alpha_factor;
@@ -690,3 +690,15 @@ void LLHUDText::refreshAllObjectText(EObjectTextFilter eObjFilter)
}
}
// [/RLVa:KB]
void LLHUDText::onFadeSettingsChanged()
{
for (LLHUDText* text : sTextObjects)
{
if (text)
{
text->mFadeDistance = gSavedSettings.getF32("AlchemyHudTextFadeDistance");
text->mFadeRange = gSavedSettings.getF32("AlchemyHudTextFadeRange");
}
}
}
\ No newline at end of file
Loading