|
|
|
@ -24,7 +24,7 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
void EffectSourceVisitor::visit (MWMechanics::EffectKey key,
|
|
|
|
|
const std::string& sourceName, int casterActorId,
|
|
|
|
|
float magnitude, float remainingTime)
|
|
|
|
|
float magnitude, float remainingTime, float totalTime)
|
|
|
|
|
{
|
|
|
|
|
MagicEffectInfo newEffectSource;
|
|
|
|
|
newEffectSource.mKey = key;
|
|
|
|
@ -32,6 +32,7 @@ namespace MWGui
|
|
|
|
|
newEffectSource.mPermanent = mIsPermanent;
|
|
|
|
|
newEffectSource.mRemainingTime = remainingTime;
|
|
|
|
|
newEffectSource.mSource = sourceName;
|
|
|
|
|
newEffectSource.mTotalTime = totalTime;
|
|
|
|
|
|
|
|
|
|
mEffectSources[key.mId].push_back(newEffectSource);
|
|
|
|
|
}
|
|
|
|
@ -67,10 +68,11 @@ namespace MWGui
|
|
|
|
|
MWBase::Environment::get().getWorld ()->getStore ().get<ESM::MagicEffect>().find(it->first);
|
|
|
|
|
|
|
|
|
|
float remainingDuration = 0;
|
|
|
|
|
float totalDuration = 0;
|
|
|
|
|
|
|
|
|
|
std::string sourcesDescription;
|
|
|
|
|
|
|
|
|
|
const float fadeTime = 5.f;
|
|
|
|
|
static const float fadeTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fMagicStartIconBlink")->getFloat();
|
|
|
|
|
|
|
|
|
|
for (std::vector<MagicEffectInfo>::const_iterator effectIt = it->second.begin();
|
|
|
|
|
effectIt != it->second.end(); ++effectIt)
|
|
|
|
@ -80,9 +82,15 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
// if at least one of the effect sources is permanent, the effect will never wear off
|
|
|
|
|
if (effectIt->mPermanent)
|
|
|
|
|
{
|
|
|
|
|
remainingDuration = fadeTime;
|
|
|
|
|
totalDuration = fadeTime;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
remainingDuration = std::max(remainingDuration, effectIt->mRemainingTime);
|
|
|
|
|
totalDuration = std::max(totalDuration, effectIt->mTotalTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourcesDescription += effectIt->mSource;
|
|
|
|
|
|
|
|
|
@ -158,8 +166,9 @@ namespace MWGui
|
|
|
|
|
ToolTipInfo* tooltipInfo = image->getUserData<ToolTipInfo>();
|
|
|
|
|
tooltipInfo->text = sourcesDescription;
|
|
|
|
|
|
|
|
|
|
// Fade out during the last 5 seconds
|
|
|
|
|
image->setAlpha(std::min(remainingDuration/fadeTime, 1.f));
|
|
|
|
|
// Fade out
|
|
|
|
|
if (totalDuration >= fadeTime && fadeTime > 0.f)
|
|
|
|
|
image->setAlpha(std::min(remainingDuration/fadeTime, 1.f));
|
|
|
|
|
}
|
|
|
|
|
else if (mWidgetMap.find(it->first) != mWidgetMap.end())
|
|
|
|
|
{
|
|
|
|
|