Beispiel #1
0
        /// <summary>
        /// Поместить выбранный предмет (PictureBox) в фокус.
        /// </summary>
        /// <param name="pictureBox">Выбранный предмет (PictureBox).</param>
        private void SetSelectedPictureBox(PictureBox pictureBox)
        {
            if (_selectedPictureBox != null)
                _selectedPictureBox.BorderStyle = BorderStyle.None;

            _selectedPictureBox = pictureBox;
            _selectedPictureBox.BorderStyle = BorderStyle.Fixed3D;

            ItemInfo_Label.Text = ToolTip1.GetToolTip(_selectedPictureBox);

            if (InventoryPanel.Controls.Contains(_selectedPictureBox))
            {
                var itemIndex = GetSelectedItemIndex();
                Sell_Button.Text = $"Sell for:{Environment.NewLine}{InventoryController.GetSellGoldValueOfItem(itemIndex)}";
            }
            else if (SellingItemsPanel.Controls.Contains(_selectedPictureBox))
            {
                var index = SellingItemsPanel.Controls.IndexOf(_selectedPictureBox);
                var sellingItem = _sellingItems[index];
                BuyButton.Text = $"Buy for: {Environment.NewLine}{sellingItem.GoldValue.Value}";
            }
            
        }
Beispiel #2
0
 private void ToolTip1_Popup(object sender, PopupEventArgs e)
 {
     e.Cancel = true;
     StatusHelp(ToolTip1.GetToolTip(e.AssociatedControl));
 }