It is currently April 16th, 2024, 8:00 am

Num Variant , string show hide

Get help with creating, editing & fixing problems with skins
Teemodres
Posts: 9
Joined: April 29th, 2018, 8:04 pm

Num Variant , string show hide

Post by Teemodres »

Hi guys i have a little problem. i have a picture and if i click a variant (Num) changing 1 2 and repeat like this :

Code: Select all

LeftMouseUpAction=[!SetVariable Num1 "(#Num1# < 2 ? #Num1# + 1 : 1 )"][!UpdateMeter MeterImage][!Redraw]
And this Changing the picture background like this :

Code: Select all

[MeterBackgroundkattbat2]
Meter=Image
ImageName=#@#Images\bat\alap#Num1#.png
DynamicVariables=1
H=18
W=52
X=1243
Y=0
And i wanted to show and hide a string like this:

Code: Select all

[MeterBatteryPercent]
Meter=String
MeasureName=MeasureBatteryPercent
X=1160
Y=30
FontSize=8
FontFamily=ClobberGroteskMedium
AntiAlias=1
FontColor=0,0,0,255
Text=Battery percent: %1%
DynamicVariables=1

IfCondition=(#Num1# < 1)
IfTrueAction=[!HideMeter MeterBatteryPercent2 ""]
IfCondition2=(#Num1# = 2)
IfTrueAction2=[!ShowMeter MeterBatteryPercent2 ""]
but the string is Hiding and dont show up when #Num1# = 2
Where is the problem ? :confused:

Also sorry for bad english i dont speak the langauge very well (15 years old , Hungarian)
Last edited by fonpaolo on April 29th, 2018, 8:47 pm, edited 1 time in total.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Num Variant , string show hide

Post by fonpaolo »

Have you added DynamicVariables=1 in the meter where you have the mouse action?
Teemodres
Posts: 9
Joined: April 29th, 2018, 8:04 pm

Re: Num Variant , string show hide

Post by Teemodres »

[MeterBackgroundkattbat2]
Meter=Image
ImageName=#@#Images\bat\alap#Num1#.png
DynamicVariables=1
H=18
W=52
X=1243
Y=0
LeftMouseUpAction=[!SetVariable Num1 "(#Num1# < 2 ? #Num1# + 1 : 1 )"][!UpdateMeter MeterImage][!Redraw]

yes i added.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Num Variant , string show hide

Post by fonpaolo »

I was thinking:
[!SetVariable Num1 "(#Num1# = 1 ? 2 : 1 )"]
Teemodres
Posts: 9
Joined: April 29th, 2018, 8:04 pm

Re: Num Variant , string show hide

Post by Teemodres »

So there is the battery icon when i click the icon the background change to blue (Num = 1)
and also there is an another picture with transparent background and the bubble ...

But when i wanted to Put there a string ( before i used : [!SetVariable Num1 "(#Num1# < 2 ? #Num1# + 1 : 1 )"]
ImageName=#@#Images\bat\bat_background#Num1#.png
ImageName=#@#Images\bat\alap#Num1#.png )

i realized the Num i cant use like a measure. like this:

IfCondition10=(MeasureBatteryPercent >=85)
and the problem in here :

IfCondition=(#Num1# < 1)
IfTrueAction=[!HideMeter MeterBatteryPercent2 ""]
IfCondition2=(#Num1# = 2)
IfTrueAction2=[!ShowMeter MeterBatteryPercent2 ""]

with the num and also i tried :

[Measurebatg]
Measure=Calc
Formula=#Num2#

but the measure is always 0 :(
You do not have the required permissions to view the files attached to this post.
Teemodres
Posts: 9
Joined: April 29th, 2018, 8:04 pm

Re: Num Variant , string show hide

Post by Teemodres »

@fonpaolo

same result as before . In the log
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Num Variant , string show hide

Post by fonpaolo »

Keep in mind that IfConditions are used with Measures, not Meters.
Sorry I didn't noticed it before...
Teemodres
Posts: 9
Joined: April 29th, 2018, 8:04 pm

Re: Num Variant , string show hide

Post by Teemodres »

@fonpaolo

[Measurebatg]
Measure=Calc
Formula=#Num2#+1
IfCondition=(#Num1# < 1)
IfTrueAction=[!HideMeter MeterBatteryPercent2 ""]
IfCondition2=(#Num1# = 2)
IfTrueAction2=[!ShowMeter MeterBatteryPercent2 ""]

Hide work
Show not work

also thanks for fast reply ! <3
Teemodres
Posts: 9
Joined: April 29th, 2018, 8:04 pm

Re: Num Variant , string show hide

Post by Teemodres »

[Measurebatg]
Measure=Calc
Formula=#Num1#
IfCondition=(#Num1# < 1)
IfTrueAction=[!HideMeter MeterBatteryPercent2 ""]
IfCondition2=(#Num1# = 2)
IfTrueAction2=[!ShowMeter MeterBatteryPercent2 ""]
****************************************************************
i write wrong
this is what i use
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Num Variant , string show hide

Post by fonpaolo »

So you're using:
- If #Num1# is 0 (using "< 1" less than 1) ...Hide;
- If #Num1# is 2 ...Show.
...and you're always, just using MeterBatteryPercent2.
...but this: [!HideMeter MeterBatteryPercent2 ""] should be in this way:
[!HideMeter MeterBatteryPercent2]

...and probably, better to add:
[!UpdateMeter MeterBatteryPercent2][!Redraw]