I've rewritten the skin to try and support a draggable hot-spot, by saving the currentconfigx/y when switching the visible flag, and moving to either the saved values or 0,0 depending on visible. But it just doesn't support dragging, while the log/skins window that shows my measure and variable values looks good. I think I am getting bit by what this comment I found online says:
"""The variables are updated only after all other measures are updated, so the values are always one update cycle behind."""
It appears while I think I am changing my x & y params, the !Move isn't moving there, due to being out of sync as I think it should, I am finding it very frustrating, along with a number of other characteristics like the rules governing:
use brackets around measure variables?
use parens around formulas?
use quotes around expressions?
use conditional tests a=1 ? b : c anywhere an expression is?
does update=-1 convert the skin to a totally mouse/event-driven process
I clearly do not understand the Rainmeter processing sequence as I should.
Code: Select all
[rainmeter]
Update=-1
FadeDuration 2000
[metadata]
Name=Dark
Author=zingeo, balala,
Information=[Upper-left corner] hot spot to darken all monitors, then a mouse action anywhere to reset.
Version=1.03 switch to SetVariable, 1.1 reorg
[variables]
visible=1
; screen size
sw=#SCREENAREAWIDTH#
sh=#SCREENAREAHEIGHT#
; desktop size
vw=#VSCREENAREAWIDTH#
vh=#VSCREENAREAHEIGHT#
; button parms
w=#SCREENAREAWIDTH#
h=2
;
[measureOrigx]
Measure=Calc
MaxValue=5000
Formula=(#visible# = 1 ? #CURRENTCONFIGX# : measureOrigx)
DynamicVariables=1
[measureOrigy]
Measure=Calc
MaxValue=5000
Formula=(#visible# = 1 ? #CURRENTCONFIGY# : measureOrigy)
DynamicVariables=1
[measureVisible]
Measure=Calc
Formula=#visible#
DynamicVariables=1
IfCondition=(#CURRENTSECTION#=1)
; if normal desktop-visible mode
IfTrueAction=[!SetVariable x [measureOrigx]][!SetVariable y [measureOrigy]][!SetVariable w 10][!SetVariable h 10]
; else go dark
IfFalseAction=[!SetVariable x 0][!SetVariable y 0][!SetVariable w (#vw#)][!SetVariable h (#vh#)]
OnUpdateAction=[!Move "#x#" "#y#"]
;[!Hide]
[meterDark]
Meter=Shape
DynamicVariables=1
Shape=Rectangle 0,0,#w#,#h# | Fill Color 0,0,0,255
LeftMouseUpAction=[!UpdateMeasure measureOrigx][!UpdateMeasure measureOrigy][!SetVariable visible "(1-#visible#)"][!UpdateMeasure "MeasureVisible"][!ShowFade][!UpdateMeter "meterDark"][!Redraw]
;[!Redraw][!UpdateMeter "meterDark"]
Clicking on the hotspot after a move out of the corner makes a hidden desktop perfectly, but a click goes back to a hot-spot in the corner (not where I dragged it), then another click darkens the screen but its upperleft corner is where the hotspot was moved to a step or 2 back, so clearly a sync problem with working with variables or measures that are a step behind, though the skins view of my variables and measures are perfect.
I also put fade in, but it doesn't vary duration, it is not clear at all me to how the sequence works re order and requirement: [!ShowFade][!UpdateMeter "meterDark"][!Redraw]
If showingFade, why do I have to redraw? If updatingMeter, why do I have to Redraw!@#
I'm more of a procedural coder (c++ etc.), this "setup the descriptor code, and it all just happens" makes it difficult to know what happens when and where and why.
"Dark" is my most interacted with skin, even though it doesn't drag [yet], and besides a corner hot spot, I also like a version with a 2 pixel thick button the entire width atop the monitor.
thanks!