Skip to content

Commit

Permalink
Fix access to runeslot for sod only
Browse files Browse the repository at this point in the history
  • Loading branch information
RagedUnicorn committed Jan 13, 2025
1 parent 9b21a70 commit b5641b4
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions gui/GM_GearBarChangeMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,24 @@ function me.UpdateChangeSlot(changeSlot, gearSlotMetaData, item, changeSlotSize)
changeSlot.enchantId = item.enchantId
changeSlot.runeAbilityId = (item.rune and item.rune.skillLineAbilityID) or nil
changeSlot.runeName = (item.rune and item.rune.name) or nil
changeSlot.runeSlot.icon:SetTexture((item.rune and item.rune.iconTexture) or nil)

me.UpdateRuneSlotTexture(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
Expand Down Expand Up @@ -265,11 +278,23 @@ function me.UpdateEmptyChangeSlot(changeMenu, itemCount, gearSlotMetaData, empty
emptyChangeMenuSlot.enchantId = nil
emptyChangeMenuSlot.runeAbilityId = nil
emptyChangeMenuSlot.runeName = nil
emptyChangeMenuSlot.runeSlot.icon:SetTexture(nil)

me.ClearRuneSlotTexture(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
Expand Down

0 comments on commit b5641b4

Please sign in to comment.