Wait, I think I got it! I will just replace the bar with a png image that has already spaces between each box
I will complete it tomorrow then, too tired to do it now, once again, thanks for your time guys!
It is currently April 26th, 2024, 7:28 pm
Increase bar clicking on button image?
-
- Posts: 62
- Joined: February 7th, 2017, 10:02 pm
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Increase bar clicking on button image?
Using just the shape meters you had, adding a few variables, and a calc measure to track the count, you can reduce your code considerably and not have to use any images that need to be hidden/shown.
Hope this helps you understand the suggestions to use !WriteKeyValue. Along with the power of IfCondition tests.
Code: Select all
[Rainmeter]
Update=100
BackgroundMode=2
BackgroundMargins=0,5,5,5
SolidColor=0,0,0,90
SolidColor2=160,0,0,130
[Variables]
Count=0
Color1=100,100,100
Color2=100,100,100
Color3=100,100,100
Color4=100,100,100
Color5=100,100,100
[CheckCount]
Measure=Calc
Formula=#Count#
DynamicVariables=1
IfCondition=(#Count# >= 1)
IfTrueAction=[!SetVariable Color1 "100,255,100"][!WriteKeyValue Variables Color1 "100,255,100"][!UpdateMeter Shape1][!Redraw]
IfFalseAction=[!SetVariable Color1 "100,100,100"][!WriteKeyValue Variables Color1 "100,100,100"][!UpdateMeter Shape1][!Redraw]
IfCondition2=(#Count# >= 2)
IfTrueAction2=[!SetVariable Color2 "100,255,100"][!WriteKeyValue Variables Color2 "100,255,100"][!UpdateMeter Shape2][!Redraw]
IfFalseAction2=[!SetVariable Color2 "100,100,100"][!WriteKeyValue Variables Color2 "100,100,100"][!UpdateMeter Shape2][!Redraw]
IfCondition3=(#Count# >= 3)
IfTrueAction3=[!SetVariable Color3 "100,255,100"][!WriteKeyValue Variables Color3 "100,255,100"][!UpdateMeter Shape3][!Redraw]
IfFalseAction3=[!SetVariable Color3 "100,100,100"][!WriteKeyValue Variables Color3 "100,100,100"][!UpdateMeter Shape3][!Redraw]
IfCondition4=(#Count# >= 4)
IfTrueAction4=[!SetVariable Color4 "100,255,100"][!WriteKeyValue Variables Color4 "100,255,100"][!UpdateMeter Shape4][!Redraw]
IfFalseAction4=[!SetVariable Color4 "100,100,100"][!WriteKeyValue Variables Color4 "100,100,100"][!UpdateMeter Shape4][!Redraw]
IfCondition5=(#Count# >= 5)
IfTrueAction5=[!SetVariable Color5 "100,255,100"][!WriteKeyValue Variables Color5 "100,255,100"][!UpdateMeter Shape5][!Redraw]
IfFalseAction5=[!SetVariable Color5 "100,100,100"][!WriteKeyValue Variables Color5 "100,100,100"][!UpdateMeter Shape5][!Redraw]
[Style]
FontFace=Proxima Nova Bold
FontColor=255,255,255
StringEffect=Shadow
FontSize=12
AntiAlias=1
[Title1]
Meter=String
Text=- Push Ups x10
MeterStyle=Style
Y=5
X=5
////////////// SHAPES /////////////
[Shape1]
Meter=Shape
Y=31
X=6
Shape=Rectangle 0,0,40,3 | StrokeWidth 1 | Stroke Color 0,0,0 | Fill Color #Color1#
DynamicVariables=1
[Shape2]
Meter=Shape
Y=r
X=3R
Shape=Rectangle 0,0,40,3 | StrokeWidth 1 | Stroke Color 0,0,0 | Fill Color #Color2#
DynamicVariables=1
[Shape3]
Meter=Shape
Y=r
X=3R
Shape=Rectangle 0,0,40,3 | StrokeWidth 1 | Stroke Color 0,0,0 | Fill Color #Color3#
DynamicVariables=1
[Shape4]
Meter=Shape
Y=r
X=3R
Shape=Rectangle 0,0,40,3 | StrokeWidth 1 | Stroke Color 0,0,0 | Fill Color #Color4#
DynamicVariables=1
[Shape5]
Meter=Shape
Y=r
X=3R
Shape=Rectangle 0,0,40,3 | StrokeWidth 1 | Stroke Color 0,0,0 | Fill Color #Color5#
DynamicVariables=1
///////////// MINUS ////////////////////////////////////
[BoxShapeM]
Meter=Shape
Y=6
X=182
Shape=Rectangle 0,0,18,18 | Fill LinearGradient MyGradient1 | StrokeWidth 1 | Stroke Color 0,0,0
MyGradient1=270 | 100,255,100 ; 0.0 | 20,160,20 ; 1.0
LeftMouseUpAction=[!SetVariable Count (Clamp(#Count#-1,0,5))][!WriteKeyValue Variables Count (Clamp(#Count#-1,0,5))][!UpdateMeter *][!Redraw]
DynamicVariables=1
[ButtonMinus]
Meter=String
FontFace=Proxima Nova Bold
FontColor240,240,240
FontSize=17
Text=-
Y=1
X=184
///////////// PLUS ////////////////////////////////////
[BoxShapePlus]
Meter=Shape
Y=6
X=204
Shape=Rectangle 0,0,18,18 | Fill LinearGradient MyGradient1 | StrokeWidth 1 | Stroke Color 0,0,0
MyGradient1=270 | 100,255,100 ; 0.0 | 20,160,20 ; 1.0
LeftMouseUpAction=[!SetVariable Count (Clamp(#Count#+1,0,5))][!WriteKeyValue Variables Count (Clamp(#Count#+1,0,5))][!UpdateMeter *][!Redraw]
DynamicVariables=1
[ButtonP]
Meter=String
FontFace=Proxima Nova Bold
FontColor240,240,240
FontSize=16
Text=+
Y=2
X=204
You do not have the required permissions to view the files attached to this post.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 62
- Joined: February 7th, 2017, 10:02 pm
Re: Increase bar clicking on button image?
Thanks a lot for the code!
It looks like this now! I will add a text later and an animated image that will pop up when hit 100%.
I actually used the bars method, seems kinda easier :P
That's the code.
But I ran into another problem, IfConditions don't work. Bar goes over than 100 and less than 0, I don't know how to fix it :/ Once again I need your help to fix it
It looks like this now! I will add a text later and an animated image that will pop up when hit 100%.
I actually used the bars method, seems kinda easier :P
That's the code.
Code: Select all
[Rainmeter]
Update=16
BackgroundMode=2
BackgroundMargins=0,5,5,5
SolidColor=0,0,0,0
SolidColor2=0,100,130,130
[Variables]
Current=60
[CurrentValue]
Measure=Calc
Formula=#Current#
MinValue=0
MaxValue=100
IfCondition=(#Current# <= 0)
IfTrueAction=[!SetVariable Current 0][!WriteKeyValue Variables Current 0][!UpdateMeter *][!Redraw]
IfCondition2=(#Current# >= 100)
IfTrueAction2=[!SetVariable Current 100][!WriteKeyValue Variables Current 100][!UpdateMeter *][!Redraw]
DynamicVariables=1
//////////// BARS ///////////////////
[EmptyBar]
Meter=Image
ImageName=Bar1.png
Y=30
X=5
[Bar]
Meter=Bar
MeasureName=CurrentValue
BarOrientation=Horizontal
BarImage=Bar.png
Y=30
X=5
///////////// RESET ///////////////////
[BoxReset]
Meter=Image
ImageName=Reset.png
Y=5
X=137
LeftMouseUpAction=[!SetVariable Current 0][!WriteKeyValue Variables Current 0][!UpdateMeter *][!Redraw]
DynamicVariables=1
//////////// MINUS /////////////////
[BoxMinus]
Meter=Image
ImageName=Minus.png
Y=5
X=159
LeftMouseUpAction=[!SetVariable Current "(#Current#-20)"][!WriteKeyValue Variables Current "(#Current#-20)"][!UpdateMeter *][!Redraw]
DynamicVariables=1
///////////// PLUS ////////////////////
[BoxPlus]
Meter=Image
ImageName=Plus1.png
Y=5
X=181
LeftMouseUpAction=[!SetVariable Current "(#Current#+20)"][!WriteKeyValue Variables Current "(#Current#+20)"][!UpdateMeter *][!Redraw]
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 16174
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Increase bar clicking on button image?
EDIT: Sorry this post is related to the first posted code, but probably the second one could be also modified this way.
I downloaded your package and gave it a try. Found a few mistakes and fixed them. Here is my code:
Applied fixes:
I downloaded your package and gave it a try. Found a few mistakes and fixed them. Here is my code:
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=0,0,0,90
SolidColor2=160,0,0,130
[Variables]
Step=0
[Style]
FontFace=Proxima Nova Bold
FontColor=255,255,255
StringEffect=Shadow
FontSize=12
AntiAlias=1
[Title1]
Meter=String
Text=- Push Ups x10
MeterStyle=Style
Y=5
X=5
[Shape1]
Meter=Shape
Y=31
X=6
Shape=Rectangle 0,0,40,3 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0
[Shape2]
Meter=Shape
Y=31
X=3R
Shape=Rectangle 0,0,40,3 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0
[Shape3]
Meter=Shape
Y=31
X=3R
Shape=Rectangle 0,0,40,3 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0
[Shape4]
Meter=Shape
Y=31
X=3R
Shape=Rectangle 0,0,40,3 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0
[Shape5]
Meter=Shape
Y=31
X=3R
Shape=Rectangle 0,0,40,3 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0
[BarEmpty1]
Meter=Image
ImageName=Bar2.png
Y=31
X=6
[BarEmpty2]
Meter=Image
ImageName=Bar2.png
Y=31
X=4R
[BarEmpty3]
Meter=Image
ImageName=Bar2.png
Y=31
X=4R
[BarEmpty4]
Meter=Image
ImageName=Bar2.png
Y=31
X=4R
[BarEmpty5]
Meter=Image
ImageName=Bar2.png
Y=31
X=4R
[MeasureStep]
Measure=Calc
Formula=#Step#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "Bar1"][!HideMeter "Bar2"][!HideMeter "Bar3"][!HideMeter "Bar4"][!HideMeter "Bar5"][!Redraw]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!ShowMeter "Bar1"][!HideMeter "Bar2"][!HideMeter "Bar3"][!HideMeter "Bar4"][!HideMeter "Bar5"][!Redraw]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!ShowMeter "Bar1"][!ShowMeter "Bar2"][!HideMeter "Bar3"][!HideMeter "Bar4"][!HideMeter "Bar5"][!Redraw]
IfCondition4=(#CURRENTSECTION#=3)
IfTrueAction4=[!ShowMeter "Bar1"][!ShowMeter "Bar2"][!ShowMeter "Bar3"][!HideMeter "Bar4"][!HideMeter "Bar5"][!Redraw]
IfCondition5=(#CURRENTSECTION#=4)
IfTrueAction5=[!ShowMeter "Bar1"][!ShowMeter "Bar2"][!ShowMeter "Bar3"][!ShowMeter "Bar4"][!HideMeter "Bar5"][!Redraw]
IfCondition6=(#CURRENTSECTION#=5)
IfTrueAction6=[!ShowMeter "Bar1"][!ShowMeter "Bar2"][!ShowMeter "Bar3"][!ShowMeter "Bar4"][!ShowMeter "Bar5"][!Redraw]
DynamicVariables=1
[BoxShapeM]
Meter=Shape
Y=6
X=182
Shape=Rectangle 0,0,18,18 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0
[BoxMinus1]
Meter=Image
ImageName=Box.png
LeftMouseUpAction=[!SetVariable Step "(Clamp((#Step#-1),0,5))"][!UpdateMeasure "MeasureStep"][!UpdateMeterGroup "Buttons"]
Y=0r
X=0r
DynamicVariables=1
Group=Buttons
[ButtonMinus]
Meter=String
FontFace=Proxima Nova Bold
FontColor=240,240,240
FontSize=16
Text=-
Y=9r
X=9r
StringAlign=CenterCenter
[BoxShapePlus]
Meter=Shape
Y=6
X=204
Shape=Rectangle 0,0,18,18 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0
[BoxPlus1]
Meter=Image
ImageName=Box.png
LeftMouseUpAction=[!SetVariable Step "(Clamp((#Step#+1),0,5))"][!UpdateMeasure "MeasureStep"][!UpdateMeterGroup "Buttons"]
Y=0r
X=0r
DynamicVariables=1
Group=Buttons
[ButtonP]
Meter=String
FontFace=Proxima Nova Bold
FontColor=240,240,240
FontSize=16
Text=+
X=9r
Y=9r
StringAlign=CenterCenter
[Bar1]
Meter=Image
ImageName=Bar1.png
X=6
Y=31
Hidden=1
[Bar2]
Meter=Image
ImageName=Bar1.png
X=4R
Y=0r
Hidden=1
[Bar3]
Meter=Image
ImageName=Bar1.png
X=4R
Y=0r
Hidden=1
[Bar4]
Meter=Image
ImageName=Bar1.png
X=4R
Y=0r
Hidden=1
[Bar5]
Meter=Image
ImageName=Bar1.png
X=4R
Y=0r
Hidden=1
- The BackgroundMargins option in the [Rainmeter] section make sense only if the BackgroundMode option is set to 3. With BackgroundMode=2, it has no sens, so I removed it.
- I added a [Variables] section and within it a Step variable: Step=0. This variable will be used to set the visible meters (see later).
- Using so many [BoxMinusX] and [BoxPlusX] meters (5 of each) again has not too much logic. I removed most of them, leaving just the [BoxMinus1] and [BoxPlus1].
- The FontColor options of the [ButtonMinus] and [ButtonP] meters (however I'd name the [ButtonP] meter as [ButtonPlus] - but this has not too much importance) are missing an equal sign:
I added them back: FontColor[color=#FF0000]=[/color]240,240,240. Without the equality signs, the default color is used (black).
Code: Select all
[ButtonMinus] ... FontColor240,240,240 [ButtonMinus] ... FontColor240,240,240
- I repositioned the [ButtonMinus] and [ButtonP] meters:
Code: Select all
[ButtonMinus] ... Y=9r X=9r StringAlign=CenterCenter [ButtonP] ... X=9r Y=9r StringAlign=CenterCenter
- I added the following Calc measure, which controls which meters are visible:
See that depending on the value of the Step variable (previously added to the [Variables] section), this measure sets the visible meters.
Code: Select all
[MeasureStep] Measure=Calc Formula=#Step# IfCondition=(#CURRENTSECTION#=0) IfTrueAction=[!HideMeter "Bar1"][!HideMeter "Bar2"][!HideMeter "Bar3"][!HideMeter "Bar4"][!HideMeter "Bar5"][!Redraw] IfCondition2=(#CURRENTSECTION#=1) IfTrueAction2=[!ShowMeter "Bar1"][!HideMeter "Bar2"][!HideMeter "Bar3"][!HideMeter "Bar4"][!HideMeter "Bar5"][!Redraw] IfCondition3=(#CURRENTSECTION#=2) IfTrueAction3=[!ShowMeter "Bar1"][!ShowMeter "Bar2"][!HideMeter "Bar3"][!HideMeter "Bar4"][!HideMeter "Bar5"][!Redraw] IfCondition4=(#CURRENTSECTION#=3) IfTrueAction4=[!ShowMeter "Bar1"][!ShowMeter "Bar2"][!ShowMeter "Bar3"][!HideMeter "Bar4"][!HideMeter "Bar5"][!Redraw] IfCondition5=(#CURRENTSECTION#=4) IfTrueAction5=[!ShowMeter "Bar1"][!ShowMeter "Bar2"][!ShowMeter "Bar3"][!ShowMeter "Bar4"][!HideMeter "Bar5"][!Redraw] IfCondition6=(#CURRENTSECTION#=5) IfTrueAction6=[!ShowMeter "Bar1"][!ShowMeter "Bar2"][!ShowMeter "Bar3"][!ShowMeter "Bar4"][!ShowMeter "Bar5"][!Redraw] DynamicVariables=1
- I modified the LeftMouseUpAction options of the remained [BoxMinus1] and [BoxPlus1] meters, added a DynamicVariables=1 and a Group=Buttons options to these meters and modified their position (X and Y options):
Code: Select all
[BoxMinus1] Meter=Image ImageName=Box.png LeftMouseUpAction=[!SetVariable Step "(Clamp((#Step#-1),0,5))"][!UpdateMeasure "MeasureStep"][!UpdateMeterGroup "Buttons"] Y=0r X=0r DynamicVariables=1 Group=Buttons [BoxPlus1] Meter=Image ImageName=Box.png LeftMouseUpAction=[!SetVariable Step "(Clamp((#Step#+1),0,5))"][!UpdateMeasure "MeasureStep"][!UpdateMeterGroup "Buttons"] Y=0r X=0r DynamicVariables=1 Group=Buttons
- Made a few more smaller changes, like removed the comments (like ///////////// MINUS ////////////////////////////////////), but if you don't want to completely remove them, at least comment them out, using semicolons).
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: Increase bar clicking on button image?
There you go:GioRgSaVv wrote:Thanks a lot for the code!
It looks like this now! I will add a text later and an animated image that will pop up when hit 100%.
I actually used the bars method, seems kinda easier :P
That's the code.But I ran into another problem, IfConditions don't work. Bar goes over than 100 and less than 0, I don't know how to fix it :/ Once again I need your help to fix itCode: Select all
[Rainmeter] Update=16 BackgroundMode=2 BackgroundMargins=0,5,5,5 SolidColor=0,0,0,0 SolidColor2=0,100,130,130 [Variables] Current=60 [CurrentValue] Measure=Calc Formula=#Current# MinValue=0 MaxValue=100 IfCondition=(#Current# <= 0) IfTrueAction=[!SetVariable Current 0][!WriteKeyValue Variables Current 0][!UpdateMeter *][!Redraw] IfCondition2=(#Current# >= 100) IfTrueAction2=[!SetVariable Current 100][!WriteKeyValue Variables Current 100][!UpdateMeter *][!Redraw] DynamicVariables=1 //////////// BARS /////////////////// [EmptyBar] Meter=Image ImageName=Bar1.png Y=30 X=5 [Bar] Meter=Bar MeasureName=CurrentValue BarOrientation=Horizontal BarImage=Bar.png Y=30 X=5 ///////////// RESET /////////////////// [BoxReset] Meter=Image ImageName=Reset.png Y=5 X=137 LeftMouseUpAction=[!SetVariable Current 0][!WriteKeyValue Variables Current 0][!UpdateMeter *][!Redraw] DynamicVariables=1 //////////// MINUS ///////////////// [BoxMinus] Meter=Image ImageName=Minus.png Y=5 X=159 LeftMouseUpAction=[!SetVariable Current "(#Current#-20)"][!WriteKeyValue Variables Current "(#Current#-20)"][!UpdateMeter *][!Redraw] DynamicVariables=1 ///////////// PLUS //////////////////// [BoxPlus] Meter=Image ImageName=Plus1.png Y=5 X=181 LeftMouseUpAction=[!SetVariable Current "(#Current#+20)"][!WriteKeyValue Variables Current "(#Current#+20)"][!UpdateMeter *][!Redraw] DynamicVariables=1
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
BackgroundMargins=0,5,5,5
SolidColor=0,0,0,0
SolidColor2=0,100,130,130
[Variables]
Current=0
[MeasurePlus]
Measure=Calc
Formula=(#Current#+20)
OnUpdateAction=[!SetVariable Current "[MeasurePlus]"][!WriteKeyValue Variables Current "[MeasurePlus]"][!UpdateMeter *][!Redraw]
DynamicVariables=1
MaxValue=100
UpdateDivider=-1
[MeasureMinus]
Measure=Calc
Formula=(#Current#-20)
OnUpdateAction=[!SetVariable Current "[MeasureMinus]"][!WriteKeyValue Variables Current "[MeasureMinus]"][!UpdateMeter *][!Redraw]
DynamicVariables=1
MinValue=0
UpdateDivider=-1
//////////// BARS ///////////////////
[EmptyBar]
Meter=Image
ImageName=#@#Bar1.png
Y=30
X=5
[Bar]
Meter=Bar
MeasureName=CurrentValue
BarOrientation=Horizontal
BarImage=#@#Bar.png
Y=30
X=5
///////////// RESET ///////////////////
[BoxReset]
Meter=Image
ImageName=#@#Reset.png
Y=5
X=137
LeftMouseUpAction=[!SetVariable Current 0][!WriteKeyValue Variables Current 0][!UpdateMeter *][!Redraw]
DynamicVariables=1
//////////// MINUS /////////////////
[BoxMinus]
Meter=Image
ImageName=#@#Minus.png
Y=5
X=159
LeftMouseUpAction=[!UpdateMeasure MeasureMinus]
DynamicVariables=1
///////////// PLUS ////////////////////
[BoxPlus]
Meter=Image
ImageName=#@#Plus1.png
Y=5
X=181
LeftMouseUpAction=[!UpdateMeasure MeasurePlus]
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Increase bar clicking on button image?
Does this sound familiar: Use ClampGioRgSaVv wrote:But I ran into another problem, IfConditions don't work. Bar goes over than 100 and less than 0, I don't know how to fix it :/ Once again I need your help to fix it
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 16174
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Increase bar clicking on button image?
As eclectic-tech suggested:GioRgSaVv wrote:But I ran into another problem, IfConditions don't work. Bar goes over than 100 and less than 0, I don't know how to fix it :/ Once again I need your help to fix it
So, use the Clamp function into the !SetVariable and !WriteKeyValue bangs of the LeftMouseUpAction options of the [BoxMinus] and [BoxPlus] meters:eclectic-tech wrote:Does this sound familiar: Use Clamp
Code: Select all
[BoxMinus]
...
LeftMouseUpAction=[!SetVariable Current "(Clamp((#Current#-20),0,100))"][!WriteKeyValue Variables Current "(Clamp((#Current#-20),0,100))"][!UpdateMeter *][!Redraw]
DynamicVariables=1
[BoxPlus]
...
LeftMouseUpAction=[!SetVariable Current "(Clamp((#Current#+20),0,100))"][!WriteKeyValue Variables Current "(Clamp((#Current#+20),0,100))"][!UpdateMeter *][!Redraw]
DynamicVariables=1
-
- Posts: 62
- Joined: February 7th, 2017, 10:02 pm
Re: Increase bar clicking on button image?
Thanks a lot guys, I really appreciate it
You helped me a lot!
So it is now complete, all that's left is to edit its appearance a little bit and make it more official, add the animated image when hit 100% and then share it here and on deviantart!
(Accidentally tho, I managed to do it, I messed up with the ifconditions a little bit and succeeded xD )
(this is how I did it)
But in the end I used the clamp faction as it's a lot smaller than the ifconditions that I added above.
I just didn't know how to use clamp factions, in which position should I add them, what should I type afterwards :P
If balala wouldn't post this...
...I think I would have ended up using the ifconditions xD
Once again, thank you!
You helped me a lot!
So it is now complete, all that's left is to edit its appearance a little bit and make it more official, add the animated image when hit 100% and then share it here and on deviantart!
(Accidentally tho, I managed to do it, I messed up with the ifconditions a little bit and succeeded xD )
(this is how I did it)
Code: Select all
IfCondition=(#Current# >= 0)
IfFalseAction=[!SetVariable Current 0][!WriteKeyValue Variables Current 0][!UpdateMeter *][!Redraw]
IfCondition2=(#Current# <= 100)
IfFalseAction2=[!SetVariable Current 100][!WriteKeyValue Variables Current 100][!UpdateMeter *][!Redraw]
I just didn't know how to use clamp factions, in which position should I add them, what should I type afterwards :P
If balala wouldn't post this...
Code: Select all
[BoxMinus]
...
LeftMouseUpAction=[!SetVariable Current "(Clamp((#Current#-20),0,100))"][!WriteKeyValue Variables Current "(Clamp((#Current#-20),0,100))"][!UpdateMeter *][!Redraw]
DynamicVariables=1
[BoxPlus]
...
LeftMouseUpAction=[!SetVariable Current "(Clamp((#Current#+20),0,100))"][!WriteKeyValue Variables Current "(Clamp((#Current#+20),0,100))"][!UpdateMeter *][!Redraw]
DynamicVariables=1
Once again, thank you!
-
- Rainmeter Sage
- Posts: 16174
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Increase bar clicking on button image?
There is always something new to learn. But don't forget, eclectic-tech suggested first to use the Calmp function.GioRgSaVv wrote:If balala wouldn't post this...
-
- Rainmeter Sage
- Posts: 16174
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Increase bar clicking on button image?
And one more small comment: Update=16? Why? Doesn't worth. If this will be the whole code of your skin (so if you don't want to add further parts to the code) in case of such mouse commanded skins, Update=-1 is a perfectly good option. Update=-1 means that the skin is never updated (excepting the very first moment, when it is refreshed / loaded), but you don't even have to.
But even if you decide to not use the update set to -1, at least use the default Update=1000. As I said, doesn't worth to update the skin very often, because this uselessly loads the CPU.
But even if you decide to not use the update set to -1, at least use the default Update=1000. As I said, doesn't worth to update the skin very often, because this uselessly loads the CPU.