Download
(133Kb)
Download
Updated: 12-10-23 10:52 AM
Pictures
File Info
Compatibility:
Classic (1.15.0)
WOTLK Patch (3.4.3)
Updated:12-10-23 10:52 AM
Created:06-24-19 05:05 PM
Downloads:15,359
Favorites:38
MD5:
Categories:Classic - General, WOTLK Classic, Mage

MageButtons (Classic)  Popular! (More than 5000 hits)

Version: 1.15
by: Moxey [More]

MageButtons
- Purpose: Adds "menu" buttons for mage spell categories: water, food, teleports, portals, mana gems, polymorph

WOTLK NOTE: If "Show all spell ranks" is not checked in your spellbook, tooltips of lower ranks will only display the spell name.

Features
- Consolidates spells into collapsible buttons to save bar space (like modern teleports/portals buttons)
- Horizontal or Vertical layouts
- Menu direction left/right/up/down
- Customizable button size, padding, background color, border
- Can specify button order
- Buttons can be keybound via standard bindings page (under Addons)

Other
- First time loading it will default to a set button order, need to go into Options and actually set them for them to save (will say "not set")

Known issues / TODO:
- Keybindings are wonky, probably because I'm doing something wrong, but they mostly work?
- Need to reload UI when new spells are learned from trainer so the addon will pick them up
- Not sure if the Polymorph button is worth it, was thinking it would be nice to easily switch from Sheep to Turtle to Pig

1.15 - Updated for Season of Discovery
1.14 - ToC bump for 30403
1.13 - Disabled backdrop colors for new API compatibility
1.12 - Fixed error when summon Water Elemental in combat (but disables button order showing in options)
1.11 - Fixed some incorrect WotLK spells and added more
1.10 - Added WotLK spells, finally added required levels option for food and water
1.04 - Hopefully fixed startup error
1.03 - Increased startup delay
1.02 - Updated with TBC spells
1.01 - Set menu button strata to HIGH, updated usage
1.00 - Added mouseover option, minimap icon will now default to on
0.99 - Fix to minimap button, slash commands
0.99 - Largely rewritten, most settings changes should now occur without needing to reload
0.90 - Added check to config file to not load if character isn't a mage
Archived Files (5)
File Name
Version
Size
Author
Date
1.14
133kB
Moxey
10-11-23 06:22 PM
1.13
132kB
Moxey
01-19-23 12:10 PM
1.11
133kB
Moxey
07-21-22 03:13 PM
1.10
168kB
Moxey
07-16-22 08:49 PM
1.04
132kB
Moxey
06-20-21 04:07 PM


Post A Reply Comment Options
Unread 09-21-21, 12:11 AM  
Himitsu1990
A Kobold Labourer

Forum posts: 0
File comments: 12
Uploads: 0
Re: Re: Lua Error

