Prat 3.0

Prat 3.0

26M Downloads

Enhancement Request: Plug Into Blizzard UI Add-Ons Button

JPEscher opened this issue · 9 comments

commented

i noticed that this doesnt show in my blizzard add ons button as per the image below. would it be possible to add it there? it allows for hiding the button and a cleaner interface :)
image

commented

notice this in discussion with another add on i use. hope it is helpful
https://warcraft.wiki.gg/wiki/Addon_compartment

commented

looks like a toc change. going unfortunately i haven't really worked with LUA. (i have PowerShell, Perl, Python, Bash, Java, C, and LISP, experience.) maybe if i look and things i can propose changes that help?

attempt with manual registration style from https://warcraft.wiki.gg/wiki/Addon_compartment
i think this would be added anywhere in addon/addon.lua

AddonCompartmentFrame:RegisterAddon({
 text = "Prat: Chat Enhancements",
 icon = "Interface/AddOns/Prat-3.0/textures/prat-logo-dark-small.tga",
 notCheckable = true,
 func = function(button, menuInputData, menu)
	-- local buttonName = menuInputData.buttonName; -- for debugging
	-- print("Hello from the addon compartment! You clicked " .. buttonName .. "!"); -- for debugging
	Prat.ToggleOptionsWindow()
 end,
 funcOnEnter = function(button)
	MenuUtil.ShowTooltip(button, function(tooltip)
		tooltip:SetText(Prat.Version)
	end)
 end,
 funcOnLeave = function(button)
	MenuUtil.HideTooltip(button)
 end,
})

a quick test with that att the end of addonlua shows some success.
image
image
image

commented

@plusmouse you look to be the one behind commits. would you kindly review this? if you'd like i'll make a local clone and branch from here; and then upload a pull request for you to review/edit & approve/commit

commented

i got funny tonight. i have a branch locally if you'd like i can push here for you to review.
used code

local aboutText = "Prat: Publications Refinement And Transmission";
AddonCompartmentFrame:RegisterAddon({
	text = aboutText,
	icon = "Interface/AddOns/Prat-3.0/textures/prat-logo-dark-small.tga",
	notCheckable = true,
	func = function(button, menuInputData, menu)
		Prat.ToggleOptionsWindow()
	end,
	funcOnEnter = function(button)
		MenuUtil.ShowTooltip(button, function(tooltip)
			tooltip:SetText(aboutText .. "\n" .. Prat.Version)
		end)
	end,
	funcOnLeave = function(button)
		MenuUtil.HideTooltip(button)
	end,
})

shows as
image
not sure where "@Project-Version@" is stored to add one to for my branch

commented

@plusmouse you look to be the one behind commits. would you kindly review this? if you'd like i'll make a local clone and branch from here; and then upload a pull request for you to review/edit & approve/commit

noticed the contributing.md created this as a result. i do not have classic nor cata-classic installed. would you like me to get those and then add and test those?
#199

commented

Hi. I've finally added Prat to the addon compartment in the latest commit now. If you could pull it and check it works for you that would be great.
image

commented

You finding the toggle function helped :)

commented

after getting a zip from here and switching out my Prat-3.0 folder for a test i see:
image

commented

clicking it works too! TY!