Skip to content

Commit 76b17e9

Browse files
github-actions[bot]meehlLocalIdentity
authored
Dynamically position elements in items tab (#1987)
* Apply changes from PathOfBuildingCommunity/PathOfBuilding#9440 * Fix merge --------- Co-authored-by: meehl <meehl@users.noreply.github.com> Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent ad5e10a commit 76b17e9

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/Classes/ItemsTab.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,14 @@ function ItemsTabClass:Draw(viewPort, inputEvents)
13571357
-- Update weapon slots in case we got Giant's Blood from somewhere
13581358
self.slots["Weapon 2"]:Populate()
13591359
self.slots["Weapon 2 Swap"]:Populate()
1360+
1361+
if main.portraitMode then
1362+
self.controls.itemList:SetAnchor("TOPRIGHT", self.lastSlot, "BOTTOMRIGHT", 0, 40)
1363+
else
1364+
self.controls.itemList:SetAnchor("TOPLEFT", self.controls.setManage, "TOPRIGHT", 20, 20)
1365+
end
1366+
self.controls.craftDisplayItem:SetAnchor("TOPLEFT", main.portraitMode and self.controls.setManage or self.controls.itemList, "TOPRIGHT", 20, main.portraitMode and 0 or -20)
1367+
self.anchorDisplayItem:SetAnchor("TOPLEFT", main.portraitMode and self.controls.setManage or self.controls.itemList, "TOPRIGHT", 20, main.portraitMode and 0)
13601368

13611369
self:DrawControls(viewPort)
13621370
if self.controls.scrollBarH:IsShown() then
@@ -1475,10 +1483,6 @@ function ItemsTabClass:UpdateSockets()
14751483
self.sockets[nodeId].label = "Socket #"..index
14761484
self.lastSlot = self.sockets[nodeId]
14771485
end
1478-
1479-
if main.portraitMode then
1480-
self.controls.itemList:SetAnchor("TOPRIGHT",self.lastSlot,"BOTTOMRIGHT", 0, 40)
1481-
end
14821486
self.initSockets = false
14831487
end
14841488

0 commit comments

Comments
 (0)