Skip to content

Commit cec9b08

Browse files
committed
bugfix: fix +1 suffix breaking UI by refreshing affix controls
1 parent ce8bffa commit cec9b08

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

spec/System/TestItemsTab_spec.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,29 @@ describe("TestItemsTab", function()
650650
assert.is_true(foundMaximumRage)
651651
end)
652652

653+
it("refreshes affix controls when an augment changes affix limits", function ()
654+
build.itemsTab:CreateDisplayItemFromRaw([[
655+
Rarity: RARE
656+
New
657+
Stocky Mitts
658+
Sockets: S
659+
]], true)
660+
661+
local runeControl = build.itemsTab.controls.displayItemRune1
662+
for index, rune in ipairs(runeControl.list) do
663+
if rune.name == "Serle's Triumph" then
664+
runeControl:SetSel(index)
665+
break
666+
end
667+
end
668+
669+
local affixControl = build.itemsTab.controls.displayItemAffix7
670+
assert.are.equals(7, build.itemsTab.displayItem.affixLimit)
671+
assert.are.equals("suffixes", affixControl.outputTable)
672+
assert.are.equals("None", affixControl.list[1])
673+
affixControl.tooltipFunc({ Clear = function() end }, "BODY", affixControl.selIndex, nil)
674+
end)
675+
653676
it("keeps Darkness Enthroned's socket editor available at zero sockets", function ()
654677
build.itemsTab:CreateDisplayItemFromRaw([[
655678
Item Class: Belts

src/Classes/ItemsTab.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ holding Shift will put it in the second.]])
700700
self.displayItem.runes[i] = value.name
701701
self.displayItem:UpdateRunes()
702702
self.displayItem:BuildAndParseRaw()
703+
self:UpdateRuneControls()
703704
self:UpdateDisplayItemTooltip()
704705
end)
705706
drop.y = function()
@@ -808,7 +809,7 @@ holding Shift will put it in the second.]])
808809
return i == 1 and 0 or 24 + (prev.slider:IsShown() and 18 or 0)
809810
end
810811
drop.tooltipFunc = function(tooltip, mode, index, value)
811-
local modList = value.modList
812+
local modList = value and value.modList
812813
if not modList or main.popups[1] or mode == "OUT" or (self.selControl and self.selControl ~= drop) then
813814
tooltip:Clear()
814815
elseif tooltip:CheckForUpdate(modList) then
@@ -2035,6 +2036,10 @@ function ItemsTabClass:UpdateRuneControls()
20352036
if runesUpdated then
20362037
item:UpdateRunes()
20372038
end
2039+
-- Socketed augments can change the available prefix and suffix slots, e.g. Serle's Triumph.
2040+
if item.crafted then
2041+
self:UpdateAffixControls()
2042+
end
20382043
end
20392044

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

0 commit comments

Comments
 (0)