It is currently April 26th, 2024, 10:23 pm

ActionTimer Help

Get help with creating, editing & fixing problems with skins
ScyllaGames
Posts: 4
Joined: October 28th, 2018, 11:47 pm

ActionTimer Help

Post by ScyllaGames »

Hello I want to make a skin with dropdown menus. I have the dropdown menus down but I would like for it to like slide down or across from the button that is pressed. I looked up ActionTimer on the Rainmeter Manual but can't seem to get it to work. here's my code without the ActionTimer plugin. I'm new to creating skins in rainmeter so this might be to advanced for me but I would like to try to create this.

Code: Select all

[Rainmeter]
Update=1500
AccurateText=1
DynamicWindowSize=1
SolidColor=FFFFFF
BackgroundMode=1
LeftMouseDownAction=[!ShowMeterGroup "Dropdown"][!ShowMeter BackgroundImage][!ShowMeter GameText]
RightMouseDownAction=[!HideMeterGroup Dropdown]

[GameBackground]
Meter=Image
ImageName=#@#Images\MainMenuUp.png
W=200
H=50

[GameText]
Meter=String
Text=Games
FontFace=#Font#
FontSize=#FontSize#
X=#Xco#
Y=#Yco#
W=#Wd#
H=#Hd#
AntiAlias=#AA#
FontColor=255,20,60

[DropdownGroup]
Group=Dropdown


[Dropdown1]
Meter=Image
Group=Dropdown
Hidden=1
ImageName=#@#Images\SubMenu1.png
H=50
W=50
X=75
Y=55

[Dropdown2]
Meter=Image
Group=Dropdown
Hidden=1
ImageName=#@#Images\SubMenu1.png
H=50
W=50
X=75
Y=100
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ActionTimer Help

Post by balala »

ScyllaGames wrote: October 28th, 2018, 11:55 pm Hello I want to make a skin with dropdown menus. I have the dropdown menus down but I would like for it to like slide down or across from the button that is pressed. I looked up ActionTimer on the Rainmeter Manual but can't seem to get it to work. here's my code without the ActionTimer plugin. I'm new to creating skins in rainmeter so this might be to advanced for me but I would like to try to create this.
I don't have nor SubMenu1.png, nor MainMenuUp.png, both used in your code, however here is a first approach:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
SolidColor=FFFFFF
BackgroundMode=2
;LeftMouseUpAction=[!SetVariable ]
;RightMouseDownAction=[!HideMeterGroup Dropdown][!Redraw]

[Variables]
H=0
Open=0
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeterGroup "Dropdown"][!UpdateMeter "Uptime"][!Redraw]

[GameBackground]
Meter=Image
ImageName=#@#Images\MainMenuUp.png
W=200
H=50
LeftMouseUpAction=[!SetVariable Open "(1-#Open#)"][!UpdateMeasure "MeasureOpen"][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "Uptime"]
DynamicVariables=1

[MeasureOpen]
Measure=Calc
Formula=#Open#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
IfFalseAction=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
DynamicVariables=1

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Open,20,5
Open=[!SetVariable H "(Clamp((#H#+10),0,50))"]#U#
ActionList2=Repeat Close,20,5
Close=[!SetVariable H "(Clamp((#H#-10),0,50))"]#U#
DynamicVariables=1

[GameText]
Meter=String
Text=Games
FontFace=#Font#
FontSize=#FontSize#
X=#Xco#
Y=#Yco#
W=#Wd#
H=#Hd#
AntiAlias=#AA#
FontColor=255,20,60

[DropdownGroup]
Group=Dropdown

[Dropdown1]
Meter=Image
Group=Dropdown
;Hidden=1
ImageName=#@#Images\SubMenu1.png
H=#H#
W=50
X=75
Y=55
DynamicVariables=1

[Dropdown2]
Meter=Image
Group=Dropdown
;Hidden=1
ImageName=#@#Images\SubMenu1.png
H=#H#
W=50
X=0r
Y=3R
DynamicVariables=1

