private void CharQuestListBox_SelectedIndexChanged(object sender, EventArgs e) { CharQuestItemsCheckListBox.Items.Clear(); if (CharQuestListBox.SelectedIndex == -1) { CharQuestItemsCheckListBox.Refresh(); return; } if ((CharQuestListBox.SelectedIndex == 0) && (CharQuestListBox.SelectedItem is string)) { CharQuestItemsCheckListBox.Refresh(); return; } CollQuest thisQuest = (CollQuest)CharQuestListBox.SelectedItem; Characters thisChar = (Characters)CharListBox.SelectedItem; int OldCount = 0; if (thisChar == null) { CharQuestListBox.Items.Clear(); _ = CharListBox.Focus(); return; } if (thisChar.CharCollection.ContainsKey(thisQuest.DaybreakID)) { OldCount = thisChar.CharCollection[thisQuest.DaybreakID].Count; } if (thisChar.CharCollection.ContainsKey(thisQuest.DaybreakID) && (OldCount != thisChar.CharCollection[thisQuest.DaybreakID].Count)) { dirties[0] = true; UpdateDirtiesStatus(); } foreach (long thisItemID in thisQuest.items) { QuestItem thisItem = Program.itemList[thisItemID]; if (thisItem == null) { try { thisItem = new QuestItem(thisItemID); } catch (Exception Err) { BadEnd(); throw Err; } Program.itemList[thisItem.DaybreakID] = thisItem; dirties[2] = true; StatusStripDirtyIndicator.Text = FloppyString; } if (thisChar.IsComplete(thisQuest.DaybreakID)) { _ = CharQuestItemsCheckListBox.Items.Add(thisItem, true); } else { _ = CharQuestItemsCheckListBox.Items.Add(thisItem, thisChar.CharCollection[thisQuest.DaybreakID].Contains(thisItemID)); } } CharQuestItemsCheckListBox.Refresh(); }
private void CharacterPage_Enter(object sender, EventArgs e) { CharacterPage_Resize(sender, e); CharListBox_DrawItem(sender, null); CharListBox.SelectedIndex = -1; CharIntroTxtBox.Text = string.Empty; CharQuestItemsCheckListBox.Items.Clear(); CharQuestListBox.Items.Clear(); _ = CharListBox.Focus(); }