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/TestItemMods_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,29 @@ describe("TetsItemMods", function()
assert.is_true(controls.displayItemCustomModifierRemove1:IsShown())
end)

it("hides custom modifier controls after saving the display item", function()
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: RARE
Test Item
Iron Ring
Implicits: 1
Adds 1 to 4 Physical Damage to Attacks
{crafted}+8 to Strength
]])

local controls = build.itemsTab.controls
assert.is_true(controls.displayItemCustomModifierRemove1:IsShown())
assert.is_true(controls.displayItemCustomModifier1:IsShown())

build.itemsTab:AddDisplayItem()

assert.is_nil(build.itemsTab.displayItem)
assert.is_falsy(controls.displayItemSectionCustom:IsShown())
assert.is_falsy(controls.displayItemCustomModifierRemove1:IsShown())
assert.is_falsy(controls.displayItemCustomModifier1:IsShown())
assert.is_falsy(controls.displayItemCustomModifierLabel1:IsShown())
end)

it("shows affix controls for items crafted in Path of Building", function()
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: RARE
Expand Down
3 changes: 3 additions & 0 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,9 @@ holding Shift will put it in the second.]])
self.controls.displayItemSectionCustom = new("Control", {"TOPLEFT",self.controls.displayItemSectionAffix,"BOTTOMLEFT",true}, {0, 0, 0, function()
return (self.controls.displayItemAddCustom:IsShown() or self.controls.displayItemAddCrucible:IsShown()) and 28 + self.displayItem.customCount * 22 or 0
end})
self.controls.displayItemSectionCustom.shown = function()
return self.displayItem ~= nil
end
self.controls.displayItemAddCustom = new("ButtonControl", {"TOPLEFT",self.controls.displayItemSectionCustom,"TOPLEFT"}, {0, 0, 120, 20}, "Add modifier...", function()
self:AddCustomModifierToDisplayItem()
end)
Expand Down
Loading