public void SetCondition(BasicCondition Condition) { this.ActiveCondition = Condition; if (this.ActiveCondition != null && this.ActiveCondition.Type != this.ConditionType) { this.ActiveCondition.Identifier = ":" + this.ConditionType.Identifier; this.ActiveCondition.Type = this.ConditionType; this.ActiveCondition.Parameters = this.ConditionType.CreateBlankParameters(); } else if (this.ActiveCondition == null) { RadioBox.SetChecked(false); } UIParser.Load(Condition); }
public ConditionHandlerWidget(ConditionType ConditionType, IContainer Parent) : base(Parent) { this.ConditionType = ConditionType; RadioBox = new RadioBox(this); RadioBox.SetText(ConditionType.Name); RadioBox.OnCheckChanged += delegate(BaseEventArgs e) { if (RadioBox.Checked) { BasicCondition condition = GetConditionsWindow().SelectedCondition; this.SetCondition(condition); GetConditionsWindow().SetActiveType(this); } }; UIParser = new ConditionUIParser(ConditionType.UI, this); UIParser.Load(null); }