Skip to content

Commit 3fc2fe0

Browse files
committed
fix hotbar slots having their position messed up because of RestrictToParent being true while loading from JSON
1 parent c0f41e4 commit 3fc2fe0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Intersect.Client.Core/Interface/Game/Hotbar/HotBarWindow.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public HotBarWindow(Canvas gameCanvas) : base(gameCanvas, nameof(HotBarWindow))
3333

3434
SizeToChildren();
3535
LoadJsonUi(GameContentManager.UI.InGame, Graphics.Renderer.GetResolutionString());
36+
foreach (var item in Items)
37+
{
38+
item.RestrictToParent = true;
39+
}
3640
SizeToChildren();
3741
}
3842

Intersect.Client.Core/Interface/Game/Hotbar/HotbarItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public HotbarItem(int hotbarSlotIndex, Base hotbarWindow)
5353
Width = 36;
5454
Height = 36;
5555
Margin = new Margin(column > 0 ? 4 : 0, row > 0 ? 4 : 0, 0, 0);
56-
RestrictToParent = true;
56+
RestrictToParent = false;
5757
TextureFilename = "hotbaritem.png";
5858

5959
Icon.Name = $"{nameof(HotbarItem)}{SlotIndex}";

0 commit comments

Comments
 (0)