public void Setup(Logic l) { _data = (MathLogic)l; if (_data.display != null && _data.display != this) { _data.display.Close(); } _data.display = this; comboBoxLeft.DataSource = EnchantmentUtilities.getCalculableTypes(); comboBoxRight.DataSource = EnchantmentUtilities.getCalculableTypes(); comboBoxMathTypes.SelectedIndexChanged -= comboBoxMathTypes_SelectedIndexChanged; comboBoxMathTypes.DataSource = Enum.GetValues(typeof(EnchantmentUtilities.MathTypes)); comboBoxMathTypes.SelectedIndexChanged += comboBoxMathTypes_SelectedIndexChanged; comboBoxMathTypes.SelectedItem = _data.operation; if (_data.left != null) { comboBoxLeft.SelectedItem = ((Logic)_data.left).LogicType; labelLeft.Text = ((Logic)_data.left).LogicType; } if (_data.right != null) { comboBoxRight.SelectedItem = ((Logic)_data.right).LogicType; labelRight.Text = ((Logic)_data.right).LogicType; } }
public void Setup(Logic l) { _data = (SetVariable)l; if (_data.display != null && _data.display != this) { _data.display.Close(); } _data.display = this; comboBoxCalculables.DataSource = EnchantmentUtilities.getCalculableTypes(); if (_data.setTo != null) { comboBoxCalculables.SelectedItem = ((Logic)_data.setTo).LogicType; label1.Text = ((Logic)_data.setTo).LogicType; } if (_data.parent != null) { comboBoxVariables.SelectedIndexChanged -= comboBoxVariables_SelectedIndexChanged; EnchantmentUtilities.FillComboboxWithVariableNames(comboBoxVariables, _data); comboBoxVariables.SelectedIndexChanged += comboBoxVariables_SelectedIndexChanged; if (_data.varName != null) { comboBoxVariables.SelectedItem = _data.varName; } } }
public void Setup(Logic l) { _data = (CreateEffect)l; if (_data.display != null && _data.display != this) { _data.display.Close(); } _data.display = this; comboBoxTarget.SelectedIndexChanged -= comboBoxTarget_SelectedIndexChanged; comboBoxTarget.DataSource = Enum.GetValues(typeof(EnchantmentUtilities.CharacterSelectionSubmenu)); comboBoxTarget.SelectedIndexChanged += comboBoxTarget_SelectedIndexChanged; comboBoxEffectType.SelectedIndexChanged -= comboBoxEffectType_SelectedIndexChanged; comboBoxEffectType.DataSource = Enum.GetValues(typeof(EffectHolder.EffectType)); comboBoxEffectType.SelectedIndexChanged += comboBoxEffectType_SelectedIndexChanged; comboBoxEffectTag.SelectedIndexChanged -= comboBoxEffectTag_SelectedIndexChanged; comboBoxEffectTag.DataSource = Enum.GetValues(typeof(EffectHolder.EffectTag)); comboBoxEffectTag.SelectedIndex = -1; comboBoxEffectTag.SelectedIndexChanged += comboBoxEffectTag_SelectedIndexChanged; comboBoxDamageType.SelectedIndexChanged -= comboBoxDamageType_SelectedIndexChanged; comboBoxDamageType.DataSource = Enum.GetValues(typeof(Utilities.DamageType)); comboBoxDamageType.SelectedIndex = -1; comboBoxDamageType.SelectedIndexChanged += comboBoxDamageType_SelectedIndexChanged; comboBoxLength.SelectedIndexChanged -= comboBoxLength_SelectedIndexChanged; comboBoxLength.DataSource = EnchantmentUtilities.getCalculableTypes(); if (_data.length != null) { comboBoxLength.SelectedItem = ((Logic)_data.length).LogicType; } comboBoxLength.SelectedIndexChanged += comboBoxLength_SelectedIndexChanged; comboBoxPotency.SelectedIndexChanged -= comboBoxPotency_SelectedIndexChanged; comboBoxPotency.DataSource = EnchantmentUtilities.getCalculableTypes(); if (_data.potency != null) { comboBoxPotency.SelectedItem = ((Logic)_data.potency).LogicType; } comboBoxPotency.SelectedIndexChanged += comboBoxPotency_SelectedIndexChanged; comboBoxDeterioration.SelectedIndexChanged -= comboBoxDeterioration_SelectedIndexChanged; comboBoxDeterioration.DataSource = EnchantmentUtilities.getCalculableTypes(); if (_data.deterioration != null) { comboBoxDeterioration.SelectedItem = ((Logic)_data.deterioration).LogicType; } comboBoxDeterioration.SelectedIndexChanged += comboBoxDeterioration_SelectedIndexChanged; comboBoxTarget.SelectedItem = _data.target; comboBoxEffectType.Text = _data.effectType; comboBoxEffectTag.Text = _data.effectTag; comboBoxDamageType.Text = _data.damageType; }
public void Setup(Logic l) { _data = (ReturnValue)l; if (_data.display != null && _data.display != this) { _data.display.Close(); } _data.display = this; comboBoxValue.DataSource = EnchantmentUtilities.getCalculableTypes(); if (_data.valueToReturn != null) { comboBoxValue.SelectedItem = ((Logic)_data.valueToReturn).LogicType; labelValue.Text = ((Logic)_data.valueToReturn).LogicType; } }
public void Setup(Logic l) { _data = (IfElseLogic)l; if (_data.display != null && _data.display != this) { _data.display.Close(); } _data.display = this; richTextBoxVariables.Text = "Variables:\n"; foreach (object[] oarr in _data.variables) { richTextBoxVariables.Text += oarr[0] + " " + oarr[1].ToString() + "\n"; } richTextBoxVariables.Text += "\nVariables From Parent:\n"; if (_data.parent != null) { Dictionary <String, Object[]> forDisplay = _data.parent.GetVariables(); foreach (String s in forDisplay.Keys) { richTextBoxVariables.Text += forDisplay[s][0] + "\t\t" + forDisplay[s][1].ToString() + "\n"; } } EnchantmentUtilities.FillComboboxWithVariableNames(comboBoxVariables, _data); comboBoxConditions.DataSource = EnchantmentUtilities.getCalculableTypes(); comboBoxResults.DataSource = EnchantmentUtilities.getTriggerableTypes(checkBoxPremades.Checked); EnchantmentUtilities.FillComboboxWithNames(comboBoxCurrentConditions, _data.conditions); EnchantmentUtilities.FillComboboxWithNames(comboBoxIfResults, _data.ifResults); EnchantmentUtilities.FillComboboxWithNames(comboBoxElseResults, _data.elseResults); comboBoxCurrentConditions.Text = ""; comboBoxElseResults.Text = ""; comboBoxIfResults.Text = ""; comboBoxCurrentConditions.SelectedIndex = comboBoxCurrentConditions.Items.Count - 1; comboBoxElseResults.SelectedIndex = comboBoxElseResults.Items.Count - 1; comboBoxIfResults.SelectedIndex = comboBoxIfResults.Items.Count - 1; textBoxLogicName.TextChanged -= textBoxLogicName_TextChanged; textBoxLogicName.Text = _data.name; textBoxLogicName.TextChanged += textBoxLogicName_TextChanged; }
public void Setup(Logic l) { _data = (MakeAttack)l; if (_data.display != null && _data.display != this) { _data.display.Close(); } _data.display = this; comboBoxAttackerCalc.DataSource = EnchantmentUtilities.getCalculableTypes(); comboBoxDefenderCalc.DataSource = EnchantmentUtilities.getCalculableTypes(); comboBoxAttacker.SelectedIndexChanged -= comboBoxAttacker_SelectedIndexChanged; comboBoxAttacker.DataSource = Enum.GetValues(typeof(EnchantmentUtilities.CharacterSelectionSubmenu)); comboBoxAttacker.SelectedIndexChanged += comboBoxAttacker_SelectedIndexChanged; comboBoxDefender.SelectedIndexChanged -= comboBoxDefender_SelectedIndexChanged; comboBoxDefender.DataSource = Enum.GetValues(typeof(EnchantmentUtilities.CharacterSelectionSubmenu)); comboBoxDefender.SelectedIndexChanged += comboBoxDefender_SelectedIndexChanged; comboBoxWeapon.SelectedIndexChanged -= comboBoxWeapon_SelectedIndexChanged; comboBoxWeapon.DataSource = Utilities.GetWeaponNames(); comboBoxWeapon.SelectedIndexChanged += comboBoxWeapon_SelectedIndexChanged; if (_data.attackValue != null) { comboBoxAttackerCalc.SelectedItem = ((Logic)_data.attackValue).LogicType; labelLeft.Text = ((Logic)_data.attackValue).LogicType; } if (_data.defenceValue != null) { comboBoxDefenderCalc.SelectedItem = ((Logic)_data.defenceValue).LogicType; labelRight.Text = ((Logic)_data.defenceValue).LogicType; } comboBoxAttacker.SelectedItem = _data.attacker; comboBoxDefender.SelectedItem = _data.defender; if (_data.selectedWeap != null) { comboBoxWeapon.Text = _data.selectedWeap; } }