It is currently March 28th, 2024, 11:45 pm

BatteryLifeTime Display problem.

Get help with creating, editing & fixing problems with skins
David3214
Posts: 14
Joined: December 5th, 2017, 12:16 am

BatteryLifeTime Display problem.

Post by David3214 »

I am making a buff bar, like in terraria, and one of the "buffs" shows the lifetime of the battery, but instead of the lifetime it shows a bunch of random numbers. Will someone review my code and explain what the problem was.

Code: Select all

[Style]
X=R
Y=r
Path=#@#images\
ImageAlpha=100
DynamicVariables=1
MouseOverAction=[!SetOption #CURRENTSECTION# ImageAlpha 355][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageAlpha 100][!UpdateMeter "#CURRENTSECTION#"][!Redraw]

[MeasureLife]
Measure=Plugin
Plugin=Plugins\PowerPlugin.dll
PowerState=LIFETIME
Format=locale-time
UpdateDivider=5

[LifeTimeIcon]
Meter=Image
MeterStyle=Style
ImageName=LifeTime.png
ToolTipTitle=Life Time
TooltipText=Life Time left: [MeasureLife:]
DynamicVariables=1

User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: BatteryLifeTime Display problem.

Post by SilverAzide »

Try changing the line
TooltipText=Life Time left: [MeasureLife:]
to
TooltipText=Life Time left: [MeasureLife]
Maybe that will help...
Gadgets Wiki GitHub More Gadgets...
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: BatteryLifeTime Display problem.

Post by balala »

SilverAzide wrote:Try changing the line
TooltipText=Life Time left: [MeasureLife:]
to
TooltipText=Life Time left: [MeasureLife]
Maybe that will help...
Definitely, but not entirely.
David, first take into account SilverAzide's above very good reply, because the TooltipText=Life Time left: [MeasureLife:] option returns the numeric value of the [MeasureLife] measure, not the formatted one.
But there is one more problem: it seems that although the help of the Power plugin says that the same Format syntax can be used on a this kind of measure, like on the Time measures, the Format=locale-time option isn't allowed. If you try to change this to something else (like Format=H: %H, M: %M, S: %S) you get the appropriate format for the wanted time.
David3214
Posts: 14
Joined: December 5th, 2017, 12:16 am

Re: BatteryLifeTime Display problem.

Post by David3214 »

Thank you all for your input, I didn't realize how flexible the Format option was, and I need to review the symbols that go in the []. It worked thanks again!