public ScoreStatForm(TreeNode Node)
{
InitializeComponent();
this.Node = Node;
this.Obj = (Condition)Node.Tag;
List <String> Params = Obj.GetParams();
if (Params[0] == "global_stat")
{
StatType.SelectedIndex = 0;
}
else
{
StatType.SelectedIndex = 1;
}
// Update fields
UpdateFields();
// Proccess 2nd param
int j = 0;
foreach (object A in StatName.Items)
{
KeyValuePair I = (KeyValuePair)A;
if (I.Key == Params[1])
{
StatName.SelectedIndex = j;
break;
}
j++;
}
// Check for 3rd param
if (Params.Count == 3)
{
ConditionSelect.SelectedIndex = 1;
ValueBox.Visible = true;
ValueBox.Value = Int32.Parse(Params[2]);
}
else
{
ConditionSelect.SelectedIndex = 0;
}
}