View Single Post
05-07-15, 07:14 AM   #8
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
Just a suggestion if any addon developer is looking for something to do. I would do it but I am working on another addon at the moment and it would require me a lot of time to test parsing (I will get good at it some day). But you pros could do it in 15 minutes I think.
First, an addon that suppress the need of using #showtooltip (only in the cases you don't use parameters after it) in macros with this simple code (not only in the item macros but no macro would need a #showtooltip anymore to display the tooltip)
Lua Code:
  1. hooksecurefunc(GameTooltip,"SetAction",function(self,action)
  2.     local action_type,macro_id = GetActionInfo(action)
  3.     if action_type=="macro" then
  4.         local _,_,spell_id = GetMacroSpell(macro_id)
  5.         if spell_id then
  6.             GameTooltip:SetSpellByID(spell_id)
  7.         else
  8.             local _,link = GetMacroItem(macro_id)
  9.             if link then
  10.                 GameTooltip:SetHyperlink(link)
  11.             end
  12.         end
  13.         GameTooltip:Show()
  14.     end
  15. end)
This will give you space to put a /click N_items and N_items would pick the current macro text (by using GetMacroInfo(GetRunningMacro())), parse the lines with /use on them, get all items in the order they were put in the macro and do a check like in the link I provided. In this way you would avoid hardcoding the macro items into the addon. Just using the macro would inform the addon all the items to check and update the icon accordingly. This might not be all but I think the idea is clear enough.
__________________
"In this world nothing can be said to be certain, except that fractional reserve banking is a Ponzi scheme and that you won't believe it." - Mandrill

Last edited by Banknorris : 05-07-15 at 07:23 AM.
  Reply With Quote