Beispiel #1
0
        /// <summary>
        /// This method handles all button click events from the UI
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, EventArgs e)
        {
            Button button = (Button)sender;

            switch (button.Name)
            {
            case (LC.LoadButton):
            {
                LoadCharacter characterLoader = new LoadCharacter();
                if (characterLoader.Load())
                {
                    CreateMasterLibrary();
                    PopulateCharacterUI();
                    Character_Panel.Show();
                }
                break;
            }

            case (LC.button1):
            {
                if (Character_Panel.Visible)
                {
                    Character_Panel.Hide();
                }
                else
                {
                    Character_Panel.Show();
                }
                break;
            }

            default:
                break;
            }
        }
Beispiel #2
0
        /// <summary>
        /// This method handles all button click events from the UI
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, EventArgs e)
        {
            Button button = (Button)sender;

            switch (button.Name)
            {
            case (LC.Load_Button):
            {
                LoadCharacter characterLoader = new LoadCharacter();
                if (characterLoader.Load())
                {
                    CreateMasterLibrary();
                    PopulateCharacterUI();
                    Character_Panel.Show();
                }
                break;
            }

            case (LC.Save_Button):
            {
                if (LIB.m_CharacterLoaded)
                {
                    SaveCharacter saveCharacter = new SaveCharacter();
                    saveCharacter.Save();
                }
                else
                {
                    MessageBox.Show("No Character information loaded.");
                }
                break;
            }

            case (LC.button1):
            {
                if (Character_Panel.Visible)
                {
                    Character_Panel.Hide();
                }
                else
                {
                    Character_Panel.Show();
                }
                break;
            }

            case (LC.EquipBuy_Button):
            {
                BuySellGearForm form = new BuySellGearForm(true);
                form.ShowDialog();
                UpdateGrids();
                break;
            }

            case (LC.EquipSell_Button):
            {
                BuySellGearForm form = new BuySellGearForm(false);
                form.ShowDialog();
                UpdateGrids();
                break;
            }

            case (LC.ItemBuy_Button):
            {
                BuySellItemsForm form = new BuySellItemsForm(true);
                form.ShowDialog();
                UpdateGrids();
                break;
            }

            case (LC.ItemSell_Button):
            {
                BuySellItemsForm form = new BuySellItemsForm(false);
                form.ShowDialog();
                UpdateGrids();
                break;
            }

            case (LC.CurrencyExchange_Button):
            {
                MessageBox.Show("Will soon add a new form for the user to decide what they want to convert. " +
                                "For now all this does is convert gold to silver or silver to gold.", "Future Implimentation", MessageBoxButtons.OK);
                if (LIB.m_MainCharacterInfo.Money.Gold != 0)
                {
                    CLIB.Money.Convert(LC.Gold, LC.Silver, LIB.m_MainCharacterInfo.Money.Gold);
                }
                else if (LIB.m_MainCharacterInfo.Money.Silver != 0)
                {
                    CLIB.Money.Convert(LC.Silver, LC.Gold, LIB.m_MainCharacterInfo.Money.Silver);
                }
                UpdateMoney();
                break;
            }

            default:
                break;
            }
        }