public AbilityEditor(UserControl parent, Ability abilityToEdit) { m_loading = true; m_Parent = parent; InitializeComponent(); m_Ability = abilityToEdit; Init(); m_loading = false; }
public AbilityEditor(UserControl parent) : base() { m_loading = true; m_Parent = parent; InitializeComponent(); m_Ability = new Ability(); Init(); m_loading = false; }
public void LoadAbility(Ability abilityToLoad) { if (!m_loading) { m_Ability = abilityToLoad; } m_txtAbilityText.Text = abilityToLoad.Text; m_cbxTriggerType.Text = abilityToLoad.ActivationType.ToString(); m_loading = false; }
protected virtual void OnChanged(object sender, EventArgs e) { if (m_loading) { return; } if (m_cbxAbilityGroup.Text == "Keyword" && !(m_Parent is KeywordEditor)) { KeywordInstance ability = new KeywordInstance(); m_cbxKeywords.Visible = true; ability.Guid = m_cbxKeywords.SelectedValue.ToString(); //TODO: extract if (sender == m_cbxKeywords) { Keyword keywordToInstance = CalderaCore.DB.AbilityDB.GetLatestVersionofKeywordbyID(ability.Guid); ability.Text = keywordToInstance.Text; ability.ActivationType = keywordToInstance.ActivationType; ability.HasXValue = keywordToInstance.HasXValue; ability.ID = keywordToInstance.ID; ability.IsAttribute = keywordToInstance.IsAttribute; ability.Name = keywordToInstance.Name; ability.Version = keywordToInstance.Version; m_cbxTriggerType.Enabled = false; m_txtAbilityText.Enabled = false; m_Ability = ability; } } else if (m_cbxAbilityGroup.Text == "Ability") { m_Ability = new Ability(); m_Ability.Text = m_txtAbilityText.Text; m_Ability.ActivationType = (AbilityActivations)Enum.Parse(typeof(AbilityActivations), m_txtAbilityText.Text); } if (OnSomethingChanged != null) OnSomethingChanged(sender, e); }