It is currently May 21st, 2024, 3:51 pm

Help: Switching wallpapers with a button

Get help with creating, editing & fixing problems with skins
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 10th, 2020, 11:10 pm And this is the result, for now. I'll continue tomorrow, as I'm in the mood for relax time, a movie and such.


You can manually play with it in the meantime to see how it looks and behaves, by modifying (negatively or positively, doesn't matter) the X=0r from the sliding panel meter. Tomorrow we'll take care of the animation, unless balala arives here sooner than me and uses his ActionTimer skills to implement it, that is... :lol:

P.S. You can try making the container meter visible (i.e. commenting the Container=... line) to see its position and compare, but don't forget to uncomment afterwards, to revert to the desired behavior.
Great I'll try that.

I might be off a few days, since I have unfinished and not-wanting-to-do work that is due in a few day.
User avatar
Yincognito
Rainmeter Sage
Posts: 7296
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 10th, 2020, 11:16 pm Great I'll try that.

I might be off a few days, since I have unfinished and not-wanting-to-do work that is due in a few day.
Okeydokey.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Very neat !
Now I can "prepare" the next meters accordingly, I'll put them facing to the right, that will be easier.

EDIT :
-For the movement I'd like:
-> When sliding out X=0r is perfect
-> When sliding in X=105r is perfect
User avatar
Yincognito
Rainmeter Sage
Posts: 7296
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 10th, 2020, 11:26 pm Very neat !
Now I can "prepare" the next meters accordingly, I'll put them facing to the right, that will be easier.

EDIT :
-For the movement I'd like:
-> When sliding out X=0r is perfect
-> When sliding in X=105r is perfect
Ok, so it's done on my side. Let me know if you're available, cause I have a proposition if you do... :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 11th, 2020, 2:49 pm Ok, so it's done on my side. Let me know if you're available, cause I have a proposition if you do... :D
Yes, i'm all ears !

EDIT : i've already all the rest of my meters set, based on the sliding panel when it's out. I can add here if needed
User avatar
Yincognito
Rainmeter Sage
Posts: 7296
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 11th, 2020, 4:36 pm Yes, i'm all ears !
Ok. Having in mind that my code is waiting for you anyway, why not trying to make it work on your own and see what you can come up with? You have all the needed elements to succeed with this, if you browse a little through our conversations recently. Hint: the final result should not take more than 73 lines of code.

The above is only if you want to. If you don't or you're in a hurry to develop your code even further or something like that, I'll just post the result and proceed with the next stuff on the horizon (if any).

P.S. Of course, based on your edit, you should make a backup of your working code first, before trying the above, just to be sure.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 11th, 2020, 4:43 pm Ok. Having in mind that my code is waiting for you anyway, why not trying to make it work on your own and see what you can come up with? You have all the needed elements to succeed with this, if you browse a little through our conversations recently. Hint: the final result should not take more than 73 lines of code.
Okay, a lil work by myself is always welcomed.
I guess a [!Move] bang shoudl do it, no ?
The above is only if you want to. If you don't or you're in a hurry to develop your code even further or something like that, I'll just post the result and proceed with the next stuff on the horizon (if any).
yep i'll need for a next skin after this one.
P.S. Of course, based on your edit, you should make a backup of your working code first, before trying the above, just to be sure.
Okay I see, it's all positionned relatively so that wouldn't be such a problem after.

EDIT : actiontimer plugin actually, if I base it like the skin with the hexagons sliding.
User avatar
Yincognito
Rainmeter Sage
Posts: 7296
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 11th, 2020, 4:57 pmI guess a [!Move] bang shoudl do it, no ?
Mino_el_Nukenin wrote: May 11th, 2020, 4:57 pmEDIT : actiontimer plugin actually, if I base it like the skin with the hexagons sliding.
I won't say anything... :p
But one of these choices is the right one, that much I can tell you. 8-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 11th, 2020, 5:07 pm I won't say anything... :p
But one of these choices is the right one, that much I can tell you. 8-)
Okay I came up with a code, but not working.
Not sure what I missed. I based it on the hexagons one.

These are the codes i've added : [Variables] for the posisions of the panel + a [MeasureSlider] for the movement (there might be the errors) + some [Action] on the main button.
See for yourself:

Code: Select all

[Variables]
@IncludeConfig=#@#\Config.inc
State=0

HexaWidth=130
HexaHeight=25
State1=1
Speed=3
Repeat=1
OffsetX2=110
OffsetY2=0
U1=[!UpdateMeasure "MeasureSlider"][!UpdateMeter MeterSlidingPanel][!Redraw]

--- Styles---

[StyleImage]
AntiAlias=1
X=16
Y=11r

