It is currently May 9th, 2024, 12:43 am

Solved: Conditional Mouse Actions.

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Conditional Mouse Actions.

Post by Yincognito »

ZXCVBOT wrote: October 7th, 2023, 11:48 am The code re-provided by Yincognito does work now, but not the same as the code provided by balala - reasons below:

The re-provided code of Yincognito does change the Mode (Variable) to 0 and 1, and Mode (Measure) to Light and Dark; But it applies only to the EngineLogo and its SolidColor ([#Background[&Mode]]). Not affecting the connected meters to the same Mode (Variable).
(I can make them change and adapt to the newly provided way, but, balala provides a much easier way to do so). I do believe, that adding !UpdateMeter <all meters> would make the job easier and your code workable.

The code provided by both works, but this time the goes to balala.
I have absolutely no problem with the "trophy" going to balala (or anyone else whose solution works, for that matter), since he deserves it - as I said, the decision on what to use is entirely yours. My only problem was with implying that my code doesn't work when it actually does, at least for the bits of code you provided in this thread (which is precisely what you initially asked, after all). :confused:

As for the rest of your code, if you find it difficult to spend 30 seconds to mass replace #Mode# with [Mode] and [#Mode] with [&Mode] from Notepad++' Search > Replace menus (and this can be done in all opened files, by the way), then I don't know what to say. Sure, if you don't want to or find it uncomfortable, that's again, your decision, nobody else can do it for you. ;-)

Regarding updating, I already mentioned earlier that updating any measure / meter where you use the mode variable / measure would be required (but only if you want the change to produce immediate effects, before the general skin update kicks in), so it's not like this detail was left out. Plus, unless I'm missing something, balala's code doesn't update any other section than EngineLogo either, so it would have precisely the same issue and require precisely the same approach if immediate effects are desired anyway, no matter how much dynamic variable lines you have in your skin. Redrawing the skin alone accomplishes exactly nothing by itself, if related stuff is not updated. You can easily test this by adding a measure like:

Code: Select all

[NotUpdated]
Measure=String
String=#Mode#
UpdateDivider=-1
DynamicVariables=1
to both mine and balala's code and then see if this changes in the About > Skins window if you don't specifically update it.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
ZXCVBOT

Re: Conditional Mouse Actions.

Post by ZXCVBOT »

Yincognito wrote: October 7th, 2023, 4:30 pm I have absolutely no problem with the "trophy" going to balala (or anyone else whose solution works, for that matter), since he deserves it - as I said, the decision on what to use is entirely yours. My only problem was with implying that my code doesn't work when it actually does, at least for the bits of code you provided in this thread (which is precisely what you initially asked, after all). :confused:
I thought I wrote about it earlier that your code did work - just not the first time I used it - I know it will sound weird to you that I was getting unexpected errors (I know that you will not send me or anyone else something untested), but such is life (and programming-stuff). Just chill out! I gave the code and expected the results - This time I did not check only my code by creating another skin for the problem - You provided a correct answer - both times.
Yincognito wrote: October 7th, 2023, 4:30 pm As for the rest of your code, if you find it difficult to spend 30 seconds to mass replace #Mode# with [Mode] and [#Mode] with [&Mode] from Notepad++' Search > Replace menus (and this can be done in all opened files, by the way), then I don't know what to say. Sure, if you don't want to or find it uncomfortable, that's again, your decision, nobody else can do it for you. ;-)
It is not difficult at all! I know, but the structure for lines is not proper and same for all the lines and requires the use of human eyes. (do not say use regex). Several lines have been commented by me - different purposes that contain Mode (all in some manner). So, it would require 3 minutes atleast if not more (manually), but not 30 seconds. It's a bit crappy code structure mixed with experiments - whatever makes the work done. I do not find it uncomfortable (rather extreme). I can do it, but if I am provided with a solution that does all the work and as I intend, I might not look any further.
Yincognito wrote: October 7th, 2023, 4:30 pm Regarding updating, I already mentioned earlier that updating any measure / meter where you use the mode variable / measure would be required (but only if you want the change to produce immediate effects, before the general skin update kicks in), so it's not like this detail was left out. Plus, unless I'm missing something, balala's code doesn't update any other section than EngineLogo either, so it would have precisely the same issue and require precisely the same approach if immediate effects are desired anyway, no matter how much dynamic variable lines you have in your skin. Redrawing the skin alone accomplishes exactly nothing by itself, if related stuff is not updated.
I do not think you have missed anything. balala's code does not update any other section than EngineLogo, but it sets the variable to something that is mass-used by other meters. As you already mentioned, the general update set to the skin is used to change other sections related to the same. The thing that I did not understand why do you want me to test the code with UpdateDivider=-1? I know your code will do work. I made a new skin commited to your changes - It works :thumbup: - Now I have 2 skins that look the same - work the same - with different codes lol!

PS. I just learnt how to quote the comments :D !

Chin up Yincognito! It's not like you did something wrong. You did what you could - given the code. You completed the mission! *Victory Fanfare Playing*
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Conditional Mouse Actions.

Post by balala »

ZXCVBOT wrote: October 7th, 2023, 11:48 am I do believe, that adding !UpdateMeter <all meters> would make the job easier and your code workable.
!UpdateMeter <all meters> in fact looks the following way: !UpdateMeter *. It is strongly recommended to add as well a !Redraw bang after the the !UpdateMeter * option: [!UpdateMeter *][!Redraw].
ZXCVBOT wrote: October 7th, 2023, 11:48 am (Also, (What (new) mistake?))
I mistakenly wrote an IfMatchAction option as IfMatchction (missing an A). This was my mistake, I wrote about. After your reply I went back and fixed my mistake.
ZXCVBOT wrote: October 7th, 2023, 6:20 pm PS. I just learnt how to quote the comments :D !
:thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Conditional Mouse Actions.

Post by Yincognito »

ZXCVBOT wrote: October 7th, 2023, 6:20 pm As you already mentioned, the general update set to the skin is used to change other sections related to the same. The thing that I did not understand why do you want me to test the code with UpdateDivider=-1?
I only suggested testing that measure to see that updating related sections for immediate results is needed irrespective of the code you chose to use, since both only updated EngineLogo. This was because you said earlier that updating all meters would make my code "workable", yet the other code which didn't do it either was apparently "working" (notice the difference).

Relying on the general skin update can surely create the appearance of success for one of the variants, but it won't work if some other section in your code had an UpdateDivider of 1000 or similar, like you had in EngineLogo. So you see, neither solution actually does "all the work" (yet, since only the sections you posted were updated in both cases), despite balala's being clearly the most comfortable one.

EDIT: The above was just confirmed by balala above.
P.S. I never demanded you to "just chill out!" when you were PM-ing me for stuff that should have been posted here for the past week, so I expect the same in return. No tension / offense here, by the way, just saying... ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
ZXCVBOT

Re: Solved: Conditional Mouse Actions.

Post by ZXCVBOT »

For balala:
balala wrote: October 7th, 2023, 7:46 pm !UpdateMeter <all meters> in fact looks the following way: !UpdateMeter *. It is strongly recommended to add as well a !Redraw bang after the the !UpdateMeter * option: [!UpdateMeter *][!Redraw].
Ah! I forgot about !UpdateMeter *, I actually went ahead and did this: !UpdateMeter 1...!UpdateMeter10! lol. I knew this from one of the manuals I believe, but since the related and similar posts had no such thing, I was infact unable to remember such a thing. Silly me! But oh god! the * is the solution to so many of my problems.
balala wrote: October 7th, 2023, 7:46 pm I mistakenly wrote an IfMatchAction option as IfMatchction (missing an A). This was my mistake, I wrote about. After your reply I went back and fixed my mistake.
Its only a mistake - they can be corrected in these editable forums! What I actually meant was - why use "new" - like when did you make the "old" one?
For Yincognito:
Yincognito wrote: October 7th, 2023, 8:32 pm yet the other code which didn't do it either was apparently "working" (notice the difference)
I saw the thing you told. I saw that your code was changing the variable as well as the measure's value - immediately, but since I kept the update a bit too low, there was almost no visible difference in balala's code. Hence, I posted his code as working - wayyy before I tested the potential of what your code could do.
Yincognito wrote: October 7th, 2023, 8:32 pm Relying on the general skin update can surely create the appearance of success for one of the variants, but it won't work if some other section in your code had an UpdateDivider of 1000 or similar, like you had in EngineLogo. So you see, neither solution actually does "all the work" (yet, since only the sections you posted were updated in both cases), despite balala's being clearly the most comfortable one.
Also, UpdateDivider of 1000 was to be changed according to the Static and Animated image/images selected with the update value. I did the solid colour for the visible effect during tests as it is a png/bunch of pngs (originally gifs). The UpdateDivider was to ensure that the meter is not drinking unnecessary juice.
I now know this for a fact that neither of them do "all the work" but, the user does not seem to care about such things- they think - oh what a nice skin with features!
Jokes aside- I too do not know apart from the things stated what "an all working" solution would entail.
Yincognito wrote: October 7th, 2023, 8:32 pm
P.S. I never demanded you to "just chill out!" when you were PM-ing me for stuff that should have been posted here for the past week, so I expect the same in return. No tension / offense here, by the way, just saying... ;-)
Ah..Ha Ha! I meant that in a good manner :welcome:!
For the SAGES and DEVS:
From now, I shall do much-much more research and only then ask if I can't do a thing :? . I want you sages and devs to actually take some time off the tensions and burdens of work (if you can) and live a bit relaxed life :rosegift: ! Just look at the amount of posts you have done :jawdrop ! Lighten and liven up people!
For the last time I'll say this: BOTH THE SOLUTIONS PROVIDED BY BALALA AND YINCOGNITO WORK - 100%!

So, seriously, I thank you both for helping me out this much!
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Solved: Conditional Mouse Actions.

Post by balala »

ZXCVBOT wrote: October 8th, 2023, 12:35 pm So, seriously, I thank you both for helping me out this much!
You're welcome. I'm glad if you found all the solutions.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Solved: Conditional Mouse Actions.

Post by Yincognito »

ZXCVBOT wrote: October 8th, 2023, 12:35 pm For Yincognito:
I saw the thing you told. [...]
Jokes aside- I too do not know apart from the things stated what "an all working" solution would entail.
That was the whole point I was trying to make: updating all relevant sections generally makes a code (including both here) "all working". My way of conveying this was probably not that good, but I'm glad it was eventually understood. :thumbup:
I know I'm a bit passionate when talking about things that I know for sure they are true - that's just the way I am. It's about the principle, not the person. :oops:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth