diff --git a/spec/System/TestItemsTab_spec.lua b/spec/System/TestItemsTab_spec.lua index fda210ce6e..2b3ea7e549 100644 --- a/spec/System/TestItemsTab_spec.lua +++ b/spec/System/TestItemsTab_spec.lua @@ -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 diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 797acf629c..ddac9f9277 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -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() @@ -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 @@ -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)