Hi Friends,
What is the best way to change a Meter attribute though another skin ?
Thanks for helping
David
It is currently April 20th, 2024, 1:36 am
How to change a Meter in another Skin
-
- Posts: 71
- Joined: December 11th, 2018, 5:56 pm
- Location: France
-
- Rainmeter Sage
- Posts: 16147
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to change a Meter in another Skin
Depends on how would you like to change it. You either have to use a !WriteKeyValue bang, if you want to make a permanent change, or a !SetOption bang for a dynamic change. Anyway you have to a last parameter to the appropriate bang, to tell it to apply the change into another skin then the current one:
- For permanent change: [!WriteKeyValue Variables VarToChange "NewValue" "#SKINSPATH#ConfigToChangeIn\SkinToChangeIn.ini"] (replace the VarToChange, NewValue and #SKINSPATH#ConfigToChangeIn\SkinToChangeIn.ini to whatever needed - hope you can figure out what are required here).
- For dynamic change: [!SetOption MeterToChangeIn OptionToChange "NewValue" "ConfigToChangeIn"] (same way you have to use the appropriate values for MeterToChangeIn, OptionToChange, NewValue and ConfigToChangeIn).
-
- Posts: 71
- Joined: December 11th, 2018, 5:56 pm
- Location: France
Re: How to change a Meter in another Skin
Thanks Balalabalala wrote: ↑July 19th, 2019, 5:10 pm Depends on how would you like to change it. You either have to use a !WriteKeyValue bang, if you want to make a permanent change, or a !SetOption bang for a dynamic change. Anyway you have to a last parameter to the appropriate bang, to tell it to apply the change into another skin then the current one:Note the difference: while in the !WriteKeyValue bang you have to write the full path of the file you want to write the change permanently, into the !SetOption bang you have to use only the name of the config which has the skin which contains the meter in which you want to make the dynamic change.
- For permanent change: [!WriteKeyValue Variables VarToChange "NewValue" "#SKINSPATH#ConfigToChangeIn\SkinToChangeIn.ini"] (replace the VarToChange, NewValue and #SKINSPATH#ConfigToChangeIn\SkinToChangeIn.ini to whatever needed - hope you can figure out what are required here).
- For dynamic change: [!SetOption MeterToChangeIn OptionToChange "NewValue" "ConfigToChangeIn"] (same way you have to use the appropriate values for MeterToChangeIn, OptionToChange, NewValue and ConfigToChangeIn).
I need dynamic changes. I tried both of these in LUA, but they don't work :
Code: Select all
UploadTotalTorrent=**DEBUG**
SKIN:Bang('!SetOption', 'Meter_Boite_04_Instantane', 'Text', UploadTotalTorrent, 'Ecran-1-Module-16-Ratio-Kodi')
SKIN:Bang("!SetOption Meter_Boite_04_Instantane Text \""..UploadTotalTorrent.."\" \"Ecran-1-Module-16-Ratio-Kodi\"")
Code: Select all
[Meter_Boite_04_Instantane]
Meter=String
; MeasureName=MeasureUp
MeterStyle=Style-Boite
x=37r
Y=-2r
Text=15 xxx
NumOfDecimals=1
AutoScale=1
Last edited by krakoukas on July 20th, 2019, 10:34 am, edited 2 times in total.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How to change a Meter in another Skin
!SetOption doesn't know or care about .ini files. It acts on the config name of the skin.
-
- Posts: 71
- Joined: December 11th, 2018, 5:56 pm
- Location: France
Re: How to change a Meter in another Skin
GREAT ! Thank you JsMorley !jsmorley wrote: ↑July 20th, 2019, 10:32 am !SetOption doesn't know or care about .ini files. It acts on the config name of the skin.
This syntax works for me with a BANG :
Code: Select all
SKIN:Bang('!SetOption', 'Meter_Boite_04_Instantane', 'Text', UploadTotalTorrent, 'PRED\\Ecran-1-Module-16-Ratio-Kodi')
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How to change a Meter in another Skin
Great. Note that this is a case, where you are defining an element of a string in Lua, where the reserved \ character must be escaped with \\ in order to get the literal \ to be passed.krakoukas wrote: ↑July 20th, 2019, 10:38 am GREAT ! Thank you JsMorley !
This syntax works for me with a BANG :
Code: Select all
SKIN:Bang('!SetOption', 'Meter_Boite_04_Instantane', 'Text', UploadTotalTorrent, 'PRED\\Ecran-1-Module-16-Ratio-Kodi')
-
- Rainmeter Sage
- Posts: 16147
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to change a Meter in another Skin
I'm glad you've got it working.