Skip to content

Commit fb3c1a7

Browse files
committed
remove redundant info to context menu
1 parent 8950ac5 commit fb3c1a7

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,7 @@ private void _iconImage_DoubleClicked(Base sender, MouseButtonState arguments)
145145

146146
private void _buyMenuItem_Clicked(Base sender, Framework.Gwen.Control.EventArguments.MouseButtonState arguments)
147147
{
148-
if (sender.Parent?.UserData is not int slot)
149-
{
150-
return;
151-
}
152-
153-
Globals.Me?.TryBuyItem(slot);
148+
Globals.Me?.TryBuyItem(_mySlot);
154149
}
155150

156151
protected override void Dispose(bool disposing)
@@ -161,20 +156,17 @@ protected override void Dispose(bool disposing)
161156

162157
public void OpenContextMenu(int slot)
163158
{
164-
if (Globals.GameShop?.SellingItems[slot] == default)
159+
if (Globals.GameShop is not { SellingItems.Count: > 0 } gameShop)
165160
{
166161
return;
167162
}
168163

169-
if (!ItemBase.TryGet(Globals.GameShop.SellingItems[slot].ItemId, out var item))
164+
if (!ItemBase.TryGet(gameShop.SellingItems[slot].ItemId, out var item))
170165
{
171166
return;
172167
}
173168

174169
_buyMenuItem.SetText(Strings.ShopContextMenu.Buy.ToString(item.Name));
175-
176-
_contextMenu.UserData = slot;
177-
_contextMenu.SizeToChildren();
178170
_contextMenu.Open(Pos.None);
179171
}
180172

0 commit comments

Comments
 (0)