It is currently April 28th, 2024, 12:10 pm

Run WebParser only once?

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

Re: Run WebParser only once?

Post by Yincognito »

Nookz wrote: December 10th, 2023, 12:59 am Yeah.. I think I was overcomplicating things. In the end I ended up using something similar to what you suggested here. Now I'm thinking of adding one or two more feature (prepare for more questions! :D ) and I will finally be done with the skin^^
:thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: Run WebParser only once?

Post by Nookz »

I have a (other) question for you already.
this is related to my colorselector skin. It is made of 2 skin. The main one which can be placed anywhere on the screen, and the Overlay which uses "[!Move #VSCREENAREAX# #VSCREENAREAY#]" to position itself at the topmost left corner of the desktop. and to make sure that it takes up the entire desktop area it uses:
W=#VSCREENAREAWIDTH#
H=#VSCREENAREAHEIGHT#

This works fine and let the user colorpick on whatever monitor regardless of how they are positioned.
Now my issue is that I would like be able to exit the colorpicker mode (the overlay skin) with the 'same' button that was use to launch it.
Since the overlay skin is obviously on top of the main skin, the main skin can't be reached while the overlay is on. So I came to the conclusion that I needed to add a meter inside the overlay skin itself to mimic the colorpick button, but I'm wondering how to position it..
I've been looking at the WORKAREAX/Y/WIDTH/HEIGHT and SCREENAREAX/Y/WIDTH/HEIGHT but I'm a bit confused on how to use them to get what I want.

What I tried so far was writing variables with this:
(#CURRENTCONFIGX#+[MeterPick:X]) and (#CURRENTCONFIGY#+[MeterPick:Y])
and that the overlay skin button meter could use those variables to position itself. At least that was the idea.

But because of my awkward monitor layout (basically I have 3 screen and they are set like this ( 2/1/3), which means that monitor 2 has negative value in the X axis when using #CURRENTCONFIGX#), this will not work for me or for anybody else in a similar situation.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2613
Joined: March 23rd, 2015, 5:26 pm

Re: Run WebParser only once?

Post by SilverAzide »

Nookz wrote: December 10th, 2023, 8:32 pm
Wait... you're covering the entire screen with a skin just so you pick a color??? Sorry, but... Ick.

I would suggest you look at JSMorley's ColorPicker or raiguard's ColorPickerPlus (for a purely Rainmeter version), or death.crafter's ColorPickerUI. The key to all is the ColorCursor plugin, which eliminates the need to do what you are doing.

P.S.: Your post here would better suited for it's own thread or in your skin's thread, not here in a thread about WebParser.
Gadgets Wiki GitHub More Gadgets...
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: Run WebParser only once?

Post by Nookz »

isn't that exactly what JSMorley's version does with his overlay?
it's a single meter skin with an update of -1 and is only active when the colorpicker mode is on.. is it really that bad?
Also I am using the ColorCursor plugin.

Edit: I just checked JSMorley's version again and yea, that is exactly what he does too.
using
W=[#VSCREENAREAWIDTH]
H=[#VSCREENAREAHEIGHT]
, but he position his at 0,0 instead of #VSCREENAREAX# #VSCREENAREAY#
So in his version I can't colorpick my second monitor..

To be clear. my skin does pretty much the same thing JSMorley's ColorPicker does and in the same ways, with a few exceptions.
Mainly:
-I use my own lua script instead of the libs he uses
-I set the overlay to account for weird monitors layout
-I've added more interactivity and more control over individual values
-The colorpicker mode (the overlay skin) is not closed when a color is picked. Instead I let the user either continue to pick colors or confirm/close the color picker mode manually.
But the way the color picking part of the skin is done is identical, as far as I know, but maybe i'm mistaken and you can clarify what you meant?

About the other thing:
I wouldn't mind creating a new topic for each question if that is the norm. or to move/rename this entire topic if needed. Yincognito has been kind enough to answer all my noob questions here so far so I didn't thought this was an issue.
Last edited by Nookz on December 10th, 2023, 11:28 pm, edited 3 times in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 7179
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Run WebParser only once?

Post by Yincognito »

Nookz wrote: December 10th, 2023, 8:32 pmSo I came to the conclusion that I needed to add a meter inside the overlay skin itself to mimic the colorpick button, but I'm wondering how to position it..
Besides SilverAzide's suggestions (not much of an expert in color pickers or multi monitor setups, never used or needed one, but I kind of agree with placing unrelated questions in their own threads, especially if there are more of them), you might be able to do some !ZPos or !ClickThrough kung fu to bring your non overlay skin "to the front" instead of creating a duplicate button in your overlay skin. There is some other option / bang somewhere about the skin loading order or something like that, not sure if it would help. Unfortunately, I can't test your multi monitor scenario, so all I could think of was to somehow switch the order of these skins when clicking over the desired button area so that the actual button is clicked instead of a duplicate. There is also the possibility of leaving a (possibly dynamic) "hole" in your overlay skin for this purpose, but well, it does seem a bit like scratching your left ear with your right hand indeed... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: Run WebParser only once?

Post by Nookz »

Got it. I'll create new posts form now on.
And thanks, I think !ClickThrough might work.
User avatar
Yincognito
Rainmeter Sage
Posts: 7179
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Run WebParser only once?

Post by Yincognito »

Nookz wrote: December 10th, 2023, 8:32 pmBut because of my awkward monitor layout (basically I have 3 screen and they are set like this ( 2/1/3), which means that monitor 2 has negative value in the X axis when using #CURRENTCONFIGX#), this will not work for me or for anybody else in a similar situation.
Hmm... maybe:
(#CURRENTCONFIGX#-#SCREENAREAX@N#+[MeterPick:X])
(#CURRENTCONFIGY#-#SCREENAREAY@N#+[MeterPick:Y])
or something similar (where N is the monitor that skin is on)? The above should be positive...

Not sure if you can use the screen area position and size of the primary monitor or get the order of monitors from the registry or another method, to help the skin figure out the coordinates of which monitor are negative. In fact, I have no idea what the values of the monitor variables would be in such a case, since I don't use such a setup (I have an old monitor, but I just deposited it in a remote place since it's not being used since ages).

EDIT: One other thing... you might be able to identify the monitor the skin is on by comparing every #SCREENAREAX@N# with #SCREENAREAX#. Just a thought.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: Run WebParser only once?

Post by Nookz »

Ok real last post in here (just in case somewhere dig through this post eventually) just to let you know that a the Zpos did the trick.
I was already using [!EnableMouseActionGroup "*" Action] to disable all the main skin buttons when launching the overlay, so now when the overlay open it pop the skin over it and only the colorpicker button is available to click. Works like a charm.

Edit: ahh nvm.. makes it so I can't colorpick inside the main skin. not a big issue, but would be nice if it was only the button I couldn't pick.
gonna looks into your other suggestions after all. will edit if I find a definitive solution

Edit2: In the end went with what you suggested earlier:
I added two measures before launching the color picker:

Code: Select all

[DetectMonitor]
Measure=Calc
IfCondition=#SCREENAREAX@1# < 0
IfCondition2=#SCREENAREAX@2# < 0 
IfCondition3=#SCREENAREAX@3# < 0 
IfTrueAction=[!SetVariable MonitorPos #SCREENAREAWIDTH@1#][!UpdateMeasure PickButtonPos]
IfTrueAction2=[!SetVariable MonitorPos #SCREENAREAWIDTH@2#][!UpdateMeasure PickButtonPos]
IfTrueAction3=[!SetVariable MonitorPos #SCREENAREAWIDTH@3#][!UpdateMeasure PickButtonPos]
DynamicVariables=1
UpdateDivider=-1
IfConditionMode=1
and one to set PickButtonX: (#MonitorPos#+#CURRENTCONFIGX#+[MeterPick:X])

I'm not 100% certain this will actually work for everyone. Like if someone somehow has 2 monitor on the left of the main one, but that's starting to be a really niche case scenario at that point..