Skip to content
Merged
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
12 changes: 12 additions & 0 deletions spec/System/TestTradeQueryGenerator_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ describe("TradeQueryGenerator", function()
end)
end)

describe("Eldritch mods", function()
it("shows the Eldritch options for amulets", function()
local queryGen = new("TradeQueryGenerator"):TradeQueryGenerator({ itemsTab = { items = { } } })
queryGen:RequestQuery({ slotName = "Amulet" }, {
slotTbl = { slotName = "Amulet", alreadyCorrupted = false },
}, { }, function() end)

assert.is_not_nil(main.popups[1].controls.includeEldritch)
main:ClosePopup()
end)
end)

describe("WeightedRatioOutputs", function()
local maxStatIncrease

Expand Down
7 changes: 6 additions & 1 deletion src/Classes/Control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ local rect = {
---@field shown Prop<boolean>
---@field x Prop<number>?
---@field y Prop<number>?
---@field collapseY number? An additional offset which is applied when this control uses a collapsed anchor.
---@field collapseX number? An additional offset which is applied when this control uses a collapsed anchor.
local ControlClass = newClass("Control")

---@alias ControlAnchor [AnchorPoint, Control|ControlHost, AnchorPoint, boolean|nil]
Expand Down Expand Up @@ -87,7 +89,10 @@ end

function ControlClass:GetPos()
if self.anchor.collapse and self.anchor.other and not self.anchor.other:GetProperty("shown") then
return self.anchor.other:GetPos()
local x, y = self.anchor.other:GetPos()
x = x + (self.collapseX or 0)
y = y + (self.collapseY or 0)
return x, y
end
local x = self:GetProperty("x")
local y = self:GetProperty("y")
Expand Down
Loading
Loading