Quantcast

Add handler for iLvl changes from equipment change

MilleXIV [09-01-16 - 22:50]
Add handler for iLvl changes from equipment change
Filename
modules/armor.lua
diff --git a/modules/armor.lua b/modules/armor.lua
index e7698cf..4b7b39c 100644
--- a/modules/armor.lua
+++ b/modules/armor.lua
@@ -50,6 +50,7 @@ end

 function ArmorModule:RegisterFrameEvents()
   self.armorButton:EnableMouse(true)
+  self.armorButton:RegisterUnitEvent('UNIT_INVENTORY_CHANGED', 'player')

   self.armorButton:SetScript('OnEnter', function()
     ArmorModule:SetArmorColor()
@@ -70,6 +71,12 @@ function ArmorModule:RegisterFrameEvents()
     GameTooltip:Hide()
   end)

+  self.armorButton:SetScript('OnEvent', function(_, event)
+    if event == 'UNIT_INVENTORY_CHANGED' then
+      self:Refresh()
+    end
+  end)
+
   self:RegisterMessage('XIVBar_FrameHide', function(_, name)
     if name == 'microMenuFrame' then
       self:Refresh()
@@ -134,7 +141,6 @@ function ArmorModule:Refresh()
 end

 function ArmorModule:UPDATE_INVENTORY_DURABILITY()
-  self:UpdateDurabilityText()
   self:Refresh()
 end