From b92be6dd495b3ed6c306991e22ebe452dbbbf245 Mon Sep 17 00:00:00 2001 From: cadon Date: Tue, 22 Mar 2016 00:08:42 +0100 Subject: [PATCH] shown-status are saved in library --- ARKBreedingStats/CreatureCollection.cs | 2 +- ARKBreedingStats/Form1.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ARKBreedingStats/CreatureCollection.cs b/ARKBreedingStats/CreatureCollection.cs index 15a65668..04dd8625 100644 --- a/ARKBreedingStats/CreatureCollection.cs +++ b/ARKBreedingStats/CreatureCollection.cs @@ -18,6 +18,6 @@ namespace ARKBreedingStats [XmlArray] public List hiddenOwners = new List(); // which owners are not selected to be shown [XmlArray] - public bool[] shownStatus; // which status are selected to be shown + public bool[] shownStatus = new bool[2]; // which status are selected to be shown. 0: dead, 1: unavailable } } diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 5b709de9..77cb4cfa 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -1225,6 +1225,10 @@ private void loadCollectionFile(String fileName, bool keepCurrentCreatures = fal currentFileName = fileName; creatureBoxListView.Clear(); } + filterListAllowed = false; + checkBoxShowDead.Checked = creatureCollection.shownStatus[0]; + checkBoxShowUnavailableCreatures.Checked = creatureCollection.shownStatus[1]; + filterListAllowed = true; setCollectionChanged(keepCurrentCreatures); // creatures loaded. @@ -1578,11 +1582,13 @@ private void listViewLibrary_SelectedIndexChanged(object sender, EventArgs e) private void checkBoxShowDead_CheckedChanged(object sender, EventArgs e) { + creatureCollection.shownStatus[0] = checkBoxShowDead.Checked; filterLib(); } private void checkBoxShowUnavailableCreatures_CheckedChanged(object sender, EventArgs e) { + creatureCollection.shownStatus[1] = checkBoxShowUnavailableCreatures.Checked; filterLib(); }