Idrinth wrote: Sun Mar 21, 2021 12:34 pm
while making some core functions more careful about accessing none existant windons I found WindowGetScreenPosition - that should help.
local wgsp = WindowGetScreenPosition
WindowGetScreenPosition = function(window)
if DoesWindowExist(window) then
return wgsp(window)
else
d("Failed to get screen position of "..window)
return 0,0,0,0
end
end
Yes, that helped. Thanks! I made it switch sides automatically, but it does not take the offset values. Still gotta figure out what is causing this.
[EDIT] Nope, can't get the offsets working since I have no idea what the return value of wgsp is so I could "if" for it. But the autoswitching sides is working with the following change starting from line 57:
--local anchor = { Point = "topright", RelativeTo = "MiracleGrowLight", RelativePoint = "topleft", XOffset = 10, YOffset = 0 }
local wgsp = WindowGetScreenPosition;
WindowGetScreenPosition = function(windowName)
if DoesWindowExist(windowName) then
return wgsp(windowName)
else
d("Failed to get screen position of "..windowName)
return 0,0,0,0
end
end
Tooltips.AnchorTooltip( anchor )
Re: MiracleGrowLight
Posted: Sun Mar 21, 2021 2:43 pm
by Idrinth
Annihilate wrote: Sun Mar 21, 2021 2:16 pm
Yes, that helped. Thanks! I made it switch sides automatically, but it does not take the offset values. Still gotta figure out what is causing this.
have a look at the code in 1.3.2, maybe that helps
Will try to figure out how to do that automatically - just haven't found a way yet. Could otherwise add a toggle, so you don't need to change the code, just a variable in SavedVariables
Couldn't you take either the middle of the screen, or another frame (like Soloq window) for an anchor which is centered as default and check for MGL if relative x offset is - or + to decide if the tooltip will be placed left or right automatically?
For a start a toggle would be awesome, too.
ok, code for checking is the following, it's in 1.3.2: