Skip to content

Commit 7b40b3e

Browse files
committed
generating default shop item
1 parent 9dafbaf commit 7b40b3e

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

Intersect.Client.Core/Interface/Game/Shop/ShopItem.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,37 @@ public ShopItem(ShopWindow shopWindow, Base parent, int index) : base(parent, na
2828
_shopWindow = shopWindow;
2929
_mySlot = index;
3030

31-
_iconImage = new ImagePanel(this, "ShopItemIcon");
31+
MinimumSize = new Point(34, 35);
32+
Margin = new Margin(4, 4, 4, 4);
33+
MouseInputEnabled = true;
34+
TextureFilename = "shopitem.png";
35+
36+
_iconImage = new ImagePanel(this, "ShopItemIcon")
37+
{
38+
MinimumSize = new Point(32, 32),
39+
MouseInputEnabled = true,
40+
Alignment = [Alignments.Center],
41+
HoverSound = "octave-tap-resonant.wav",
42+
};
3243
_iconImage.HoverEnter += _iconImage_HoverEnter;
3344
_iconImage.HoverLeave += _iconImage_HoverLeave;
3445
_iconImage.Clicked += _iconImage_RightClicked;
3546
_iconImage.DoubleClicked += _iconImage_DoubleClicked;
3647

48+
LoadJsonUi(GameContentManager.UI.InGame, Graphics.Renderer.GetResolutionString());
49+
3750
// Generate our context menu with basic options.
3851
_contextMenu = new ContextMenu(Interface.CurrentInterface.Root, "ShopContextMenu")
3952
{
4053
IsHidden = true,
41-
IconMarginDisabled = true
54+
IconMarginDisabled = true,
4255
};
4356

44-
LoadJsonUi(GameContentManager.UI.InGame, Graphics.Renderer.GetResolutionString());
57+
var font = GameContentManager.Current.GetFont(name: "sourcesansproblack");
58+
if (font != default)
59+
{
60+
_contextMenu.SetItemFont(font, 10);
61+
}
4562

4663
//TODO: Is this a memory leak?
4764
_contextMenu.ClearChildren();

0 commit comments

Comments
 (0)