[StyleIcons]
AntiAlias=1
X=(24+Sgn(#State#)*8)r
Y=(2+Sgn(#State#)*8)r
W=30
H=30

[StyleText]
FontFace=Gliscor Gothic
FontSize=12
FontWeight=700
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=255,255,255,255
StringAlign=LeftBottom
AntiAlias=1
X=5R
Y=5R

--- Measures ---
[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideOut1,#Speed#,#Repeat#
SlideOut1=[!SetVariable State1 "2"][!SetVariable OffSetX2 (#OffSetX2#-110)][!SetVariable OffSetY2 (#OffSetY2#)]#U1#
ActionList2=Repeat SlideIn1,#Speed#,#Repeat#
SlideIn1=[!SetVariable State1 "1"][!SetVariable OffSetX2 (#OffSetX2#+110)][!SetVariable OffSetY2 (#OffSetY2#)]#U1#
DynamicVariables=1

--- Meter Container And Contents ---

[MeterContainer]
Meter=Image
ImageName=#@#\Images\Large Launchers2\Container.png
X=0
Y=0
Antialias=1
UpdateDivider=-1
DynamicVariables=1

[MeterSlidingPanel]
Container=MeterContainer
Meter=Image
ImageName=#@#\Images\Large Launchers2\Sliding Panel.png
X=0r
Y=0r
Antialias=1
DynamicVariables=1

--- Meter Main Button ---

[MeterButton]
Meter=Button
ButtonImage=#@#\Images\Large Launchers2\Button.png
X=123
Y=0
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Stop #State1#"][!CommandMeasure MeasureSlider "Execute #State1#"][!Redraw]
MouseOverAction=[!CommandMeasure MeasureSlider "Execute #State1#"][!Redraw]
MouseLeaveAction=[!CommandMeasure MeasureSlider "Stop #State1#"][!Redraw]
Antialias=1
DynamicVariables=1
User avatar
Yincognito
Rainmeter Sage
Posts: 7296
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 11th, 2020, 5:23 pm Okay I came up with a code, but not working.
Not sure what I missed. I based it on the hexagons one.

These are the codes i've added : [Variables] for the posisions of the panel + a [MeasureSlider] for the movement (there might be the errors) + some [Action] on the main button. See for yourself.
You came pretty close, nice attempt. Here is my code, you can compare the differences and see where you were "off track". You weren't much wrong though, and almost nailed it:

Code: Select all

[Variables]
State=1
Speed=2
Repeat=105
Wait=5
Offset=105
U=[!UpdateMeasure "MeasureSlider"][!UpdateMeterGroup SlidingMeters][!Redraw]

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!DisableMouseActionGroup "LeftMouseUpAction" SlidingMeters]

--- Sliding Buttons Measures---

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideOut,#Speed#,#Repeat# | Wait #Wait# | EnableMouseSlidingMeters
SlideOut=[!SetVariable State "2"][!SetVariable Offset (#Offset#-1)]#U#
EnableMouseSlidingMeters=[!EnableMouseActionGroup "LeftMouseUpAction" SlidingMeters]
ActionList2=Repeat SlideIn,#Speed#,#Repeat# | Wait #Wait# | DisableMouseSlidingMeters
SlideIn=[!SetVariable State "1"][!SetVariable Offset (#Offset#+1)]#U#
DisableMouseSlidingMeters=[!DisableMouseActionGroup "LeftMouseUpAction" SlidingMeters]
DynamicVariables=1

--- Meter Container And Contents ---

[MeterContainer]
Meter=Image
ImageName=#@#\Images\Large Launchers2\Container.png
X=0
Y=0
Antialias=1
DynamicVariables=1

[MeterSlidingPanel]
Group=SlidingMeters
Container=MeterContainer
Meter=Image
ImageName=#@#\Images\Large Launchers2\Sliding Panel.png
X=(#Offset#)r
Y=0r
Antialias=1
LeftMouseUpAction=[Notepad]
DynamicVariables=1

[MeterSlidingPanelText]
Group=SlidingMeters
Container=MeterContainer
Meter=String
FontFace=Tahoma
FontSize=10
FontColor=255,255,255,255
StringEffect=Shadow
FontEffectColor=0,0,0,255
X=20r
Y=3r
Antialias=1
Text=Run Notepad
DynamicVariables=1

--- Meter Main Button ---

[MeterButton]
Meter=Button
ButtonImage=#@#\Images\Large Launchers2\Button.png
X=123
Y=0
Antialias=1
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Stop #State#"][!CommandMeasure MeasureSlider "Execute #State#"]
DynamicVariables=1
There is still a need to selectively disable / enable the mouse actions apparently, as otherwise "notepad" will get executed when clicking the opaque pixels of the panel even though they are "hidden" under the button.

P.S. If you want to slide faster (i.e. increment or decrement #Offset# by a larger amount), you should set the Repeat value so that #Repeat# * #AmountOfIncrementOrDecrement# = 105 (aka the sliding interval), or use Clamp() function to limit / restrict #Offset# +/- #AmountOfIncrementOrDecrement# to the 0, 105 interval.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth