It is currently March 29th, 2024, 3:29 pm

Possible To Select Image + Execute

Get help with creating, editing & fixing problems with skins
User avatar
Skyayashane
Posts: 7
Joined: August 2nd, 2017, 12:22 pm

Possible To Select Image + Execute

Post by Skyayashane »

if this possible i'm creating a skin, i have 2 image and 1 button image if i select image 1 button 1 show and
the condition is if i click image 1 select then, the button image show and link to open application 1.
in second image same as the condition. here's my alternative example but not polish. seem if i had too many image i will eat lot memory if skin load.

Code: Select all

Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Variables]

1="D:\GameLink\Dota2.bat"
2="D:\GameLink\Garena.bat"

[MeterDota]
Meter=IMAGE
X=35
Y=20
W=200
H=250
ImageName=Dota\0.png
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "Dota\1.png"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseDownAction=[!SetOption MeterPlay1 Hidden "0"][!SetOption #CURRENTSECTION# ImageName "Dota\1.png"][!Redraw]
RightMouseDownAction=[]


[MeterLOL]
Meter=IMAGE
X=300
Y=20
W=200
H=250
ImageName=Lol\0.png
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "Lol\1.png"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseDownAction=[!SetOption MeterPlay2 Hidden "0"][!SetOption #CURRENTSECTION# ImageName "Lol\1.png"][!Redraw]
RightMouseDownAction=[]

[MeterPlay1]
Meter=IMAGE
X=100
Y=300
W=80
ImageName=Hit1.png
MouseLeaveAction=[!SetOption MeterPlay1 Hidden "1"][!SetOption MeterDota ImageName "Dota\0.png"][!Redraw]
LeftMouseDownAction=!Execute[#1#]
Hidden = 1

[MeterPlay2]
Meter=IMAGE
X=300
Y=300
W=80
ImageName=Hit2.png
MouseLeaveAction=[!SetOption MeterPlay2 Hidden "1"][!SetOption MeterLol ImageName "Lol\0.png"][!Redraw]
LeftMouseDownAction=!Execute[#2#]
Hidden = 1
Last edited by jsmorley on August 16th, 2017, 10:59 am, edited 1 time in total.
Reason: use [code] tags for more than one line if code.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Possible To Select Image + Execute

Post by balala »

Skyayashane wrote:if this possible i'm creating a skin, i have 2 image and 1 button image if i select image 1 button 1 show and
the condition is if i click image 1 select then, the button image show and link to open application 1.
in second image same as the condition. here's my alternative example but not polish. seem if i had too many image i will eat lot memory if skin load.
Not very sure I've understood what would you like.
Which meter would be the button? [MeterDota] or [MeterLOL]?
My approach would be a bit different.
I'd use a new variable, let's name it Play. This variable must be defined in the [Variables] section: Play=0. Its value will control which image is shown and what action is set up to the button.
Add the following Calc measure to your code:

Code: Select all

[MeasurePlay]
Measure=Calc
Formula=#Play#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterDota ImageName "Dota\1.png"][!ShowMeter "MeterPlay1"][!HideMeter "MeterPlay2"][!UpdateMeter "MeterDota"][!Redraw]
IfFalseAction=[!SetOption MeterDota ImageName "Lol\1.png"][!HideMeter "MeterPlay1"][!ShowMeter "MeterPlay2"][!UpdateMeter "MeterDota"][!Redraw]
DynamicVariables=1
The bangs of the IfTrueAction and IfFalseAction options set the appropriate image name to the [MeterDota] meter and show / hide the appropriate [MeterPlay1] or [MeterPlay2] meter.
Now you have to replace the bangs of the LeftMouseDownAction option of the [MeterDota] with something like: LeftMouseDownAction=[!SetVariable Play "(1-#Play#)"][!UpdateMeasure "MeasurePlay"][!UpdateMeter "#CURRENTSECTION#"]. This LeftMouseDownAction will work only if you also add a DynamicVariables=1 option to the same [MeterDota] meter, so don't forget it.
With this approach the [MeterLOL] meter is not needed anymore, you can remove it.
As I said, I'm not sure I understood very well your needs, so please test this approach and let me know if it helped.

And a few more tips:
  • The LeftMouseDownAction options should be replaced by LeftMouseUpActions. Here you can find out why.
  • !Execute is deprecated. Remove it (you've used it in the LeftMouseDownAction options of the [MeterPlay1] and [MeterPlay2] meters).
  • Don't include the values of the variables in the [Variables] section to quotations. Instead use those quotations into the LeftMouseDownAction (or as I said above better the LeftMouseUpAction) options: LeftMouseDownAction=[[color=#FF0000]"[/color]#1#[color=#FF0000]"[/color]].
So please let me know if this approach was helpful.
User avatar
Skyayashane
Posts: 7
Joined: August 2nd, 2017, 12:22 pm

Re: Possible To Select Image + Execute

Post by Skyayashane »

Not very sure I've understood what would you like.
Which meter would be the button? [MeterDota] or [MeterLOL]?
My approach would be a bit different.
I'd use a new variable, let's name it Play. This variable must be defined in the [Variables] section: Play=0. Its value will control which image is shown and what action is set up to the button.
Add the following Calc measure to your code:
Code: Select all
Sir, ex: 2 Image [MeterDota]=Image1 | [MeterLOL]=Image2 and a Button Image name [MeterPlay]=Play

when i click [MeterDota] Image1, button will show [MeterPlay] Play = the link is equivalent to variables?
when i click [MeterDota] Image2, button will show [MeterPlay] Play = the link is equivalent to variables?

but 1 only [MeterPlay] the condition is on image when i click Image1 and detect that is for Variables 1? something that hehehehehe :rolmfao:

[Variables]
1="Dota Application"
2="LOL Application "

I try your suggestion Sir!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Possible To Select Image + Execute

Post by balala »

:o Sorry, but to be honest, I don't understand. :o