[Uptime]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#H# / #Open#
DynamicVariables=1
I modified your code a bit in the following terms:
  • I removed (commented out) the Hidden=1 options of the [Dropdown1] and [Dropdown2] meters. These options are not needed, because I hidden the meters not setting them to hidden, but setting their height to 0 (see the H option of both).
  • I introduced a H variable, which is the height of the [Dropdown1] and [Dropdown2] meters. This variable will be set dynamically by the newly added [MeasureSlide] ActionTimer plugin measure.
  • Because of the dynamically set H variable, I had to add a DynamicVariables=1 option to the [Dropdown1] and [Dropdown2] meters.
  • I added another few new variables: Open, which is 0 when the menu isn't open, respectively 1 when it's open; U is used by the ActionTimer plugin, stablishing which sections are updated when the plugin runs.
  • Based on the value of Open variable, the [MeasureOpen] measure starts / stops running the ActionTimer plugin measure, whenever the value of this variable changes.
  • I removed the LeftMouseDownAction and RightMouseDownAction options of [Rainmeter] section, adding one single LeftMouseUpAction option to [GameBackground]. This LeftMouseUpAction option does both, opens and closes the menu, setting the value of the Open variable. This was needed because the [Rainmeter] section doesn't support dynamic variables, but the section used to open / close the menu should have to. Because of this, beside adding the LeftMouseUpAction, I also added a DyanmicVariables=1 option to [GameBackground] (note here that LeftMouseUpAction is always preferred in front of LeftMouseDownAction, here can you find out why).
  • I replaced the Update=1500 option of [Rainmeter] section, with the default Update=1000.
  • I modified the BackgroundMode=1 option of [Rainmeter] section to BackgroundMode=2. BackgroundMode=1 option means transparent background and if you set this, the SolidColor isn't needed.
Please test the above code (which can be improved, being just a first quickly written code) and let me know how does it work.
ScyllaGames
Posts: 4
Joined: October 28th, 2018, 11:47 pm

Re: ActionTimer Help

Post by ScyllaGames »

balala wrote: October 29th, 2018, 5:14 pm I don't have nor SubMenu1.png, nor MainMenuUp.png, both used in your code, however here is a first approach:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
SolidColor=FFFFFF
BackgroundMode=2
;LeftMouseUpAction=[!SetVariable ]
;RightMouseDownAction=[!HideMeterGroup Dropdown][!Redraw]

[Variables]
H=0
Open=0
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeterGroup "Dropdown"][!UpdateMeter "Uptime"][!Redraw]

[GameBackground]
Meter=Image
ImageName=#@#Images\MainMenuUp.png
W=200
H=50
LeftMouseUpAction=[!SetVariable Open "(1-#Open#)"][!UpdateMeasure "MeasureOpen"][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "Uptime"]
DynamicVariables=1

[MeasureOpen]
Measure=Calc
Formula=#Open#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
IfFalseAction=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
DynamicVariables=1

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Open,20,5
Open=[!SetVariable H "(Clamp((#H#+10),0,50))"]#U#
ActionList2=Repeat Close,20,5
Close=[!SetVariable H "(Clamp((#H#-10),0,50))"]#U#
DynamicVariables=1

[GameText]
Meter=String
Text=Games
FontFace=#Font#
FontSize=#FontSize#
X=#Xco#
Y=#Yco#
W=#Wd#
H=#Hd#
AntiAlias=#AA#
FontColor=255,20,60

[DropdownGroup]
Group=Dropdown

[Dropdown1]
Meter=Image
Group=Dropdown
;Hidden=1
ImageName=#@#Images\SubMenu1.png
H=#H#
W=50
X=75
Y=55
DynamicVariables=1

[Dropdown2]
Meter=Image
Group=Dropdown
;Hidden=1
ImageName=#@#Images\SubMenu1.png
H=#H#
W=50
X=0r
Y=3R
DynamicVariables=1

