/// <summary> /// open the combat history /// </summary> /// <param name="who"></param> private void ShowDeathLog(WhoDied who) { Rectangle rect = new Rectangle(this.Location, this.Size); DeathLog deathLog = new DeathLog(who, encounterData, rect); deathLog.Show(); }
/// <summary> /// double click opens the cause of death window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e) { int index = listBox1.SelectedIndex; WhoDied whoDied = (WhoDied)listBox1.Items[index]; ShowDeathLog(whoDied); }
/// <summary> /// Form constructor /// </summary> /// <param name="who">Decriptive class for who died</param> /// <param name="encounterData">ACT encounter data that includes the death</param> /// <param name="rect">Rectangle of the parent form. This form will be placed to its right</param> public DeathLog(WhoDied who, EncounterData encounterData, Rectangle rect) { InitializeComponent(); whoDied = who; ed = encounterData; parentRect = rect; }
/// <summary> /// main form wants to add a death to the list /// </summary> /// <param name="dd"></param> public void AddDeath(WhoDied dd) { QueueArgs arg = new QueueArgs { type = OverlayCommand.DEATH, count = dd.deathCount, who = dd.who, index = dd.killedAtIndex }; encounterData = dd.ed; queueArgs.Enqueue(arg); dataSignal.Set(); }
/// <summary> /// activated from the Consumer() thread, runs on the UI thread /// </summary> /// <param name="o"></param> private void UpdateForm(object o) { QueueArgs w = o as QueueArgs; if (w != null) { textBoxDeaths.Text = w.count.ToString(); WhoDied whoDied = new WhoDied { who = w.who, killedAtIndex = w.index, deathCount = w.count, ed = encounterData }; listBox1.Items.Insert(0, whoDied); } }