Esempio n. 1
0
        private void EffectAddOverlay_Click(object sender, EventArgs e)
        {
            CustomToken overlay = new CustomToken();

            overlay.Name = "New Overlay";
            overlay.Type = CustomTokenType.Overlay;

            CustomOverlayForm dlg = new CustomOverlayForm(overlay);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                fHero.Tokens.Add(dlg.Token);
                update_effects();
            }
        }
Esempio n. 2
0
        private void EffectEditBtn_Click(object sender, EventArgs e)
        {
            if (SelectedEffect != null)
            {
                int index = fHero.Effects.IndexOf(SelectedEffect);

                EffectForm dlg = new EffectForm(SelectedEffect, fHero);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    fHero.Effects[index] = dlg.Effect;
                    update_effects();
                }
            }

            if (SelectedToken != null)
            {
                int index = fHero.Tokens.IndexOf(SelectedToken);

                switch (SelectedToken.Type)
                {
                case CustomTokenType.Token:
                {
                    CustomTokenForm dlg = new CustomTokenForm(SelectedToken);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fHero.Tokens[index] = dlg.Token;
                        update_effects();
                    }
                }
                break;

                case CustomTokenType.Overlay:
                {
                    CustomOverlayForm dlg = new CustomOverlayForm(SelectedToken);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fHero.Tokens[index] = dlg.Token;
                        update_effects();
                    }
                }
                break;
                }
            }
        }