It is currently April 27th, 2024, 1:27 pm

[solved] !ActivateConfig Giving Warning, How to Workaround?

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

[solved] !ActivateConfig Giving Warning, How to Workaround?

Post by CodeCode »

Hello,

I have a fairly basic code segment. It is ActivatingConfig depending on a variable. Like THis:

Code: Select all

[VisualToggleO]
Meter=Shape
Shape=Rectangle 154,292,54,54,26 | StrokeWidth 0 | Fill 0,0,0,1
LeftMouseUpAction=[!SetVariable Beta "(abs((#Beta#-1)%2))"][!WriteKeyValue Variables Beta "[#Beta]" "#@#MainVariables.inc"][!SetVariable Minimal "(abs((#Minimal#-1)%2))"][!WriteKeyValue Variables Minimal "[#Minimal]" "#@#MainVariables.inc"][!Update]
DynamicVariables=1
Hidden=#ModeP#

[MeasureMode]
Measure=Calc
IfCondition=(#Beta# = 1)
IfTrueAction=[!ActivateConfig "Utopia Sound\Beta Sound Clock" "BetaSoundClock.ini"][!SetVariable BetaOn "1"][!WriteKeyValue Variables BetaOn "[#BetaOn]" "#@#MainVariables.inc"][!Update]
IfCondition2=(#Minimal# = 1)
IfTrueAction2=[!ActivateConfig "Utopia Sound\Beta Sound Clock" "Cover Wizard.ini"][!Update]
DynamicVariables=1
So, it works properly, but if the skin is refreshed the warning comes up "Config already active".

Is there a way to work this out to not pass a warning?

If not, I'm happy with the functionality, its just that intrinsic warning that is 'bugging' me. Well TBH the refresh causes forces the user to click the toggle button twice until it goes fine. So, I'd like to stop that as well.

:)

Thanks.
Last edited by CodeCode on February 5th, 2024, 9:04 am, edited 2 times in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: !ActivateConfig Giving Warning 0 How to WOrkaround?

Post by CodeCode »

Ok, same as often for me I looked harder into my code with the 'fresh eyes' after a short breaktime'

This fixes that, like so:

Code: Select all

[MeasureMode]
Measure=Calc
IfCondition=(#Beta# = 1)
IfTrueAction=[!ActivateConfig "Utopia Sound\Beta Sound Clock" "BetaSoundClock.ini"][!Update]
IfFalseAction=[!DeactivateConfig "Utopia Sound\Beta Sound Clock" "BetaSoundClock.ini"][!Update]
IfCondition2=(#Minimal# = 1)
IfTrueAction2=[!ActivateConfig "Utopia Sound\Beta Sound Clock" "Cover Wizard.ini"][!Update]
IfFalseAction=[!DeactivateConfig "Utopia Sound\Beta Sound Clock" "Cover Wizard.ini"][!Update]
DynamicVariables=1
Error removed.

Hoipe this helps someone in the future.
(That is to say, not in the past - which causes thing to be unchangeable)
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: !ActivateConfig Giving Warning 0 How to WOrkaround?

Post by CodeCode »

CodeCode wrote: February 5th, 2024, 9:03 am Ok, same as often for me I looked harder into my code with the 'fresh eyes' after a short breaktime'

This fixes that, like so:

Code: Select all

[MeasureMode]
Measure=Calc
IfCondition=(#Beta# = 1)
IfTrueAction=[!ActivateConfig "Utopia Sound\Beta Sound Clock" "BetaSoundClock.ini"][!Update]
IfFalseAction=[!DeactivateConfig "Utopia Sound\Beta Sound Clock" "BetaSoundClock.ini"][!Update]
IfCondition2=(#Minimal# = 1)
IfTrueAction2=[!ActivateConfig "Utopia Sound\Beta Sound Clock" "Cover Wizard.ini"][!Update]
IfFalseAction=[!DeactivateConfig "Utopia Sound\Beta Sound Clock" "Cover Wizard.ini"][!Update]
DynamicVariables=1
Error removed.

Hoipe this helps someone in the future.
(That is to say, not in the past - which causes thing to be unchangeable)
Ok, this fix is not working either. Testing it shoes error for the variable of Beta variable equals 1, but does not when Minimal variable equals 1. Weird.

Also since testing things got weird. Still chasing the bug...
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: [solved] !ActivateConfig Giving Warning, How to Workaround?

Post by CodeCode »

Changed to this (the original version ).

[PreviousG]

Code: Select all

Meter=Shape
Shape=Rectangle 223,276,54,54,26 | StrokeWidth 0 | Fill LinearGradient MyGradient1
MyGradient1=270 | 255,240,207,255 ; 0,0 | 240,210,85,255 ; 0.05 | 60,60,60,255 ; 0.25 | 255,240,207,255 ; 0.75 | 60,60,60,255 ; 0.9 | 215,190,90,255 ; 0.99
Shape2=Rectangle 228,281,45,45,22 | StrokeWidth 0 | Fill Color #FillColor#
Antialias=1
MouseOverAction=[!SetOption "ButtonFunctionText" "Text" "Previous"][!Update]
MouseLeaveAction=[!SetOption "ButtonFunctionText" "Text" ""][!Update]
RightMouseUpAction=[!CommandMeasure "MeasureTrack" "SetPosition 0"]
LeftMouseUpAction=[!CommandMeasure "MeasureTrack" "Previous"]
DynamicVariables=1
Hidden=#ModeP#

[VisualToggleOn]
Meter=Shape
Shape=Rectangle 154,292,54,54,26 | StrokeWidth 0 | Fill LinearGradient MyGradient1
MyGradient1=270 | 255,240,207,255 ; 0,0 | 240,210,85,255 ; 0.05 | 60,60,60,255 ; 0.25 | 255,240,207,255 ; 0.75 | 60,60,60,255 ; 0.9 | 215,190,90,255 ; 0.99
Shape2=Rectangle 159,297,45,45,22 | StrokeWidth 0 | Fill Color #FillColor#
Antialias=1
MouseOverAction=[!SetOption "ButtonFunctionText" "Text" "VU Meter"][!Update]
MouseLeaveAction=[!SetOption "ButtonFunctionText" "Text" ""][!Update]
LeftMouseUpAction=[!ActivateConfig "Utopia Sound\Beta Sound Clock" "BetaSoundClock.ini"][!ShowMeter VisualToggleOff][!HideMeter VisualToggleOn][!Update]
DynamicVariables=1
Hidden=#ModeV#

[VisualToggleOff]
Meter=Shape
Shape=Rectangle 154,292,54,54,26 | StrokeWidth 0 | Fill LinearGradient MyGradient1
MyGradient1=270 | 255,240,207,255 ; 0,0 | 240,210,85,255 ; 0.05 | 60,60,60,255 ; 0.25 | 255,240,207,255 ; 0.75 | 60,60,60,255 ; 0.9 | 215,190,90,255 ; 0.99
Shape2=Rectangle 159,297,45,45,22 | StrokeWidth 0 | Fill Color #FillColor#
Antialias=1
MouseOverAction=[!SetOption "ButtonFunctionText" "Text" "VU Meter"][!Update]
MouseLeaveAction=[!SetOption "ButtonFunctionText" "Text" ""][!Update]
LeftMouseUpAction=[!ActivateConfig "Utopia Sound\Beta Sound Clock" "Cover Wizard.ini"][!HideMeter VisualToggleOff][!ShowMeter VisualToggleOn][!Update]
DynamicVariables=1
Hidden=#ModeV#
This has been a weird trip through coding the having two configs, that were throwing a warning. Oddly enough the code before the versions above is back in use and refreshes without warning
:o .
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: [solved] !ActivateConfig Giving Warning, How to Workaround?

Post by CodeCode »

CodeCode wrote: February 5th, 2024, 9:31 am Changed to this (the original version ).
This has been a weird trip through coding the having two configs, that were throwing a warning. Oddly enough the code before the versions above is back in use and refreshes without warning
:o .
It changes according to what mode the variable has as "on" and the image available for the button to toggle the mode back.

Just saying that, I think I have an idea.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Lieuallen
Posts: 50
Joined: June 8th, 2020, 11:56 pm
Location: Chapel Hill, NC (US)

Re: !ActivateConfig Giving Warning 0 How to WOrkaround?

Post by Lieuallen »

I'm glad you got it working. But I did want to point out that your first fix would have worked, but you left out the "2" in the second IfFalseAction. That's why your "Minimal" section wasn't working.
Always sure, sometimes right.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [solved] !ActivateConfig Giving Warning, How to Workaround?

Post by Yincognito »

Lieuallen is correct. Personally though, I've given up trying to account for every unwanted Rainmeter error or warning a long time ago, I just let them be and couldn't care less about them. They're good to let one know what happens while debugging, but besides that, many of them have that nagging factor I can't stand, considering that in quite a few cases, the process leading to such warnings or errors is actually intentional. Of course, one could uncheck the relevant tickboxes in the log to hide them, but that will hide the legit ones (i.e. stuff caused by actual unintentional mistakes in the code) as well.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: !ActivateConfig Giving Warning 0 How to WOrkaround?

Post by CodeCode »

Lieuallen wrote: February 5th, 2024, 11:57 am I'm glad you got it working. But I did want to point out that your first fix would have worked, but you left out the "2" in the second IfFalseAction. That's why your "Minimal" section wasn't working.
Yes! I did finally notice that missing 2 in the conditions.

So, yes again. It is working and there are no warnings anymore.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: [solved] !ActivateConfig Giving Warning, How to Workaround?

Post by CodeCode »

Yincognito wrote: February 5th, 2024, 2:44 pm Lieuallen is correct. Personally though, I've given up trying to account for every unwanted Rainmeter error or warning a long time ago, I just let them be and couldn't care less about them. They're good to let one know what happens while debugging, but besides that, many of them have that nagging factor I can't stand, considering that in quite a few cases, the process leading to such warnings or errors is actually intentional. Of course, one could uncheck the relevant tickboxes in the log to hide them, but that will hide the legit ones (i.e. stuff caused by actual unintentional mistakes in the code) as well.
I try to tell myself that very thing; what difference does it make if there is a one-off instance/error/Warning message. But, alas I cannot do that. There are so many ways to make all of the bangs, nesting variables, etc, work as intended.

We do what we do to prevent future errors or cycling errors in the background due to mishandling those few factors. (my short list list is not exhaustive).
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.