[PRPL] GetControlPanelButtonScreenCoords Buttons

Started by GoodMorning, July 06, 2017, 04:48:18 AM

Previous topic - Next topic

GoodMorning

Does anyone know what the possible string arguments to GetControlPanelButtonScreenCoords are? I'm trying to prevent mouseclick detection when over UI.

Currently, it seems to be "Tech" and "Cancel". I'm hoping for the "Lathe" and "ParticleBeam" control buttons, and possibly "Destroy" and "Omnis".

From either of these known arguments, (assuming GetBuildSlotScreenCoords) it is possible to divine the position of the ship panel, editor panel and the right-hand end of the lower control panel. The other arguments would allow for the entirety of the top and bottom control panels.

For now, I will assume that the ship panel extends over the full height of the screen, the lower panel extends over the full width, and the upper panel mirrors the lower. This breaks down in the corners or the top of the screen, becoming worse as resolution goes up and UI scale goes down.
A narrative is a lightly-marked path to another reality.

MxGoldo

I found one other possible string for GetControlPanelButtonScreenCoords: "AmpGemCount". That's the Amp gem count from the upper panel.

# set the image color to red if the mouse is over the AmpGemCount in the upper panel
Self "main"
GetMouseScreenPosition "AmpGemCount" 0 GetControlPanelButtonScreenCoords @PointDiff gt(0) swap gt(0) and
GetMouseScreenPosition "AmpGemCount" 2 GetControlPanelButtonScreenCoords @PointDiff lt(0) swap lt(0) and
and if 255 0 0 else 255 255 255 endif 255 setImageColor

:PointDiff
->y2 ->x2 ->y1 ->x1
<-x1 <-x2 sub <-y1 <-y2 sub

GoodMorning

Thank you. This should allow positioning w.r.t. that entire panel.
A narrative is a lightly-marked path to another reality.