[Uptime]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#H# / #Open#
DynamicVariables=1
I modified your code a bit in the following terms:
  • I removed (commented out) the Hidden=1 options of the [Dropdown1] and [Dropdown2] meters. These options are not needed, because I hidden the meters not setting them to hidden, but setting their height to 0 (see the H option of both).
  • I introduced a H variable, which is the height of the [Dropdown1] and [Dropdown2] meters. This variable will be set dynamically by the newly added [MeasureSlide] ActionTimer plugin measure.
  • Because of the dynamically set H variable, I had to add a DynamicVariables=1 option to the [Dropdown1] and [Dropdown2] meters.
  • I added another few new variables: Open, which is 0 when the menu isn't open, respectively 1 when it's open; U is used by the ActionTimer plugin, stablishing which sections are updated when the plugin runs.
  • Based on the value of Open variable, the [MeasureOpen] measure starts / stops running the ActionTimer plugin measure, whenever the value of this variable changes.
  • I removed the LeftMouseDownAction and RightMouseDownAction options of [Rainmeter] section, adding one single LeftMouseUpAction option to [GameBackground]. This LeftMouseUpAction option does both, opens and closes the menu, setting the value of the Open variable. This was needed because the [Rainmeter] section doesn't support dynamic variables, but the section used to open / close the menu should have to. Because of this, beside adding the LeftMouseUpAction, I also added a DyanmicVariables=1 option to [GameBackground] (note here that LeftMouseUpAction is always preferred in front of LeftMouseDownAction, here can you find out why).
  • I replaced the Update=1500 option of [Rainmeter] section, with the default Update=1000.
  • I modified the BackgroundMode=1 option of [Rainmeter] section to BackgroundMode=2. BackgroundMode=1 option means transparent background and if you set this, the SolidColor isn't needed.
Please test the above code (which can be improved, being just a first quickly written code) and let me know how does it work.
Thank you for taking your time and helping me! I looked over everything and the reasons why you modified my code and I am grateful. I made a copy of the skin ini file and when I loaded it up this happened https://gyazo.com/4add89fe94d8710fef45858ab6b0ad8c . And everytime I click on it it seems to do this https://gyazo.com/5013b63ea85dc0a8268081db572ea1b5 .And none of my submenu1.png show up.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ActionTimer Help

Post by balala »

ScyllaGames wrote: October 29th, 2018, 9:00 pm Thank you for taking your time and helping me! I looked over everything and the reasons why you modified my code and I am grateful. I made a copy of the skin ini file and when I loaded it up this happened https://gyazo.com/4add89fe94d8710fef45858ab6b0ad8c . And everytime I click on it it seems to do this https://gyazo.com/5013b63ea85dc0a8268081db572ea1b5 .And none of my submenu1.png show up.
Yep, you're perfectly right. I'm sorry, I put at the end of the code a [Uptime] String meter, for seeing the variables. Before I posted the code, I should had to remove this meter, but forgot it. My bad! So, please remove it.
If it doesn't work properly, please pack the whole config you have and upload it. I'd need the resource files (images), to can properly check what's going on.
ScyllaGames
Posts: 4
Joined: October 28th, 2018, 11:47 pm

Re: ActionTimer Help

Post by ScyllaGames »

balala wrote: October 29th, 2018, 9:11 pm Yep, you're perfectly right. I'm sorry, I put at the end of the code a [Uptime] String meter, for seeing the variables. Before I posted the code, I should had to remove this meter, but forgot it. My bad! So, please remove it.
If it doesn't work properly, please pack the whole config you have and upload it. I'd need the resource files (images), to can properly check what's going on.
Oh no I completely understand why you put that variable in a string. I do a little programming myself(visual basic currently learning JS) so it's understandable. I'll make a link with the whole folder including the resources. If it wasn't that obvious by the [GameText] meter I made a .inc file for variables but have yet to create one for Colors.inc(for modifying all the colors in the skin such as the text and possibly the shape if I change to use the rainmeter shapes instead of an image). thanks again for the fast reply as well! I'll PM you the download.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ActionTimer Help

Post by balala »

ScyllaGames wrote: October 29th, 2018, 9:18 pm I'll PM you the download.
Don't PM. Post it publicly. Maybe someone will have a better idea or solution then me.
ScyllaGames
Posts: 4
Joined: October 28th, 2018, 11:47 pm

Re: ActionTimer Help

Post by ScyllaGames »

balala wrote: October 29th, 2018, 9:24 pm Don't PM. Post it publicly. Maybe someone will have a better idea or solution then me.
Alright. Link to File: Removed Link...
Last edited by eclectic-tech on October 30th, 2018, 12:15 am, edited 1 time in total.
Reason: Removed link. Reason: Link initiates an attack by malware!