diff --git a/gui/GM_EngraveFrame.lua b/gui/GM_EngraveFrame.lua index 83658eb..3bece69 100644 --- a/gui/GM_EngraveFrame.lua +++ b/gui/GM_EngraveFrame.lua @@ -113,4 +113,30 @@ function me.UpdateRuneSlotTexture(gearSlot, gearSlotMetaData) end end +--[[ + Updates the changeMenu rune slot texture + + @param {table} changeSlot + @param {table} item +]]-- +function me.UpdateChangeMenuRuneSlotTexture(changeSlot, item) + if not mod.season.IsSodActive() then return end + + if not mod.configuration.IsRuneSlotsEnabled() then + me.ClearChangeMenuRuneSlotTexture(changeSlot) + return + end + changeSlot.runeSlot.icon:SetTexture((item.rune and item.rune.iconTexture) or nil) +end + +--[[ + Clear the changeMenu rune slot texture + + @param {table} slot +]]-- +function me.ClearChangeMenuRuneSlotTexture(slot) + if not mod.season.IsSodActive() then return end + + slot.runeSlot.icon:SetTexture(nil) +end diff --git a/gui/GM_GearBarChangeMenu.lua b/gui/GM_GearBarChangeMenu.lua index f7a42eb..af9cb1f 100644 --- a/gui/GM_GearBarChangeMenu.lua +++ b/gui/GM_GearBarChangeMenu.lua @@ -185,23 +185,12 @@ function me.UpdateChangeSlot(changeSlot, gearSlotMetaData, item, changeSlotSize) changeSlot.runeAbilityId = (item.rune and item.rune.skillLineAbilityID) or nil changeSlot.runeName = (item.rune and item.rune.name) or nil - me.UpdateRuneSlotTexture(changeSlot, item) + mod.engraveFrame.UpdateChangeMenuRuneSlotTexture(changeSlot, item) changeSlot.itemTexture:SetTexture(item.icon) changeSlot:Show() end ---[[ - Updates the rune slot texture if engraving is active - - @param {table} changeSlot - @param {table} item -]]-- -function me.UpdateRuneSlotTexture(changeSlot, item) - if not mod.engrave.IsEngravingActive() or not changeSlot.runeSlot then return end - changeSlot.runeSlot.icon:SetTexture((item.rune and item.rune.iconTexture) or nil) -end - --[[ Update the changeSlotSize to the configured one @@ -279,22 +268,12 @@ function me.UpdateEmptyChangeSlot(changeMenu, itemCount, gearSlotMetaData, empty emptyChangeMenuSlot.runeAbilityId = nil emptyChangeMenuSlot.runeName = nil - me.ClearRuneSlotTexture(emptyChangeMenuSlot) + mod.engraveFrame.ClearChangeMenuRuneSlotTexture(emptyChangeMenuSlot) emptyChangeMenuSlot.itemTexture:SetTexture(gearSlotMetaData.textureId) emptyChangeMenuSlot:Show() end ---[[ - Clear the rune slot texture if engraving is active - - @param {table} slot -]]-- -function me.ClearRuneSlotTexture(slot) - if not mod.engrave.IsEngravingActive() or not slot.runeSlot then return end - slot.runeSlot.icon:SetTexture(nil) -end - --[[ Updates the changeMenuFrame size depending on how many changeslots are displayed at the time