mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:53:52 +00:00
Do not show duration for infinite light sources as -1
This commit is contained in:
parent
07be9ae8ac
commit
989de05f80
1 changed files with 6 additions and 1 deletions
|
@ -161,7 +161,12 @@ namespace MWClass
|
||||||
std::string text;
|
std::string text;
|
||||||
|
|
||||||
if (Settings::Manager::getBool("show effect duration","Game"))
|
if (Settings::Manager::getBool("show effect duration","Game"))
|
||||||
text += "\n#{sDuration}: " + MWGui::ToolTips::toString(ptr.getClass().getRemainingUsageTime(ptr));
|
{
|
||||||
|
// -1 is infinite light source, so duration makes no sense here. Other negative values are treated as 0.
|
||||||
|
float remainingTime = ptr.getClass().getRemainingUsageTime(ptr);
|
||||||
|
if (remainingTime != -1.0f)
|
||||||
|
text += "\n#{sDuration}: " + MWGui::ToolTips::toString(std::max(0.f, remainingTime));
|
||||||
|
}
|
||||||
|
|
||||||
text += MWGui::ToolTips::getWeightString(ref->mBase->mData.mWeight, "#{sWeight}");
|
text += MWGui::ToolTips::getWeightString(ref->mBase->mData.mWeight, "#{sWeight}");
|
||||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||||
|
|
Loading…
Reference in a new issue