mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 07:21:12 +00:00
Do not show duration for infinite light sources as -1
This commit is contained in:
parent
07be9ae8ac
commit
989de05f80
@ -161,7 +161,12 @@ namespace MWClass
|
||||
std::string text;
|
||||
|
||||
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::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
Loading…
x
Reference in New Issue
Block a user