public override void Close() { Instance = null; ClientCommand clientCommand = new ClientCommand(ClientCommand.CommandType.CloseShop); RpgClientConnection.Instance.AddClientCommand(clientCommand); base.Close(); }
public ShopPanel(GameState state, ShopData shopData) : base(((int)MessagePanel.Instance.GetBodySize().X / 2) - 200, ((int)Renderer.GetResoultion().Y / 2) - 325, 400, 400, BarMode.Close, state) { if (Instance != null) { Instance.Close(); } Instance = this; _gameState = state; _shopData = shopData; this.SetPanelLabel(_shopData.Name); DisableHorizontalScroll(); //EnableVerticalScroll(); int slotSize = GetContentWidth() / 5; int rows = (int)Math.Ceiling(_shopData.ShopItems.Count / 5f); SetScrollableHeight(slotSize * rows); }