It is currently May 4th, 2024, 4:13 pm

Need help with changing picture

Get help with creating, editing & fixing problems with skins
arkemiffo
Posts: 2
Joined: August 5th, 2012, 5:34 pm

Need help with changing picture

Post by arkemiffo »

Hello,

I'm very new to modding rainmeter. In fact I started today with it.
One of my wishes was to be able to switch the player (using 2 different) used for NowPlaying seamlessly.

I've created 4 buttons, one active, one passive for each of the players, and the mouseover seems to work just fine. The problem is when I press the button. The code for it looks like this:

Code: Select all

LeftMouseUpAction=[!SetVariable "PlayerName" "Spotify"][!ShowMeter ButtonVLCActive][!HideMeter ButtonSpotifyActive][!Refresh][!Update]
VLC is defaulted to start, and this button should change it to Spotify (and show a button for VLC again). I have the opposite code as well.

The problem is that when I'm pressing this button I only see the VLC button flash once and then returns to the Spotify button, and the variable does not change either.

Any help appreciated.
Can it be done? If so, what am I doing wrong?

Kind regards
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Need help with changing picture

Post by Kaelri »

The problem is that the !Refresh command resets and reloads the skin to its original state. If you remove the [!Refresh], it should be fine, as long as there are no other problems.

(If there are, it would help if you could post the entire skin code so we can see what's really happening.)
arkemiffo
Posts: 2
Joined: August 5th, 2012, 5:34 pm

Re: Need help with changing picture

Post by arkemiffo »

Thanks for the quick answer.
Unfortunately it didnt work, but gave similar result, but the flash of the new button is even quicker now. Before I could see the new button, but now I only see the old button flickering once when pressed.

Not sure if you wanted the whole ini file, or if its enough with just the code for the buttons, but from what I understand that is the only thing that would matter. Please correct me if I'm wrong.

The skin I'm modifying is the Skyrim v2 from Axxon. This is basically the only thing I have changed in this file anyway.

Code: Select all

[ButtonVLCPassive]
Meter=Image
ImageName=#ROOTCONFIGPATH#Resources\skyrim_button_VLC_passive.png
x=0
y=240
W=50
H=26
AntiAlias=1
Hidden=1
MouseOverAction=[!ShowMeter ButtonVLCActive][!HideMeter ButtonVLCPassive][!Update]

[ButtonVLCActive]
Meter=Image
ImageName=#ROOTCONFIGPATH#Resources\skyrim_button_VLC_active.png
x=r
y=r
W=50
H=26
AntiAlias=1
Hidden=1
MouseLeaveAction=[!ShowMeter ButtonVLCPassive][!HideMeter ButtonVLCActive][!Update]
LeftMouseUpAction=[!SetVariable "PlayerName" "CAD"][!ShowMeter ButtonSpotifyActive][!HideMeter ButtonVLCActive][!Update]

[ButtonSpotifyPassive]
Meter=Image
ImageName=#ROOTCONFIGPATH#Resources\skyrim_button_Spotify_passive.png
x=0
y=240
W=50
H=26
AntiAlias=1
MouseOverAction=[!ShowMeter ButtonSpotifyActive][!HideMeter ButtonSpotifyPassive][!Update]

[ButtonSpotifyActive]
Meter=Image
ImageName=#ROOTCONFIGPATH#Resources\skyrim_button_Spotify_active.png
x=r
y=r
W=50
H=26
AntiAlias=1
Hidden=1
MouseLeaveAction=[!ShowMeter ButtonSpotifyPassive][!HideMeter ButtonSpotifyActive][!Update]
LeftMouseUpAction=[!SetVariable "PlayerName" "Spotify"][!ShowMeter ButtonVLCActive][!HideMeter ButtonSpotifyActive][!Update]
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Need help with changing picture

Post by Kaelri »

Mixing mouseover actions and show/hide actions can be tricky. I would recommend simplifying your buttons by using only two meters, and use mouseover actions to change the images rather than show a different meter.

Code: Select all

[ButtonVLC]
Meter=Image
ImageName=#ROOTCONFIGPATH#Resources\skyrim_button_VLC_passive.png
X=0
Y=240
W=50
H=26
AntiAlias=1
Hidden=1
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#ROOTCONFIGPATH#Resources\skyrim_button_VLC_active.png"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "#ROOTCONFIGPATH#Resources\skyrim_button_VLC_passive.png"][!Update]
LeftMouseUpAction=[!SetVariable PlayerName "CAD"][!ShowMeter ButtonSpotify][!HideMeter ButtonVLC][!Update]

[ButtonSpotifyPassive]
Meter=Image
ImageName=#ROOTCONFIGPATH#Resources\skyrim_button_Spotify_passive.png
X=r
Y=r
W=50
H=26
AntiAlias=1
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#ROOTCONFIGPATH#Resources\skyrim_button_Spotify_active.png"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "#ROOTCONFIGPATH#Resources\skyrim_button_Spotify_passive.png"][!Update]
LeftMouseUpAction=[!SetVariable PlayerName "Spotify"][!ShowMeter ButtonVLC][!HideMeter ButtonSpotify][!Update]