Пример #1
0
        private void actTokEditBtn_Click(object sender, EventArgs e)
        {
            foreach (TokenListItemControl ctrl in activeTokenFlowPanel.Controls)
            {
                if (ctrl.Selected)
                {
                    MapToken  mapToken  = ctrl.MapToken;
                    TokenData tokenData = mapToken.GetTokenData();

                    EditTokenForm charForm = new EditTokenForm(gameState);
                    charForm.SetTokenData(ref tokenData);
                    DialogResult result = charForm.ShowDialog(this);

                    if (result == DialogResult.OK)
                    {
                        tokenData = charForm.GetTokenData();
                        mapToken.SetTokenData(ref tokenData);
                    }

                    return;
                }
            }

            MessageBox.Show("No token selected.", "Error.", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private void TokenImageBox_DoubleClick(object sender, EventArgs e)
        {
            TokenData tokenData = token.GetTokenData();

            EditTokenForm charForm = new EditTokenForm(token.GameState);

            charForm.SetTokenData(ref tokenData);
            DialogResult result = charForm.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                tokenData = charForm.GetTokenData();
                token.SetTokenData(ref tokenData);
            }
        }