public GlobalStatMultTimesForm(TreeNode Node) { InitializeComponent(); // Set our node and object this.Node = Node; this.Obj = (GlobalStatMultTimes)Node.Tag; List <String> Params = Obj.GetParams(); int j = 0; // Add each global item to the list foreach (KeyValuePair <string, string> I in StatsConstants.PythonGlobalVars) { StatName.Items.Add(new KeyValuePair(I.Key, I.Value)); if (I.Key == Params[1]) { StatName.SelectedIndex = j; } j++; } // set condition value ValueBox.Value = Int32.Parse(Params[2]); AwardId = Params[3]; }
private void FinishBtn_Click(object sender, EventArgs e) { // Tell the base condition form that we modifed the condition base.Canceled = false; // First param is always the python method name List <string> Params = new List <string>(); // Always add the python function name first Params.Add("global_stat_mult_times"); // 1st param KeyValuePair I = (KeyValuePair)StatName.SelectedItem; Params.Add(I.Key); //2nd Param Params.Add(((int)ValueBox.Value).ToString()); // 3rd Param Params.Add(AwardId); // Create the new Stat Object? if (Obj == null) { Obj = new GlobalStatMultTimes(Params); } else { Obj.SetParams(Params); } // Close the form this.Node.Tag = Obj; MedalDataEditor.ChangesMade = true; this.DialogResult = DialogResult.OK; }
public GlobalStatMultTimesForm(TreeNode Node) { InitializeComponent(); // Set our node and object this.Node = Node; this.Obj = (GlobalStatMultTimes)Node.Tag; List<String> Params = Obj.GetParams(); int j = 0; // Add each global item to the list foreach (KeyValuePair<string, string> I in StatsConstants.PythonGlobalVars) { StatName.Items.Add(new KeyValuePair(I.Key, I.Value)); if (I.Key == Params[1]) StatName.SelectedIndex = j; j++; } // set condition value ValueBox.Value = Int32.Parse(Params[2]); AwardId = Params[3]; }
private void FinishBtn_Click(object sender, EventArgs e) { // Tell the base condition form that we modifed the condition base.Canceled = false; // First param is always the python method name List<string> Params = new List<string>(); // Always add the python function name first Params.Add("global_stat_mult_times"); // 1st param KeyValuePair I = (KeyValuePair)StatName.SelectedItem; Params.Add(I.Key); //2nd Param Params.Add(((int)ValueBox.Value).ToString()); // 3rd Param Params.Add(AwardId); // Create the new Stat Object? if (Obj == null) Obj = new GlobalStatMultTimes(Params); else Obj.SetParams(Params); // Close the form this.Node.Tag = Obj; MedalDataEditor.ChangesMade = true; this.DialogResult = DialogResult.OK; }