It is currently March 29th, 2024, 2:57 pm

Skin not working as intended

Get help with creating, editing & fixing problems with skins
Greyrat
Posts: 28
Joined: July 8th, 2016, 10:28 am

Skin not working as intended

Post by Greyrat »

I need help with my skin,I'm trying to make an alternative for my recycling bin:
Image
What I intended to happen was,whenever the bin was full,it would show recycle1.png and recycle2.png if it was empty. Instead, only background2.png is shown. The mouse action works.

Here is the .ini file:
[Rainmeter]
Update=1000

;---------------------

[MeasureBin]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
Drives=C:
UpdateDivider=2

;----------------------


[Background]
Meter=Image
ImageName=#@#Background2.png
H=80
W=70


[MeterEmpty]
Meter=Image
MeasureName=MeasureBin
ImageName=#@#recycle2.png
X=12
Y=18
H=48
W=48
Hidden=0
LeftMouseUpAction =!execute [::{645FF040-5081-101B-9F08-00AA002F954E}]


[MeterFull]
Meter=Image
MeasureName=MeasureBin
ImageName=#@#recycle1.png
X=12
Y=18
H=48
W=48
Hidden=1
LeftMouseUpAction =!execute [::{645FF040-5081-101B-9F08-00AA002F954E}]

[BinAction]
Measure=Calc
Formula=MeasureBin
IfAboveAction=!execute [!Hide MeterEmpty][!Show MeterFull][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfEqualAction=!execute [!Hide MeterFull][!Show MeterEmpty][!UpdateMeter *][!Redraw]
IfEqualValue=0
Edit: I tried using a string meter and it works properly,so I don't think its the bin measure.
[Rainmeter]
update=1000

;---------------

[MeasureBin]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
Drives=C:
UpdateDivider=2

[MeterBinText]
Meter=String
MeasureName=MeasureBin
FontSize=11
FontColor=255,255,255,255
AutoScale=1
AntiAlias=1
Text=Used Size: %1
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin not working as intended

Post by balala »

There is an issue with the bangs used in the IfAboveAction and IfEqualAction options of the [BinAction] measure. There zou should have to use not the !Show and !Hide bangs (which are used to show and hide a loaded skin, not a meter of the current skin), but the !ShowMeter and !HideMeter bangs, accordingly. Just replace them:

Code: Select all

[BinAction]
Measure=Calc
Formula=MeasureBin
IfAboveAction=!execute [!HideMeter MeterEmpty][!ShowMeter MeterFull][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfEqualAction=!execute [!HideMeter MeterFull][!ShowMeter MeterEmpty][!UpdateMeter *][!Redraw]
IfEqualValue=0
Tip: In this case the [!UpdateMeter *] bangs, used in both options are useless. The [!Redraw] not, it can remain there, but the !UpdateMeter has no sense. I recommend to remove it.
Greyrat
Posts: 28
Joined: July 8th, 2016, 10:28 am

Re: Skin not working as intended

Post by Greyrat »

It didn't work.Also,if I remove the background meter,the skin doesn't show up at all.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin not working as intended

Post by balala »

Greyrat wrote:Also,if I remove the background meter,the skin doesn't show up at all.
I'm sorry, but I don't believe. This would be true if you would have not a meter used as background, but a Background option in the [Rainmeter] section. Then indeed removing that option would make the skin to not appear at all. But [Background] is a simple meter, if you remove it, the other meters (at least those which are not hidden) should show up. And I also tried and the appropriate image meter (either [MeterEmpty] or [MeterFull]) shows up.

Also not sure why my solution doesn't work. I tried it before I posted my solution (as usual) and it works for me. Please post again the fixed whole code of your skin.
Greyrat
Posts: 28
Joined: July 8th, 2016, 10:28 am

Re: Skin not working as intended

Post by Greyrat »

Here you go
Rainmeter]
Update=1000

;---------------------

[MeasureBin]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
Drives=C:
UpdateDivider=2

;----------------------


[Background]
Meter=Image
ImageName=#@#Background2.png
H=80
W=70


[MeterEmpty]
Meter=Image
MeasureName=MeasureBin
ImageName=#@#recycle2.png
X=12
Y=18
H=48
W=48
Hidden=0
LeftMouseUpAction =!execute [::{645FF040-5081-101B-9F08-00AA002F954E}]


[MeterFull]
Meter=Image
MeasureName=MeasureBin
ImageName=#@#recycle1.png
X=12
Y=18
H=48
W=48
Hidden=1
LeftMouseUpAction =!execute [::{645FF040-5081-101B-9F08-00AA002F954E}]

[BinAction]
Measure=Calc
Formula=MeasureBin
IfAboveAction=!execute [!HideMeter MeterEmpty][!ShowMeter MeterFull][!Redraw]
IfAboveValue=0
IfEqualAction=!execute [!HideMeter MeterFull][!ShowMeter MeterEmpty][!Redraw]
IfEqualValue=0
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin not working as intended

Post by balala »

Although I don't have the needed image files, I used some others and the code is working for me. I also tried to remove the [Background] meter and the appropriate image meter (either [MeterEmpty] or [MeterFull]) shows up properly.
I found just one minor error in the last code: the first bracket in the [Rainmeter] section name is missing. Replace the Rainmeter] name with [color=#FF0000][[/color]Rainmeter].
If you still can't get it to work properly, please pack the config and upload it, to can check it with your image files.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Skin not working as intended

Post by eclectic-tech »

Just a suggestion...

Since both meters are identical and only the image is being changed, the code can be simplified to 1 meter and change the image option.

Also, since you already have a measure for the bin size, move the IfAbove actions to that measure. There is no need for a seperate calc measure.

You appear to have modified the original illustro background to be a single color, so I created your images, 80x70 background and 48x48 recycles, and use the code below.

Code: Select all

[Rainmeter]
Update=1000
Background=#@#Background2.png
; ; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3

;---------------------

[MeasureBin]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
Drives=C:
UpdateDivider=2
IfAboveAction=[!SetOption MeterBin ImageName "#@#recycle1.png"][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfEqualAction=[!SetOption MeterBin ImageName "#@#recycle2.png"][!UpdateMeter *][!Redraw]
IfEqualValue=0
;----------------------


[MeterBin]
Meter=Image
ImageName=#@#recycle1.png
X=12
Y=18
H=48
W=48
LeftMouseUpAction=[::{645FF040-5081-101B-9F08-00AA002F954E}]
Sorry to change the direction of this thread, but I hope this helps by showing an alternate way to achieve the end result.
rc2.png
You do not have the required permissions to view the files attached to this post.
Greyrat
Posts: 28
Joined: July 8th, 2016, 10:28 am

Re: Skin not working as intended

Post by Greyrat »

Here you go:
https://www.dropbox.com/s/lvtvmowqklgc620/not%20working_-.rmskin?dl=0

@eclectic-tech,thank you,however it still won't change images for me.Would my rainmeter version have anything to do with this?I'm using 4.0.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin not working as intended

Post by jsmorley »

Greyrat wrote:Here you go:
https://www.dropbox.com/s/lvtvmowqklgc620/not%20working_-.rmskin?dl=0

@eclectic-tech,thank you,however it still won't change images for me.Would my rainmeter version have anything to do with this?I'm using 4.0.
In this measure:

Code: Select all

[MeterEmpty]
Meter=Image
;MeasureName=MeasureBin
ImageName=#@#recycle2.png
X=12
Y=18
H=48
W=48
Hidden=0
LeftMouseUpAction =!execute [::{645FF040-5081-101B-9F08-00AA002F954E}]
Remove that line MeasureName=MeasureBin. That is telling it to look for an image called 0.png when the bin is empty, and 39383.png or whatever when the bin has items in it. It's not needed, and it what is causing it to not work. It is overriding the ImageName=#@#recycle2.png option.
Greyrat
Posts: 28
Joined: July 8th, 2016, 10:28 am

Re: Skin not working as intended

Post by Greyrat »

It worked!Thanks a lot.