Pokemon Trainer NG: The Pet Battle Mod

Pokemon Trainer NG: The Pet Battle Mod

33.4k Downloads

Enhancement Request: Use Blizzard AddOns Compartment to Access Options

JPEscher opened this issue ยท 2 comments

commented

Enhancement Request: Use Blizzard AddOns Compartment to Access Options
more details here: https://warcraft.wiki.gg/wiki/Addon_compartment

attempted adjustment that gets the first load (not sure what i'm doing wrong to get the further loads)
For: PokemonTrainer NG
FilePath: Interface/AddOns/PokemonTrainer_Loader/Loader.lua
Code Placement: End of File
Code:

--[[
	This section added to get the mod to have access to options aside form slash commands.

	ToDo:
		add option that disables Blizzard AddOns Compartment (BAOC) for those who don't want this mod there
		add to norganna slidebar (auctioneer suite) for those who use that
]]--

local AddonName = "Pokemon Trainer NG";
local version = tostring(C_AddOns.GetAddOnMetadata(AddonName, "Version"));
local mouseButtonNote = "\nThe pet battle addon with many helpers!";
AddonCompartmentFrame:RegisterAddon({
	text = AddonName,
	icon = "Interface/AddOns/PokemonTrainer/Images/Ramping.tga",
	notCheckable = true,
	func = function(button, menuInputData, menu)
		LoadWithOptions = true
		LoadPokemonTrainer()
	end,
	funcOnEnter = function(button)
		MenuUtil.ShowTooltip(button, function(tooltip)
			tooltip:SetText(AddonName .. ": " .. version .. mouseButtonNote)
		end)
	end,
	funcOnLeave = function(button)
		MenuUtil.HideTooltip(button)
	end,
})
commented

view of it in use
image
like i said, this works on load, but not after. not sure why/how to fix. if i knew i would create a PR to go along with this and help

sorry, i'm new to addons

commented

I have implemented it in the addon itself, not the loader.
It doesn't work in the loader, so if people wants this, they have to load the addon at login :)