It is currently April 20th, 2024, 1:36 am

How to change a Meter in another Skin

Get help with creating, editing & fixing problems with skins
User avatar
krakoukas
Posts: 71
Joined: December 11th, 2018, 5:56 pm
Location: France

How to change a Meter in another Skin

Post by krakoukas »

Hi Friends,

What is the best way to change a Meter attribute though another skin ?
Thanks for helping

David
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to change a Meter in another Skin

Post by balala »

krakoukas wrote: July 19th, 2019, 4:12 pm What is the best way to change a Meter attribute though 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).
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.
User avatar
krakoukas
Posts: 71
Joined: December 11th, 2018, 5:56 pm
Location: France

Re: How to change a Meter in another Skin

Post by krakoukas »

balala 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:
  • 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).
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.
Thanks Balala

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\"")
Ecran-1-Module-16-Ratio-Kodi is my INI file for skin (Ecran-1-Module-16-Ratio-Kodi.ini) :

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
Interesting but no example : https://forum.rainmeter.net/viewtopic.php?f=119&t=9104&start=20
Last edited by krakoukas on July 20th, 2019, 10:34 am, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to change a Meter in another Skin

Post by jsmorley »

!SetOption doesn't know or care about .ini files. It acts on the config name of the skin.
User avatar
krakoukas
Posts: 71
Joined: December 11th, 2018, 5:56 pm
Location: France

Re: How to change a Meter in another Skin

Post by krakoukas »

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.
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')
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to change a Meter in another Skin

Post by jsmorley »

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')
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.
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to change a Meter in another Skin

Post by balala »

krakoukas wrote: July 20th, 2019, 10:38 am This syntax works for me with a BANG :
I'm glad you've got it working. :thumbup: