Beispiel #1
0
        void SetControlsWithData(CombatDamageCalculatorInputData data)
        {
            dataUpdateSuspended = true;

            PickPanelData panelData = attackerPickPanel.Data;

            panelData.Unit         = data.Attacker;
            panelData.HeroStats    = data.AttackerHeroStats;
            panelData.Spells       = data.AttackerSpells;
            attackerPickPanel.Data = panelData;

            panelData              = defenderPickPanel.Data;
            panelData.Unit         = data.Defender;
            panelData.HeroStats    = data.DefenderHeroStats;
            panelData.Spells       = data.DefenderSpells;
            defenderPickPanel.Data = panelData;

            if (data.Terrain != null)
            {
                terrainComboBox.SelectedValue = data.Terrain;
            }
            else
            {
                terrainComboBox.SelectedIndex = 0;
            }

            attackerCountUpDn.Value = data.AttackerCount;
            defenderCountUpDn.Value = data.DefenderCount;

            dataUpdateSuspended = false;
        }
Beispiel #2
0
        private void swapBtn_Click(object sender, EventArgs e)
        {
            PickPanelData tempData = attackerPickPanel.Data;

            attackerPickPanel.Data = defenderPickPanel.Data;
            defenderPickPanel.Data = tempData;

            attackerPickPanel.OpponentHeroStats = defenderPickPanel.Data.HeroStats;
            defenderPickPanel.OpponentHeroStats = attackerPickPanel.Data.HeroStats;

            int tempCount = (int)attackerCountUpDn.Value;

            attackerCountUpDn.Value = defenderCountUpDn.Value;
            defenderCountUpDn.Value = tempCount;

            UpdateCalculatedDamage();
        }
Beispiel #3
0
        private void SetControlsWithData(PickPanelData data)
        {
            updatingControlsFromData = true;

            PickedUnit = data.Unit;

            if (Mode == ApplicationMode.Simple)
            {
                HasHeroChbx.Checked = (data.HeroStats != null);
            }
            else if (HeroComboBox.DataSource != null)
            {
                if (data.HeroStats != null && data.HeroStats.Hero != null)
                {
                    HeroComboBox.SelectedValue = data.HeroStats.Hero;
                }
                else
                {
                    HeroComboBox.SelectedIndex = 0;
                }
            }

            foreach (ComboBox comboBox in secondarySkillComboboxes)
            {
                comboBox.SelectedItem = SecondarySkillLevel.None;
            }

            foreach (CheckBox checkBox in spellCheckboxes)
            {
                checkBox.Checked = false;
            }

            if (data.HeroStats != null)
            {
                HeroAttackUpDn.Value  = data.HeroStats.Attack;
                HeroDefenseUpDn.Value = data.HeroStats.Defense;

                if (Mode != ApplicationMode.Simple)
                {
                    HeroLevelUpDn.Value = data.HeroStats.Level;

                    foreach (SecondarySkill skill in data.HeroStats.SecondarySkills)
                    {
                        ComboBox comboBox = ComboBoxForSecondarySkill(skill);
                        if (comboBox != null)
                        {
                            comboBox.SelectedItem = skill.SkillLevel;
                        }
                    }

                    foreach (ModifierSpell spell in data.Spells)
                    {
                        CheckBox chbx = CheckBoxForSpell(spell);
                        chbx.Checked = true;
                    }
                }
            }
            else
            {
                HeroAttackUpDn.Value  = 0;
                HeroDefenseUpDn.Value = 0;

                if (Mode != ApplicationMode.Simple)
                {
                    HeroLevelUpDn.Value = 1;
                }
            }

            updatingControlsFromData = false;
            UpdateData();
        }