It is currently December 2nd, 2022, 11:12 pm

MoveMeter not showing my meter

Get help with creating, editing & fixing problems with skins
Deofol
Posts: 19
Joined: February 19th, 2020, 6:29 am

MoveMeter not showing my meter

Post by Deofol »

So, I'm making a skin to handle my game launchers: Steam, Epic, Rockstar and Nexon. So far I've got what I want working which is a generic icon switching to the steam icon on scroll over. I also want, however, icons for the other 3 launchers to scroll from behind my generic icon. I've been doing some testing with the !MoveMeter bang but when I use it on MouseOver, my meter (which right now is in front of the other 2 and I don't mind) just disappears behind my steam meter instead of moving like it should. Any idea what I'm doing wrong?
P.D: I also tried Redrawing the meter without success

Code: Select all

[Variables]
IconSize=48
IconText="P"
IconColor=2e2e2e
SteamPath=D:\Steam\Steam.exe
RockstarPath=D:\Rockstar Games\Launcher\LauncherPatcher.exe
EpicPath=D:\Epic Games\Launcher\Portal\Binaries\Win32\EpicGamesLauncher.exe
NexonPath=D:\Nexon\Nexon Launcher\nexon_launcher.exe

; https://forum.rainmeter.net/viewtopic.php?t=12802
[Fade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=0

[EpicFade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=0

[InvertedFade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=255

;[Move]
;Measure=Script
;ScriptFile="#@#Scripts\Fade.lua"
;Min=0
;Max=50
;Step=4
;Start=0

[TextSize]
Measure=Calc
Formula=#IconSize#/2

[TextPosition]
Measure=Calc
Formula=#IconSize#/2

[TextShadowPosition]
Measure=Calc
Formula=#IconSize#/4+3

[ControllerIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color #IconColor#
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[EpicIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color 0,0,0,255
MouseOverAction=[!CommandMeasure "EpicFade" "Activate('In')"]
MouseLeaveAction=[!CommandMeasure "EpicFade" "Activate('Out')"]
LeftMouseUpAction=["#EpicPath#"]
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[SteamIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Extend MyColor
MyColor=FillColor 42,71,94,[Fade]
MouseOverAction=[!CommandMeasure "Fade" "Activate('In')"][!CommandMeasure "InvertedFade" "Activate('Out')"][!SetOption "ControllerIconBackground" "MyColor" "FillColor 42,71,94,255]"][!MoveMeter "50" "50" "EpicIconBackground"]
MouseLeaveAction=[!CommandMeasure "Fade" "Activate('Out')"][!CommandMeasure "InvertedFade" "Activate('In')"][!SetOption "ControllerIconBackground" "MyColor" "FillColor #IconColor#"][!MoveMeter "0" "0" "EpicIconBackground"]
LeftMouseUpAction=["#SteamPath#"]
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[SteamIconShadow]
Meter=Image
ImageName=steam.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=[TextShadowPosition]
Y=[TextShadowPosition]
ImageTint=0,0,0,[Fade]
DynamicVariables=1
AntiAlias=1

[SteamIconImage]
Meter=Image
ImageName=steam.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=([TextPosition]/2)
Y=([TextPosition]/2)
ImageTint=255,255,255,[Fade]
DynamicVariables=1
AntiAlias=1

[ControllerIconImage]
Meter=Image
ImageName=controller.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=([TextPosition]/2)
Y=([TextPosition]/2)
ImageTint=255,255,255,[InvertedFade]
DynamicVariables=1
AntiAlias=1
Deofol
Posts: 19
Joined: February 19th, 2020, 6:29 am

Re: MoveMeter not showing my meter

Post by Deofol »

Forgot to mention: There are obvious non-working lines there. I'm editing a meter I had as a placeholder
User avatar
balala
Rainmeter Sage
Posts: 14756
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoveMeter not showing my meter

Post by balala »

Deofol wrote: February 25th, 2020, 6:53 am So, I'm making a skin to handle my game launchers: Steam, Epic, Rockstar and Nexon. So far I've got what I want working which is a generic icon switching to the steam icon on scroll over. I also want, however, icons for the other 3 launchers to scroll from behind my generic icon. I've been doing some testing with the !MoveMeter bang but when I use it on MouseOver, my meter (which right now is in front of the other 2 and I don't mind) just disappears behind my steam meter instead of moving like it should. Any idea what I'm doing wrong?
Unfortunately there is no way to help, because there are a lot of files which would be needed. For instance and most important, Fade.lua, but the images also. So, please pack the whole config you have and upload the package. This way we'll have all needed files and will be able to replicate what you get.
Deofol wrote: February 25th, 2020, 6:53 am P.D: I also tried Redrawing the meter without success
This step definitely can't help, because a redraw of the skin is done on every update cycle. Since your code uses the default Update=1000 (not being specified), the skin is redrawn every second, so redrawing it manually, definitely can't help.
Additionally note that when you redraw, you redraw the whole skin. Certain meter can't be redrawn, as said, this operation is related to the skin.
User avatar
Yincognito
Rainmeter Sage
Posts: 4817
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MoveMeter not showing my meter

Post by Yincognito »

balala wrote: February 25th, 2020, 11:04 am Unfortunately there is no way to help, because there are a lot of files which would be needed. For instance and most important, Fade.lua, but the images also. So, please pack the whole config you have and upload the package. This way we'll have all needed files and will be able to replicate what you get.
You probably didn't notice, but the OP linked before the [Fade] measure to a post by Kaelri in 2012. I believe the script is the same as advertised there...
User avatar
balala
Rainmeter Sage
Posts: 14756
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoveMeter not showing my meter

Post by balala »

Yincognito wrote: February 25th, 2020, 6:01 pm You probably didn't notice, but the OP linked before the [Fade] measure to a post by Kaelri in 2012. I believe the script is the same as advertised there...
Yep, I indeed didn't notice that link. The code of Fade.lua is that existing onto that link? Even if it is, the package would be anyway nice, in order to have not just the Fade.lua script file, but the other needed resources as well. Would be much mor easier for anyone to help. So, I'm still waiting for Deofol to upload it. Especially that: https://forum.rainmeter.net/viewtopic.php?f=5&t=28421#p148358
User avatar
Yincognito
Rainmeter Sage
Posts: 4817
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MoveMeter not showing my meter

Post by Yincognito »

balala wrote: February 25th, 2020, 6:18 pm Yep, I indeed didn't notice that link. The code of Fade.lua is that existing onto that link? Even if it is, the package would be anyway nice, in order to have not just the Fade.lua script file, but the other needed resources as well. Would be much mor easier for anyone to help. So, I'm still waiting for Deofol to upload it. Especially that: https://forum.rainmeter.net/viewtopic.php?f=5&t=28421#p148358
Yeah, don't worry, I figured it out - will post the solution right away.
User avatar
balala
Rainmeter Sage
Posts: 14756
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoveMeter not showing my meter

Post by balala »

Deofol wrote: February 25th, 2020, 6:53 am So, I'm making a skin to handle my game launchers: Steam, Epic, Rockstar and Nexon. So far I've got what I want working which is a generic icon switching to the steam icon on scroll over. I also want, however, icons for the other 3 launchers to scroll from behind my generic icon. I've been doing some testing with the !MoveMeter bang but when I use it on MouseOver, my meter (which right now is in front of the other 2 and I don't mind) just disappears behind my steam meter instead of moving like it should. Any idea what I'm doing wrong?
I suppose I just found an error in the posted code. There is an extra bracket into the first !SetOption bang of the MouseOverAction option of the [SteamIconBackground] meter. That should be removed. The bangs looks this way: [!SetOption "ControllerIconBackground" "MyColor" "FillColor 42,71,94,255]"]. The extra bracket is marked red above. Remove it and try out the code. Does it work as intended?
User avatar
balala
Rainmeter Sage
Posts: 14756
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoveMeter not showing my meter

Post by balala »

Yincognito wrote: February 25th, 2020, 6:27 pm Yeah, don't worry, I figured it out - will post the solution right away.
Oh, sorry Yincognito. Did you find the same error as me?
User avatar
Yincognito
Rainmeter Sage
Posts: 4817
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MoveMeter not showing my meter

Post by Yincognito »

Deofol wrote: February 25th, 2020, 6:53 am So, I'm making a skin to handle my game launchers: Steam, Epic, Rockstar and Nexon. So far I've got what I want working which is a generic icon switching to the steam icon on scroll over. I also want, however, icons for the other 3 launchers to scroll from behind my generic icon. I've been doing some testing with the !MoveMeter bang but when I use it on MouseOver, my meter (which right now is in front of the other 2 and I don't mind) just disappears behind my steam meter instead of moving like it should. Any idea what I'm doing wrong?
P.D: I also tried Redrawing the meter without success

Code: Select all

[Variables]
IconSize=48
IconText="P"
IconColor=2e2e2e
SteamPath=D:\Steam\Steam.exe
RockstarPath=D:\Rockstar Games\Launcher\LauncherPatcher.exe
EpicPath=D:\Epic Games\Launcher\Portal\Binaries\Win32\EpicGamesLauncher.exe
NexonPath=D:\Nexon\Nexon Launcher\nexon_launcher.exe

; https://forum.rainmeter.net/viewtopic.php?t=12802
[Fade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=0

[EpicFade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=0

[InvertedFade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=255

;[Move]
;Measure=Script
;ScriptFile="#@#Scripts\Fade.lua"
;Min=0
;Max=50
;Step=4
;Start=0

[TextSize]
Measure=Calc
Formula=#IconSize#/2

[TextPosition]
Measure=Calc
Formula=#IconSize#/2

[TextShadowPosition]
Measure=Calc
Formula=#IconSize#/4+3

[ControllerIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color #IconColor#
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[EpicIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color 0,0,0,255
MouseOverAction=[!CommandMeasure "EpicFade" "Activate('In')"]
MouseLeaveAction=[!CommandMeasure "EpicFade" "Activate('Out')"]
LeftMouseUpAction=["#EpicPath#"]
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[SteamIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Extend MyColor
MyColor=FillColor 42,71,94,[Fade]
MouseOverAction=[!CommandMeasure "Fade" "Activate('In')"][!CommandMeasure "InvertedFade" "Activate('Out')"][!SetOption "ControllerIconBackground" "MyColor" "FillColor 42,71,94,255]"][!MoveMeter "50" "50" "EpicIconBackground"]
MouseLeaveAction=[!CommandMeasure "Fade" "Activate('Out')"][!CommandMeasure "InvertedFade" "Activate('In')"][!SetOption "ControllerIconBackground" "MyColor" "FillColor #IconColor#"][!MoveMeter "0" "0" "EpicIconBackground"]
LeftMouseUpAction=["#SteamPath#"]
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[SteamIconShadow]
Meter=Image
ImageName=steam.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=[TextShadowPosition]
Y=[TextShadowPosition]
ImageTint=0,0,0,[Fade]
DynamicVariables=1
AntiAlias=1

[SteamIconImage]
Meter=Image
ImageName=steam.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=([TextPosition]/2)
Y=([TextPosition]/2)
ImageTint=255,255,255,[Fade]
DynamicVariables=1
AntiAlias=1

[ControllerIconImage]
Meter=Image
ImageName=controller.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=([TextPosition]/2)
Y=([TextPosition]/2)
ImageTint=255,255,255,[InvertedFade]
DynamicVariables=1
AntiAlias=1
It's a simple case of syntax error: the

Code: Select all

[!SetOption "ControllerIconBackground" "MyColor" "FillColor 42,71,94,255]"]
from [SteamIconBackground] should be

Code: Select all

[!SetOption "ControllerIconBackground" "MyColor" "FillColor 42,71,94,255"]
. You have an unwanted ] there, that's all.

EDIT: Also, be aware that if you leave the [!MoveMeter "0" "0" "EpicIconBackground"] in the MouseLeaveAction of the [SteamIconBackground] meter, you'll never get the chance to hover on the second (i.e. [EpicIconBackground]) meter, because it will move back behind the first meter when the mouse leaves the latter. The simplest solution here is to put the code / bangs in a mouse click action instead of in a hover one. However, since you already do something in LeftMouseUpAction, the solution might be undesirable. In this case you should use a couple of variables associated with each meter, that will be set to 1 when the mouse hovers over the associated meter and to 0 when not. Then, use another measure to test if all (or the relevant ones of) those variables are 0 before you move back associated meters behind other meters (in effect "hiding" them). Obviously, if all the said variables are 0, that means no associated meter is hovered on - i.e. one can safely "hide" the (supposedly) inactive/idle ones.

One other thing is that the fade doesn't seem to display for [EpicIconBackground]. I have no idea why, and lua scripts are not my domain of "expertise", so I'll leave another (if any) to figure out why that happens.
Last edited by Yincognito on February 25th, 2020, 6:58 pm, edited 2 times in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 4817
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MoveMeter not showing my meter

Post by Yincognito »

balala wrote: February 25th, 2020, 6:33 pm Oh, sorry Yincognito. Did you find the same error as me?
I believe I did. It took longer to post because I changed his code considerably to eliminate all possible issues, and forgot that I had to paste it back so that the skin isn't changed too much. :oops: