Skip to content

Commit d6f4aa3

Browse files
authored
Dynamically position elements in items tab based on portrait mode (#9440)
1 parent d8c0b1d commit d6f4aa3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Classes/ItemsTab.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,14 @@ function ItemsTabClass:Draw(viewPort, inputEvents)
13071307

13081308
self:UpdateSockets()
13091309

1310+
if main.portraitMode then
1311+
self.controls.itemList:SetAnchor("TOPRIGHT", self.lastSlot, "BOTTOMRIGHT", 0, 40)
1312+
else
1313+
self.controls.itemList:SetAnchor("TOPLEFT", self.controls.setManage, "TOPRIGHT", 20, 20)
1314+
end
1315+
self.controls.craftDisplayItem:SetAnchor("TOPLEFT", main.portraitMode and self.controls.setManage or self.controls.itemList, "TOPRIGHT", 20, main.portraitMode and 0 or -20)
1316+
self.anchorDisplayItem:SetAnchor("TOPLEFT", main.portraitMode and self.controls.setManage or self.controls.itemList, "TOPRIGHT", 20, main.portraitMode and 0)
1317+
13101318
self:DrawControls(viewPort)
13111319
if self.controls.scrollBarH:IsShown() then
13121320
self.controls.scrollBarH:Draw(viewPort)
@@ -1424,10 +1432,6 @@ function ItemsTabClass:UpdateSockets()
14241432
self.sockets[nodeId].label = "Socket #"..index
14251433
self.lastSlot = self.sockets[nodeId]
14261434
end
1427-
1428-
if main.portraitMode then
1429-
self.controls.itemList:SetAnchor("TOPRIGHT",self.lastSlot,"BOTTOMRIGHT", 0, 40)
1430-
end
14311435
end
14321436

14331437
-- Returns the slot control and equipped jewel for the given node ID

0 commit comments

Comments
 (0)