public EventFlag(DbScriptControl control, Int64 flag_value, string[] items, int type/*0=event_flag, 1=spell_hit, 2=cast_flag */, int action) { InitializeComponent(); flagType = type; this.action = action; scriptParent = control; LoadFlags(items, flag_value); }
public EventFlag(DbScriptControl control, Int64 flag_value, string[] items, int type /*0=event_flag, 1=spell_hit, 2=cast_flag */, int action) { InitializeComponent(); flagType = type; this.action = action; scriptParent = control; LoadFlags(items, flag_value); }
private void AddNewEvent(object sender, EventArgs e) { if (bIsCreature) { creatures.GetCreature(this.id).AddEvent(); EventControl bla = new EventControl(creatures.GetCreature(this.id).line[creatures.GetCreature(this.id).line.Count - 1], (creatures.GetCreature(this.id).line.Count - 1), this.id); this.splitContainer1.Panel2.Controls.Add(bla); bla.Dock = DockStyle.Top; //(this.MdiParent as Hauptfenster).UpdateNPCListBox(); EventsList.Add((creatures.GetCreature(this.id).line.Count - 1).ToString()); } else { db_scripts.GetDbScript(this.id).AddScriptLine(); DbScriptControl bla = new DbScriptControl(db_scripts.GetDbScript(this.id).line[db_scripts.GetDbScript(this.id).line.Count - 1], (db_scripts.GetDbScript(this.id).line.Count - 1), this.id); this.splitContainer1.Panel2.Controls.Add(bla); bla.Dock = DockStyle.Top; //(this.MdiParent as Hauptfenster).UpdateNPCListBox(); EventsList.Add((db_scripts.GetDbScript(this.id).line.Count - 1).ToString()); } }
// Load DB scripts form public void LoadScript(uint uiId) { if (db_scripts.scriptList[this.id].line.Count != 0 || splitContainer1.Panel2.Controls.Count != 0) { uint index = 0; EventsList.Clear(); this.splitContainer1.Panel2.Controls.Clear(); foreach (Event_dataset_script item in db_scripts.scriptList[this.id].line) { EventsList.Add(index.ToString()); index++; } foreach (string item in EventsList) { DbScriptControl newControl = new DbScriptControl(db_scripts.scriptList[this.id].line[Convert.ToInt32(item)], Convert.ToInt32(item), this.id); this.splitContainer1.Panel2.Controls.Add(newControl); newControl.Dock = DockStyle.Top; newControl.Show(); } } }