Quantcast
WoWInterface: SVN - HealMeNow - Blame - Rev 3 - /trunk/Core.lua

WoWInterface SVN HealMeNow

[/] [trunk/] [Core.lua] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 SeiferTim-84726
local L = LibStub( "AceLocale-3.0" ):GetLocale( "HealMeNow" );
2 SeiferTim-84726
HealMeNow = LibStub("AceAddon-3.0"):NewAddon("HealMeNow", "AceConsole-3.0", "AceEvent-3.0")
3 SeiferTim-84726
 
4 SeiferTim-84726
local options = {
5 SeiferTim-84726
   name = "HealMeNow",
6 SeiferTim-84726
   handler = HealMeNow,
7 SeiferTim-84726
   type = "group",
8 SeiferTim-84726
   args = {
9 SeiferTim-84726
 
10 SeiferTim-84726
   },
11 SeiferTim-84726
}
12 SeiferTim-84726
 
13 SeiferTim-84726
local HealingDB = {
14 SeiferTim-84726
   Spells = {
15 SeiferTim-84726
     L["Priest"] = {
16 SeiferTim-84726
       L["Lesser Heal"] = {
17 SeiferTim-84726
 
18 SeiferTim-84726
       },
19 SeiferTim-84726
       L["Renew"] = {
20 SeiferTim-84726
 
21 SeiferTim-84726
       },
22 SeiferTim-84726
       L["Heal"] = {
23 SeiferTim-84726
 
24 SeiferTim-84726
       },
25 SeiferTim-84726
       L["Flash Heal"] = {
26 SeiferTim-84726
 
27 SeiferTim-84726
       },
28 SeiferTim-84726
       L["Prayer of Healing"] = {
29 SeiferTim-84726
 
30 SeiferTim-84726
       },
31 SeiferTim-84726
       L["Greater Heal"] = {
32 SeiferTim-84726
 
33 SeiferTim-84726
       },
34 SeiferTim-84726
       L["Binding Heal"] = {
35 SeiferTim-84726
 
36 SeiferTim-84726
       },
37 SeiferTim-84726
       L["Prayer of Mending"] = {
38 SeiferTim-84726
 
39 SeiferTim-84726
       },
40 SeiferTim-84726
     },
41 SeiferTim-84726
   },
42 SeiferTim-84726
   Items = {
43 SeiferTim-84726
 
44 SeiferTim-84726
   }
45 SeiferTim-84726
}
46 SeiferTim-84726
 
47 SeiferTim-84726
 
48 SeiferTim-84726
 
49 SeiferTim-84726
function HealMeNow:OnInitialize()
50 SeiferTim-84726
   -- Called on Load
51 SeiferTim-84726
   LibStub("AceConfig-3.0"):RegisterOptionsTable("HealMeNow", options, {L["healmenow"], L["hmn"]})
52 SeiferTim-84726
end
53 SeiferTim-84726
 
54 SeiferTim-84726
function HealMeNow:OnEnable()
55 SeiferTim-84726
   -- Called on Enable
56 SeiferTim-84726
   self:RegisterEvent("BAG_UPDATE")
57 SeiferTim-84726
end
58 SeiferTim-84726
 
59 SeiferTim-84726
function HealMeNow:OnDisable()
60 SeiferTim-84726
   -- Called on Disable
61 SeiferTim-84726
end
62 SeiferTim-84726
 
63 SeiferTim-84726
function HealMeNow:BAG_UPDATE(arg1)
64 SeiferTim-84726
   self:BagScan(arg1)
65 SeiferTim-84726
end
66 SeiferTim-84726
 
67 SeiferTim-84726
function HealMeNow:IsHealingItem(itemName)
68 SeiferTim-84726
 
69 SeiferTim-84726
end
70 SeiferTim-84726
 
71 SeiferTim-84726
function HealMeNow:BagScan(bag)
72 SeiferTim-84726
 for slot = 1,GetContainerNumSlots(bag) do
73 SeiferTim-84726
   local item = GetContainerItemLink(bag,slot)
74 SeiferTim-84726
   if item then
75 SeiferTim-84726
     itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture = GetItemInfo(item)
76 SeiferTim-84726
     if itemType = L["Consumable"] then
77 SeiferTim-84726
       if IsHealingItem(itemName) then
78 SeiferTim-84726
 
79 SeiferTim-84726
       end
80 SeiferTim-84726
     end
81 SeiferTim-84726
   end
82 SeiferTim-84726
 end
83 SeiferTim-84726
end
84 SeiferTim-84726
 
85 SeiferTim-84726
-- affectingCombat = UnitAffectingCombat("unit");
86 SeiferTim-84726
-- ItemLink = GetContainerItemLink(bagID, slotID);