示例#1
0
        public PowerActionForm(PowerAction action)
        {
            this.InitializeComponent();
            Application.Idle += new EventHandler(this.Application_Idle);
            this.RechargeBox.Items.Add("Recharges on 2-6");
            this.RechargeBox.Items.Add("Recharges on 3-6");
            this.RechargeBox.Items.Add("Recharges on 4-6");
            this.RechargeBox.Items.Add("Recharges on 5-6");
            this.RechargeBox.Items.Add("Recharges on 6");
            foreach (ActionType value in Enum.GetValues(typeof(ActionType)))
            {
                this.ActionBox.Items.Add(value);
                this.SustainBox.Items.Add(value);
            }
            if (action != null)
            {
                this.fAction = action.Copy();
            }
            if (this.fAction == null)
            {
                this.TraitBox.Checked        = true;
                this.AtWillBtn.Checked       = true;
                this.BasicAttackBtn.Checked  = false;
                this.ActionBox.SelectedItem  = ActionType.Standard;
                this.SustainBox.SelectedItem = ActionType.None;
                return;
            }
            this.fAction          = action.Copy();
            this.TraitBox.Checked = false;
            switch (this.fAction.Use)
            {
            case PowerUseType.Encounter:
            {
                this.EncounterBtn.Checked = true;
                this.RechargeBox.Text     = this.fAction.Recharge;
                break;
            }

            case PowerUseType.AtWill:
            {
                this.AtWillBtn.Checked      = true;
                this.BasicAttackBtn.Checked = false;
                break;
            }

            case PowerUseType.Basic:
            {
                this.AtWillBtn.Checked      = true;
                this.BasicAttackBtn.Checked = true;
                break;
            }

            case PowerUseType.Daily:
            {
                this.DailyBtn.Checked = true;
                break;
            }
            }
            this.ActionBox.SelectedItem  = this.fAction.Action;
            this.TriggerBox.Text         = this.fAction.Trigger;
            this.SustainBox.SelectedItem = this.fAction.SustainAction;
        }
示例#2
0
        public PowerActionForm(PowerAction action)
        {
            InitializeComponent();

            Application.Idle += new EventHandler(Application_Idle);

            RechargeBox.Items.Add(PowerAction.RECHARGE_2);
            RechargeBox.Items.Add(PowerAction.RECHARGE_3);
            RechargeBox.Items.Add(PowerAction.RECHARGE_4);
            RechargeBox.Items.Add(PowerAction.RECHARGE_5);
            RechargeBox.Items.Add(PowerAction.RECHARGE_6);

            Array actions = Enum.GetValues(typeof(ActionType));

            foreach (ActionType a in actions)
            {
                ActionBox.Items.Add(a);
                SustainBox.Items.Add(a);
            }

            if (action != null)
            {
                fAction = action.Copy();
            }

            if (fAction != null)
            {
                fAction = action.Copy();

                TraitBox.Checked = false;

                switch (fAction.Use)
                {
                case PowerUseType.AtWill:
                    AtWillBtn.Checked      = true;
                    BasicAttackBtn.Checked = false;
                    break;

                case PowerUseType.Basic:
                    AtWillBtn.Checked      = true;
                    BasicAttackBtn.Checked = true;
                    break;

                case PowerUseType.Encounter:
                    EncounterBtn.Checked = true;
                    RechargeBox.Text     = fAction.Recharge;
                    break;

                case PowerUseType.Daily:
                    DailyBtn.Checked = true;
                    break;
                }

                ActionBox.SelectedItem  = fAction.Action;
                TriggerBox.Text         = fAction.Trigger;
                SustainBox.SelectedItem = fAction.SustainAction;
            }
            else
            {
                TraitBox.Checked = true;

                AtWillBtn.Checked       = true;
                BasicAttackBtn.Checked  = false;
                ActionBox.SelectedItem  = ActionType.Standard;
                SustainBox.SelectedItem = ActionType.None;
            }
        }