Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions spec/System/TestItemsTab_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,29 @@ describe("TestItemsTab", function()
assert.is_true(foundMaximumRage)
end)

it("refreshes affix controls when an augment changes affix limits", function ()
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: RARE
New
Stocky Mitts
Sockets: S
]], true)

local runeControl = build.itemsTab.controls.displayItemRune1
for index, rune in ipairs(runeControl.list) do
if rune.name == "Serle's Triumph" then
runeControl:SetSel(index)
break
end
end

local affixControl = build.itemsTab.controls.displayItemAffix7
assert.are.equals(7, build.itemsTab.displayItem.affixLimit)
assert.are.equals("suffixes", affixControl.outputTable)
assert.are.equals("None", affixControl.list[1])
affixControl.tooltipFunc({ Clear = function() end }, "BODY", affixControl.selIndex, nil)
end)

it("keeps Darkness Enthroned's socket editor available at zero sockets", function ()
build.itemsTab:CreateDisplayItemFromRaw([[
Item Class: Belts
Expand Down
7 changes: 6 additions & 1 deletion src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ holding Shift will put it in the second.]])
self.displayItem.runes[i] = value.name
self.displayItem:UpdateRunes()
self.displayItem:BuildAndParseRaw()
self:UpdateRuneControls()
self:UpdateDisplayItemTooltip()
end)
drop.y = function()
Expand Down Expand Up @@ -808,7 +809,7 @@ holding Shift will put it in the second.]])
return i == 1 and 0 or 24 + (prev.slider:IsShown() and 18 or 0)
end
drop.tooltipFunc = function(tooltip, mode, index, value)
local modList = value.modList
local modList = value and value.modList
if not modList or main.popups[1] or mode == "OUT" or (self.selControl and self.selControl ~= drop) then
tooltip:Clear()
elseif tooltip:CheckForUpdate(modList) then
Expand Down Expand Up @@ -2035,6 +2036,10 @@ function ItemsTabClass:UpdateRuneControls()
if runesUpdated then
item:UpdateRunes()
end
-- Socketed augments can change the available prefix and suffix slots, e.g. Serle's Triumph.
if item.crafted then
self:UpdateAffixControls()
end
end

function ItemsTabClass:UpdateAffixControl(control, item, type, outputTable, outputIndex)
Expand Down