Page 4 of 7

Re: MiracleGrowLight

Posted: Sun Mar 21, 2021 2:16 pm
by Annihilate
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.
Spoiler:

Code: Select all

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:

Code: Select all

	--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 :)

Re: MiracleGrowLight

Posted: Sun Mar 21, 2021 3:46 pm
by Annihilate
Idrinth wrote: Sun Mar 21, 2021 1:14 pm
Spoiler:
Annihilate wrote: Sat Mar 20, 2021 9:34 pm
Idrinth wrote: Sat Mar 20, 2021 8:25 pm
Spoiler:
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. :D
ok, code for checking is the following, it's in 1.3.2:

Code: Select all

    local rootWidth,rootHeight = WindowGetDimensions("Root")
    local mglX,mglY = WindowGetScreenPosition(windowName)
    local anchor = nil
    if mglX*2 > rootWidth then
        anchor = { Point = "topleft",  RelativeTo = windowName, RelativePoint = "topright",   XOffset = -10, YOffset = 0 }
    else
        anchor = { Point = "topright",  RelativeTo = windowName, RelativePoint = "topleft",   XOffset = 10, YOffset = 0 }
    end
  
Oh yeah. That is much better. :D Thank you!

[EDIT] Maybe it's time to update the OP.

Re: MiracleGrowLight

Posted: Wed Mar 24, 2021 2:01 am
by Idrinth
With 1.3.3 the addon is no longer trying to plant while you are dead(at 0 hp)

Re: MiracleGrowLight

Posted: Wed Mar 24, 2021 9:38 am
by Annihilate
Idrinth wrote: Wed Mar 24, 2021 2:01 am With 1.3.3 the addon is no longer trying to plant while you are dead(at 0 hp)
Thanks!

Re: MiracleGrowLight

Posted: Mon Apr 19, 2021 3:30 am
by Sybreal
Will this cause the same buildup of lag as MGR?

Re: MiracleGrowLight

Posted: Mon Apr 19, 2021 9:42 am
by Idrinth
Did everything possible to prevent this, so should not @Sybreal :)

Re: MiracleGrowLight

Posted: Tue Apr 20, 2021 9:53 am
by yvandureve02200
Hi, first, ty for this great work !

An auto gather function can be amazing, either if it make some lag, maybe you can make one we can "ON / OFF" as we like.

Re: MiracleGrowLight

Posted: Thu Apr 22, 2021 9:51 am
by Idrinth
With 1.3.4 there is a fix to liniment seed selection, that fixes some rare errors when sorting seeds randomly.

Re: MiracleGrowLight

Posted: Thu Apr 22, 2021 7:59 pm
by Opeteh
Is it possible to turn on the sound when seed is ready to be harvested the same way as with normal MGR?