Originally Posted by Moxey
Originally Posted by Himitsu1990
Whatever I open guild menu and try to click on it, or scrolldown, this error came out:
Message: [ADDON_ACTION_FORBIDDEN] AddOn 'MageButtons' tried to call the protected function 'GuildControlSetRank()'.
Time: Thu Sep 16 07:12:48 2021
Count: 1
Stack: [ADDON_ACTION_FORBIDDEN] AddOn 'MageButtons' tried to call the protected function 'GuildControlSetRank()'.
[string "@Interface_TBC\FrameXML\FriendsFrame.lua"]:2508: in function `GuildControlPopupFrame_Initialize'
[string "@Interface_TBC\FrameXML\FriendsFrame.lua"]:966: in function `FriendsFrame_OnEvent'
[string "*:OnEvent"]:1: in function <[string "*:OnEvent"]:1>
[string "=[C]"]: in function `SetGuildRosterShowOffline'
[string "*:OnClick"]:7: in function <[string "*:OnClick"]:1>
Locals: <none>

Same error was after 2.5.2 in Leatrix Maps, but they fix it on 2.5.55 version.
Tried searh for it and can't find where is any string that call for FriendsFrame.lua
I've been away from the game for a while, but I popped on to check this out and wasn't able to reproduce it. It could be another addon tainting it, but it's hard to say - MageButtons definitely shouldn't be messing with the guild/friends frames. I'd say try disabling other addons and see if it still happens, and if you can give me steps to reproduce I'll see what I can do.
Yes, it does happens if magebuttons is the only one enabled addon aswell.
Step to reproduce: Open guild menu (you should be in guild and not the only one person in it > click on some player or check "show offline players". If it not enough - click on several players to see their notes or pretend you wanna invite them to a raid. And error will pop up. Maybe on something other to do with players in guild. Aswell it cause garantee error if you are a guild master and trying to manage guild ranks or rank privileges.
Sometimes error does not pop up immediately and you can click several times on players but error will happen soon.
Last edited by Himitsu1990 : 09-21-21 at 12:13 AM.
Report comment to moderator  
Reply With Quote
Unread 09-20-21, 02:03 AM  
endymon
A Kobold Labourer

Forum posts: 0
File comments: 13
Uploads: 0
I believe I have a fix for the taint issue.

As best as I understand it, looks like there is some bug in the wow core lua that is throwing taint errors. I saw several other mods were disabling something or other (map... dropdowns or something) because of similar issues.
While I wasn't able to copy whatever they were doing (since it seemed to already be disabled in those mods), what I did end up doing was converting a bunch of global variables to local variables in a ton of places throughout Magebuttons.
Because my changes are spread out over a bunch of lines, it would be fairly difficult to indicate all of them here in replys. And since there is no git-repo available, I cannot easily share my fixes. But I can confirm... at least from the steps of opening the guild frame, that after my changes these taint errors no longer appeared.
I cannot guarantee there isn't some other UI that when opened will cause random taint issues with this mod though.



However I was digging into some discussions around WoW addons and it looks like there is a strong indication that phrasing within the EULA essentially grants blizzard sole ownership of any addons created, other licenses thus being voided/ignored.
https://www.blizzard.com/en-us/legal...ense-agreement
Specifically:
1. D. i. 4. User Created or Uploaded Content.
and
2. A. v. Computer code, including but not limited to “Applets” and source code

I'm not sure there is any legal case settling that particular matter, but as it has never come up in the 17years of wow's existence, it probably isn't likely any time soon.
But in my opinion @lfxgroove you should just re-host the repo. As long as we aren't trying to repurpose the work and claim it as anything other than fixes/enhancements to the work of the original author... and so long as the original author doesn't try to raise a stink about it (99.999% likely he won't), I think we're just making trouble for ourselves worrying about purely hypothetical copyright claims, rather than doing what we should be doing... FIXING and improving the damn mod.
Last edited by endymon : 09-20-21 at 02:15 AM.
Report comment to moderator  
Reply With Quote
Unread 09-18-21, 06:10 PM  
Moxey
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 21
Uploads: 4
Re: Lua Error

Originally Posted by Himitsu1990
Whatever I open guild menu and try to click on it, or scrolldown, this error came out:
Message: [ADDON_ACTION_FORBIDDEN] AddOn 'MageButtons' tried to call the protected function 'GuildControlSetRank()'.
Time: Thu Sep 16 07:12:48 2021
Count: 1
Stack: [ADDON_ACTION_FORBIDDEN] AddOn 'MageButtons' tried to call the protected function 'GuildControlSetRank()'.
[string "@Interface_TBC\FrameXML\FriendsFrame.lua"]:2508: in function `GuildControlPopupFrame_Initialize'
[string "@Interface_TBC\FrameXML\FriendsFrame.lua"]:966: in function `FriendsFrame_OnEvent'
[string "*:OnEvent"]:1: in function <[string "*:OnEvent"]:1>
[string "=[C]"]: in function `SetGuildRosterShowOffline'
[string "*:OnClick"]:7: in function <[string "*:OnClick"]:1>
Locals: <none>

Same error was after 2.5.2 in Leatrix Maps, but they fix it on 2.5.55 version.
Tried searh for it and can't find where is any string that call for FriendsFrame.lua
I've been away from the game for a while, but I popped on to check this out and wasn't able to reproduce it. It could be another addon tainting it, but it's hard to say - MageButtons definitely shouldn't be messing with the guild/friends frames. I'd say try disabling other addons and see if it still happens, and if you can give me steps to reproduce I'll see what I can do.
Report comment to moderator  
Reply With Quote
Unread 09-15-21, 11:03 PM  
Himitsu1990
A Kobold Labourer

Forum posts: 0
File comments: 12
Uploads: 0
Lua Error

Whatever I open guild menu and try to click on it, or scrolldown, this error came out:
Message: [ADDON_ACTION_FORBIDDEN] AddOn 'MageButtons' tried to call the protected function 'GuildControlSetRank()'.
Time: Thu Sep 16 07:12:48 2021
Count: 1
Stack: [ADDON_ACTION_FORBIDDEN] AddOn 'MageButtons' tried to call the protected function 'GuildControlSetRank()'.
[string "@Interface_TBC\FrameXML\FriendsFrame.lua"]:2508: in function `GuildControlPopupFrame_Initialize'
[string "@Interface_TBC\FrameXML\FriendsFrame.lua"]:966: in function `FriendsFrame_OnEvent'
[string "*:OnEvent"]:1: in function <[string "*:OnEvent"]:1>
[string "=[C]"]: in function `SetGuildRosterShowOffline'
[string "*:OnClick"]:7: in function <[string "*:OnClick"]:1>
Locals: <none>

Same error was after 2.5.2 in Leatrix Maps, but they fix it on 2.5.55 version.
Tried searh for it and can't find where is any string that call for FriendsFrame.lua
Last edited by Himitsu1990 : 09-15-21 at 11:21 PM.
Report comment to moderator  
Reply With Quote
Unread 08-05-21, 10:06 AM  
Oonade
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Not sure if this was posted before, but;
it should not be the hardest work to transform this into 'warlockbuttons'? For curses, demons, stones...?
I found magebuttons addon most useful in classic, now switched to warlock in TBC and I miss this kind of addon.
Report comment to moderator  
Reply With Quote
Unread 07-19-21, 02:29 AM  
lfxgroove
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Originally Posted by WoWEyE
I clicked the link to try and download it but couldnt see anywhere to do that. Is it downloadable?
There's no release/zip downloadable as that is already available here, you can however download it via git or by pressing "Code" at the top right and choozing "download zip".

Edit: I've removed the repo for now as I realized there's no license for the original code.
Last edited by lfxgroove : 07-22-21 at 02:12 AM.
Report comment to moderator  
Reply With Quote
Unread 07-12-21, 11:31 PM  
WoWEyE
A Defias Bandit

Forum posts: 2
File comments: 35
Uploads: 0
I clicked the link to try and download it but couldnt see anywhere to do that. Is it downloadable?

Originally Posted by lfxgroove
Originally Posted by endymon
Hopefully we can get a repo. IMO, every project should have a repo, even if it isn't used much.
I've went ahead and created a repo containing your published version of the code along with some fixes discussed in the comments below here: https://github.com/lfxgroove/MageButtons. Let me know if you want ownership/want me to take it down, don't mean to step on your toes or anything, just thought it'd be nice to have someplace where it's versioned
Report comment to moderator  
Reply With Quote
Unread 06-22-21, 08:34 AM  
lfxgroove
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Originally Posted by endymon
Hopefully we can get a repo. IMO, every project should have a repo, even if it isn't used much.
I've went ahead and created a repo containing your published version of the code along with some fixes discussed in the comments below here: https://github.com/lfxgroove/MageButtons. Let me know if you want ownership/want me to take it down, don't mean to step on your toes or anything, just thought it'd be nice to have someplace where it's versioned
Report comment to moderator  
Reply With Quote
Unread 06-22-21, 08:16 AM  
endymon
A Kobold Labourer

Forum posts: 0
File comments: 13
Uploads: 0
Originally Posted by lfxgroove
If it's fine with you I could create a github repo? I've got a more proper fix for the spells not loading, you should wait for the spells to load by watching the SPELL_DATA_LOAD_RESULT event, and once all spells have been loaded continue with the UI setup, that seems to work well for me at least. And it allows us to remove the C_Timer calls. The event will start plopping up after calling C_Spell.RequestLoadSpellData as was suggested by endymon.
Oooo thats even better. I'm just dipping my toes into modding, so I was looking for an event like that... but nothing jumped out at me.
Preferably we should only make ONE call to fetch spell data, but I was too lazy to figure out how to properly merge all the tables of spell IDs into one for purposes of making that call.

Hopefully we can get a repo. IMO, every project should have a repo, even if it isn't used much.

Originally Posted by lclancey
This small letter case error caused the problem that everytime you re-login game, the frame would restore to its default posion.
I don't think that line fixes the load reset problem. (What did fix it was my change on line 35
Code:
 MageButtonsDB = MageButtonsDB or {}
)
But it does look like it would fix the /command for locking not working. Good catch there.
Report comment to moderator  
Reply With Quote
Unread 06-22-21, 03:20 AM  
lfxgroove
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Originally Posted by Moxey
Think I may have finally fixed the startup error. Since it occurs inconsistently (for me, anyway), I'm going to give it a few days of testing.

No source control, this was just a pet project of mine that I thought other people might get some use out of.
If it's fine with you I could create a github repo? I've got a more proper fix for the spells not loading, you should wait for the spells to load by watching the SPELL_DATA_LOAD_RESULT event, and once all spells have been loaded continue with the UI setup, that seems to work well for me at least. And it allows us to remove the C_Timer calls. The event will start plopping up after calling C_Spell.RequestLoadSpellData as was suggested by endymon.
Report comment to moderator  
Reply With Quote
Unread 06-21-21, 09:09 PM  
lclancey
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Bug Fix for not saving frame position.

Line 63 to line 65 in file ./MageButtons.lua
magebuttons:lockAnchor()
should be
MageButtons:lockAnchor()
This small letter case error caused the problem that everytime you re-login game, the frame would restore to its default posion.

And yes, I think a source control repo, like github, would help a lot, too, makes people easily to make contributions, instead I have to register an account in this forum to leave this comment.
Report comment to moderator  
Reply With Quote
Unread 06-20-21, 02:34 AM  
Dissosiative
A Defias Bandit

Forum posts: 2
File comments: 4
Uploads: 0
Any Easy way to make it for portals when you click on it from the flipout options instead of it swapping the spell it just casts it?
Report comment to moderator  
Reply With Quote
Unread 06-16-21, 06:15 PM  
endymon
A Kobold Labourer

Forum posts: 0
File comments: 13
Uploads: 0
I believe I fixed the initial loading problem.
It was caused by spell information not yet having been downloaded from the server. So now that is forced.
Additionally cleaned up an "evil" eval. (so I could actually debug the problem)


Add these helper function somewhere (up top makes sense)
Code:
local function make_spell_table(spell_id_list)
  local tbl = {}
  --print(spell_id_list)

  for i = 1, #spell_id_list, 1 do
    if IsSpellKnown(spell_id_list[i]) then
      local name = GetSpellInfo(spell_id_list[i])
      local subtext = GetSpellSubtext(spell_id_list[i]) or ''  -- NOTE will return nil at first unless its locally cached
      name = name .. "(" .. subtext .. ")"  -- For some reason the "()" are required for tooltips
      table.insert(tbl, name)
    end
  end

  return tbl
end

local function preload_spell_data(spell_id_list)
    for k = 1, #spell_id_list, 1 do
        C_Spell.RequestLoadSpellData(spell_id_list[k])
    end
end
Replace the entire onEvent function (tabbing may not be aligned right, but can be ignored)
Code:
local function onevent(self, event, addonName, ...)
    if (addonName ~= "MageButtons" or  event ~= "ADDON_LOADED") then
        return
    end
	--print(event)
		
	-- Set up lists of spells
    -- Bottom <--> Top
	WaterSpells = {5504, 5505, 5506, 6127, 10138, 10139, 10140, 37420, 43987, 27090}
	FoodSpells  = {587, 597, 990, 6129, 10144, 10145, 28612, 33717}
	TeleportSpells = {}
	PortalSpells  = {}

	if UnitFactionGroup("player") == "Alliance" then
              -- Darnassus (3565), Exodar (32271), Theramore (49359), Ironforge (3562), Stormwind (3561), Shattrath (33690)
		TeleportSpells = {3565, 32271, 49359, 3562, 3561, 33690} -- {3565, 3561, 3562, 32271, 49359, 33690}
              -- Darnassus (11419), Exodar (32266) Theramore (49360) Ironforge (11416) Stormwind (10059), Shattrath (33691)
		PortalSpells   = {11419, 32266, 49360, 11416, 10059, 33691} -- {11419, 10059, 11416, 32266, 49360, 33691}
	else
              -- Silvermoon (32272), Undercity (3563), Thunder Bluff (3566), Stonard (49358), Orgrimmar (3567), Shattrath (35715)
		TeleportSpells = {32272, 3563, 3566, 49358, 3567, 35715} -- {3566, 3563, 3567, 32272, 49358, 35715}
              -- Silvermoon (32267), Undercity (11418), Thunder Bluff (11420), Stonard (49361), Orgrimmar (11417), Shattrath (35717)
		PortalSpells   = {32267, 11418, 11420, 49361, 11417, 35717} -- {11420, 11418, 11417, 32267, 49361, 35717}
	end
	GemSpells = {759, 3552, 10053, 10054, 27101}
    -- pig, turtle, ???
    PolymorphSpells = {28272, 28271, 28270}  -- REM: insert basic sheep a little later
			
    -- Immediately load spell data (for rank info) so it'll be available a little later to create the addon buttons
    preload_spell_data(WaterSpells)
    preload_spell_data(FoodSpells)
    preload_spell_data(TeleportSpells)
    preload_spell_data(PortalSpells)
    preload_spell_data(GemSpells)
    preload_spell_data(PolymorphSpells)
    preload_spell_data({12826, 12825, 12824, 118}) -- Basic sheep spell ranks

	-- Needs a slight delay on initial startup to allow for spell data to load
	C_Timer.After(6, function()

		-- Choose the highest rank of sheep polymorph
        local sheep = 9999 -- A spell you will never know

		if     IsSpellKnown(12826) then sheep = 12826   -- rank 4
		elseif IsSpellKnown(12825) then sheep = 12825   -- rank 3
		elseif IsSpellKnown(12824) then sheep = 12824   -- rank 2
		elseif IsSpellKnown(118)   then sheep = 118     -- rank 1
           end
		table.insert(PolymorphSpells, 1, sheep)

        -- Create the various spell tables using helper function
        WaterTable     = make_spell_table(WaterSpells)
        FoodTable      = make_spell_table(FoodSpells)
        TeleportsTable = make_spell_table(TeleportSpells)
        PortalsTable   = make_spell_table(PortalSpells)
        GemsTable      = make_spell_table(GemSpells)
        PolymorphTable = make_spell_table(PolymorphSpells)
			
		-- Get saved frame location
		local relPoint, anchorX, anchorY = addon:getAnchorPosition()
		MageButtonsConfig:ClearAllPoints()
		MageButtonsConfig:SetPoint(relPoint, UIParent, relPoint, anchorX, anchorY)
		
		
		addon:makeBaseButtons()

		-----------------
		-- Data Broker --
		-----------------
		lockStatus = addon:getSV("framelock", "lock")
		
		db = LibStub("AceDB-3.0"):New("MageButtonsDB", SettingsDefaults)
		MageButtonsDB.db = db;
		MageButtonsMinimapData = ldb:NewDataObject("MageButtons",{
			type = "data source",
			text = "MageButtons",
			icon = "Interface/Icons/Spell_Holy_MagicalSentry.blp",
			OnClick = function(self, button)
				if button == "RightButton" then
					if IsShiftKeyDown() then
						MageButtons:maptoggle("0")
						print("MageButtons: Hiding icon, re-enable with: /MageButtons minimap 1")
					else
						InterfaceOptionsFrame_OpenToCategory(mbPanel)
						InterfaceOptionsFrame_OpenToCategory(mbPanel)
						InterfaceOptionsFrame_OpenToCategory(mbPanel)
					end
				
				elseif button == "LeftButton" then
					if lockStatus == 0 then
						-- Not locked, lock it and save the anchor position
						addon:lockAnchor()
					else
						-- locked, unlock
						addon:unlockAnchor()
					end
				end
			end,
			
			-- Minimap Icon tooltip
			OnTooltipShow = function(tooltip)
				tooltip:AddLine("|cffffffffMageButtons|r\nLeft-click to lock/unlock.\nRight-click to configure.\nShift+Right-click to hide minimap button.")
			end,
		})
		
		-- display the minimap icon?
		local mmap = addon:getSV("minimap", "icon") or 1
		if mmap == 1 then
			MageButtonsMinimapIcon:Register("mageButtonsIcon", MageButtonsMinimapData, MageButtonsDB)
			addon:maptoggle(1)
		else
			addon:maptoggle(0)
		end
	end); --end of slight delay
end
Report comment to moderator  
Reply With Quote
Unread 06-16-21, 03:29 PM  
Moxey
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 21
Uploads: 4
Think I may have finally fixed the startup error. Since it occurs inconsistently (for me, anyway), I'm going to give it a few days of testing.

No source control, this was just a pet project of mine that I thought other people might get some use out of.
Report comment to moderator  
Reply With Quote
Unread 06-16-21, 03:01 PM  
endymon
A Kobold Labourer

Forum posts: 0
File comments: 13
Uploads: 0
Is there a source control repo for this addon? github hopefully?
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: