It is currently March 29th, 2024, 5:07 am

Trying to substitute an image(animated) for a numeric "0" in a MSI plugin measure - possible? [solved]

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Trying to substitute an image(animated) for a numeric "0" in a MSI plugin measure - possible? [solved]

Post by CodeCode »

Hello,

My little skin is for framerate, and if the value is zero show an image. I have not had very good luck even trying some weird methods now considered depreciated, so now I ask the community...

My skin:

Code: Select all

[FramerateFront]
Measure=Plugin
Plugin=MSIAfterburner.dll
DataSource=Framerate
MinValue=0
MaxValue=200
DynamicVariables=1

[FramerateBack]
Measure=Plugin
Plugin=MSIAfterburner.dll
DataSource=Framerate
MinValue=0
MaxValue=200
InvertMeasure=1
DynamicVariables=1

[FPS1]
MeasureName=FramerateFront
Meter=ROUNDLINE
X=99
Y=99
StartAngle=-1.5458897
RotationAngle=6.188
LineStart=43
LineLength=49
LineColor=#UsedR#
Solid=1
AntiAlias=10

[FPS2]
MeasureName=FramerateBack
Meter=ROUNDLINE
X=99
Y=99
StartAngle=4.694
RotationAngle=-6.188
LineStart=43
LineLength=49
LineColor=#FreeL#
Solid=1
AntiAlias=10

[MeterText1]
Meter=String
Text=FPS
X=100
Y=80
FontSize=10
FontFace=#GlobalFont#
FontColor=#GlobalFontAltColor#
StringEffect=Border
FontEffectColor=#TextColor1#
AntiAlias=1
StringAlign=CenterCenter
DynamicVariables=1

[MeterFPS1]
Meter=String
MeasureName=FramerateFront
FontSize=18
FontColor=#GlobalFontAltColor#
FontFace=#GlobalFont#
StringEffect=Border
FontEffectColor=#TextColor1#
StringStyle=normal
AntiAlias=1
Text="%1"
StringEffect=Border
FontEffectColor=0,0,0,255
y=30r
StringAlign=CenterCenter
x=r
DynamicVariables=1
All the custom colours will just come out white but the skin should be pretty readable any ways.
The code above does not have my failed 'tricks' so any recommendation is appreciated.
Last edited by CodeCode on November 2nd, 2020, 1:38 pm, edited 1 time in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Trying to substitute an image for a numeric "0" in a MSI plugin measure - possible?

Post by CodeCode »

Hello again...

So I have most of my answer:-

Code: Select all


[FramerateFront]
Measure=Plugin
Plugin=MSIAfterburner.dll
DataSource=Framerate
MinValue=0
MaxValue=200
Substitute="0":"""[Image]"""
DynamicVariables=1

[FramerateBack]
Measure=Plugin
Plugin=MSIAfterburner.dll
DataSource=Framerate
MinValue=0
MaxValue=200
InvertMeasure=1
DynamicVariables=1

[FPS1]
MeasureName=FramerateFront
Meter=ROUNDLINE
X=99
Y=99
StartAngle=-1.5458897
RotationAngle=6.188
LineStart=43
LineLength=49
LineColor=#UsedR#
Solid=1
AntiAlias=10

[FPS2]
MeasureName=FramerateBack
Meter=ROUNDLINE
X=99
Y=99
StartAngle=4.694
RotationAngle=-6.188
LineStart=43
LineLength=49
LineColor=#FreeL#
Solid=1
AntiAlias=10

[MeterText1]
Meter=String
Text=FPS
X=100
Y=80
FontSize=10
FontFace=#GlobalFont#
FontColor=#GlobalFontAltColor#
StringEffect=Border
FontEffectColor=#TextColor1#
AntiAlias=1
StringAlign=CenterCenter
DynamicVariables=1

[MeterFPS1]
Meter=String
MeasureName=FramerateFront
FontSize=18
FontColor=#GlobalFontAltColor#
FontFace=#GlobalFont#
StringEffect=Border
FontEffectColor=#TextColor1#
StringStyle=normal
AntiAlias=1
Text="%1"
StringEffect=Border
FontEffectColor=0,0,0,255
y=30r
StringAlign=CenterCenter
x=r
DynamicVariables=1

[ImageCalc]
Measure=Calc
Formula=Counter%10
DynamicVariables=1

[Image]
Meter=Image
ImageName=#@#diamond\diamond-[ImageCalc].png
X=48
Y=48
W=100
H=100
AntiAlias=1
DynamicVariables=1
But now the image show all of the time... lol.
Not sure what's next to have the substitute work vs numbers > 0.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Trying to substitute an image for a numeric "0" in a MSI plugin measure - possible?

Post by jsmorley »

I'm not sure, but it feels like you might be making this more complicated than it needs to be...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeasureValue]
Measure=Calc
Formula=(MeasureValue+1)%6
IfCondition=MeasureValue=0
IfTrueAction=[!HideMeter MeterString][!ShowMeter MeterImage][!UpdateMeter *][!Redraw]
IfFalseAction=[!HideMeter MeterImage][!ShowMeter MeterString][!UpdateMeter *][!Redraw]

[MeterString]
Meter=String
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=I'm not ZERO
Hidden=1

[MeterImage]
Meter=Image
W=169
H=40
SolidColor=0,254,0,255
Hidden=1
I don't use MSIAfterburner, so I just faked up a measure that counts from 0 to 5.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Trying to substitute an image for a numeric "0" in a MSI plugin measure - possible?

Post by CodeCode »

Cool, thanks Jsmorley.

Then there was the next step:
Having the image be an animated gif.
So this did it:

Code: Select all

[FramerateFront]
Measure=Plugin
Plugin=MSIAfterburner.dll
DataSource=Framerate
MinValue=0
MaxValue=200
DynamicVariables=1

[FramerateBack]
Measure=Plugin
Plugin=MSIAfterburner.dll
DataSource=Framerate
MinValue=0
MaxValue=200
InvertMeasure=1
DynamicVariables=1

[FPS1]
MeasureName=FramerateFront
Meter=ROUNDLINE
X=99
Y=99
StartAngle=-1.5458897
RotationAngle=6.188
LineStart=43
LineLength=49
LineColor=#UsedR#
Solid=1
AntiAlias=10

[FPS2]
MeasureName=FramerateBack
Meter=ROUNDLINE
X=99
Y=99
StartAngle=4.694
RotationAngle=-6.188
LineStart=43
LineLength=49
LineColor=#FreeL#
Solid=1
AntiAlias=10

[MeterText1]
Meter=String
Text=FPS
X=100
Y=80
FontSize=10
FontFace=#GlobalFont#
FontColor=#GlobalFontAltColor#
StringEffect=Border
FontEffectColor=#TextColor1#
AntiAlias=1
StringAlign=CenterCenter
DynamicVariables=1

[MeterFPS1]
Meter=String
MeasureName=FramerateFront
FontSize=18
FontColor=#GlobalFontAltColor#
FontFace=#GlobalFont#
StringEffect=Border
FontEffectColor=#TextColor1#
StringStyle=normal
AntiAlias=1
Text="%1"
StringEffect=Border
FontEffectColor=0,0,0,255
y=30r
StringAlign=CenterCenter
x=r
DynamicVariables=1

[MeasureCalc]
Measure=Calc
Formula=Counter%10
IfCondition=[FramerateFront]=0
IfTrueAction=[!HideMeter MeterText1][!HideMeter MeterFPS1][!ShowMeter Image][!UpdateMeter *][!Redraw]
IfFalseAction=[!HideMeter Image][!ShowMeter MeterText1][!ShowMeter MeterFPS1][!UpdateMeter *][!Redraw]
DynamicVariables=1

[Image]
Meter=Image
ImageName=#@#diamond\diamond-[MeasureCalc].png
X=48
Y=48
W=100
H=100
AntiAlias=1
DynamicVariables=1
All good now! :thumbup: :thumbup:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Trying to substitute an image(animated) for a numeric "0" in a MSI plugin measure - possible? [solved]

Post by jsmorley »

Great!