Page 3 of 7

Re: MiracleGrowLight

Posted: Fri Mar 19, 2021 6:16 pm
by Krima
AUTO harvesting would be amazing! any chance?

Re: MiracleGrowLight

Posted: Fri Mar 19, 2021 7:19 pm
by Idrinth
Krima wrote: Fri Mar 19, 2021 6:16 pm AUTO harvesting would be amazing! any chance?
have yet to see how this works without causing lag, so for now no

Re: MiracleGrowLight

Posted: Sat Mar 20, 2021 10:26 am
by Annihilate
I made the tooltip alighn to the left side so it will display and extend to the left, because I have MGL placed on the right side of my screen. Otherwise the tooltip overlaps the main window.

In MiracleGrowLight.lua line 57

Code: Select all

local anchor = { Point = "topleft",  RelativeTo = "MiracleGrowLight", RelativePoint = "topright",   XOffset = -10, YOffset = 0 }

Re: MiracleGrowLight

Posted: Sat Mar 20, 2021 8:25 pm
by Idrinth
Annihilate wrote: Sat Mar 20, 2021 10:26 am I made the tooltip alighn to the left side so it will display and extend to the left, because I have MGL placed on the right side of my screen. Otherwise the tooltip overlaps the main window.

In MiracleGrowLight.lua line 57

Code: Select all

local anchor = { Point = "topleft",  RelativeTo = "MiracleGrowLight", RelativePoint = "topright",   XOffset = -10, YOffset = 0 }
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

Re: MiracleGrowLight

Posted: Sat Mar 20, 2021 9:34 pm
by Annihilate
Idrinth wrote: Sat Mar 20, 2021 8:25 pm
Spoiler:
Annihilate wrote: Sat Mar 20, 2021 10:26 am I made the tooltip alighn to the left side so it will display and extend to the left, because I have MGL placed on the right side of my screen. Otherwise the tooltip overlaps the main window.

In MiracleGrowLight.lua line 57

Code: Select all

local anchor = { Point = "topleft",  RelativeTo = "MiracleGrowLight", RelativePoint = "topright",   XOffset = -10, YOffset = 0 }
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

Re: MiracleGrowLight

Posted: Sat Mar 20, 2021 9:55 pm
by Idrinth
Annihilate wrote: Sat Mar 20, 2021 9:34 pm
Idrinth wrote: Sat Mar 20, 2021 8:25 pm
Spoiler:
Annihilate wrote: Sat Mar 20, 2021 10:26 am I made the tooltip alighn to the left side so it will display and extend to the left, because I have MGL placed on the right side of my screen. Otherwise the tooltip overlaps the main window.

In MiracleGrowLight.lua line 57

Code: Select all

local anchor = { Point = "topleft",  RelativeTo = "MiracleGrowLight", RelativePoint = "topright",   XOffset = -10, YOffset = 0 }
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
I don't usually work with lua or addons, so I'm still learning ;) most things are not easy yet

Re: MiracleGrowLight

Posted: Sun Mar 21, 2021 8:30 am
by totaljazz
Haven't used it long enough yet, but at first glance, it works great, just the way I wished. Thank you so much!

Re: MiracleGrowLight

Posted: Sun Mar 21, 2021 10:50 am
by Annihilate
Idrinth wrote: Sat Mar 20, 2021 9:55 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
I don't usually work with lua or addons, so I'm still learning ;) most things are not easy yet
Me neither. Anyhow I am eager to learn. :)

Currently I'm trying to figure out how TidyRoll does the tooltip positioning. Because it does exactly what the tooltip in backpack does, too. Move backpack to the left side relative to center screen, then tooltip shows on the right side. If backpack is moved to the right side, then item tooltip is shown on the left side.

Do you know if the creator of TidyRoll is still available somehow? It's kinda hard to reverse engineer if you have no idea where to start looking.

Re: MiracleGrowLight

Posted: Sun Mar 21, 2021 12:34 pm
by Idrinth
while making some core functions more careful about accessing none existant windons I found WindowGetScreenPosition - that should help.

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

Re: MiracleGrowLight

Posted: Sun Mar 21, 2021 1:14 pm
by Idrinth
Annihilate wrote: Sat Mar 20, 2021 9:34 pm
Idrinth wrote: Sat Mar 20, 2021 8:25 pm
Spoiler:
Annihilate wrote: Sat Mar 20, 2021 10:26 am I made the tooltip alighn to the left side so it will display and extend to the left, because I have MGL placed on the right side of my screen. Otherwise the tooltip overlaps the main window.

In MiracleGrowLight.lua line 57

Code: Select all

local anchor = { Point = "topleft",  RelativeTo = "MiracleGrowLight", RelativePoint = "topright",   XOffset = -10, YOffset = 0 }
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