From 4bafb5f82eafd5e32a333f1eb3755bd43f2a04b7 Mon Sep 17 00:00:00 2001 From: jamckee Date: Mon, 6 May 2019 22:58:32 -0600 Subject: [PATCH] Aded option for hiding untameable WIP filter by option --- Common/Dino.cs | 3 +++ LarkatorGUI/ArkReader.cs | 7 +++++++ LarkatorGUI/MainWindow.xaml.cs | 3 ++- LarkatorGUI/Properties/Settings.Designer.cs | 12 ++++++++++++ LarkatorGUI/Properties/Settings.settings | 3 +++ LarkatorGUI/SettingsWindow.xaml | 9 +++++++++ LarkatorGUI/app.config | 3 +++ 7 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Common/Dino.cs b/Common/Dino.cs index 7988d2a..b1fbbe4 100644 --- a/Common/Dino.cs +++ b/Common/Dino.cs @@ -10,6 +10,7 @@ public class Dino : IEquatable public string Name { get; set; } public int BaseLevel { get; set; } public bool Female { get; set; } + public bool IsTameable { get; set; } public Position Location { get; set; } public StatPoints WildLevels { get; set; } @@ -26,6 +27,7 @@ public bool Equals(Dino other) Name == other.Name && BaseLevel == other.BaseLevel && Female == other.Female && + IsTameable == other.IsTameable && EqualityComparer.Default.Equals(Location, other.Location) && EqualityComparer.Default.Equals(WildLevels, other.WildLevels); } @@ -38,6 +40,7 @@ public override int GetHashCode() hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + BaseLevel.GetHashCode(); hashCode = hashCode * -1521134295 + Female.GetHashCode(); + hashCode = hashCode * -1521134295 + IsTameable.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Location); hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(WildLevels); return hashCode; diff --git a/LarkatorGUI/ArkReader.cs b/LarkatorGUI/ArkReader.cs index e7d8a3d..f1486f2 100644 --- a/LarkatorGUI/ArkReader.cs +++ b/LarkatorGUI/ArkReader.cs @@ -120,10 +120,17 @@ private Dino ConvertCreature(GameObject obj) Id = (ulong)obj.GetDinoId(), BaseLevel = obj.GetBaseLevel(), Name = obj.GetPropertyValue("TamedName", defaultValue: ""), + IsTameable = obj.GetPropertyValue("bForceDisabledTaming",defaultValue: true), Location = ConvertCoordsToLatLong(obj.Location), WildLevels = new StatPoints(), }; + if (dino.Type.Contains("Polar")) + { + //stuff + int x = 1; + } + var status = obj.CharacterStatusComponent(); if (status != null) { diff --git a/LarkatorGUI/MainWindow.xaml.cs b/LarkatorGUI/MainWindow.xaml.cs index d975067..6f735ae 100644 --- a/LarkatorGUI/MainWindow.xaml.cs +++ b/LarkatorGUI/MainWindow.xaml.cs @@ -757,7 +757,8 @@ private void UpdateSearchResults(IList searches) ListResults.Clear(); foreach (var result in found) - ListResults.Add(result); + if (!Properties.Settings.Default.hideUntameable || (Properties.Settings.Default.hideUntameable && result.IsTameable == true)) + ListResults.Add(result); ShowCounts = true; ResultTotalCount = ShowTames ? sourceDinos.Sum(species => species.Value.Count()) : total; diff --git a/LarkatorGUI/Properties/Settings.Designer.cs b/LarkatorGUI/Properties/Settings.Designer.cs index 5d4c6b1..1803d35 100644 --- a/LarkatorGUI/Properties/Settings.Designer.cs +++ b/LarkatorGUI/Properties/Settings.Designer.cs @@ -332,5 +332,17 @@ public int lastGroup { this["lastGroup"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool hideUntameable { + get { + return ((bool)(this["hideUntameable"])); + } + set { + this["hideUntameable"] = value; + } + } } } diff --git a/LarkatorGUI/Properties/Settings.settings b/LarkatorGUI/Properties/Settings.settings index 48c94e1..c899f79 100644 --- a/LarkatorGUI/Properties/Settings.settings +++ b/LarkatorGUI/Properties/Settings.settings @@ -74,5 +74,8 @@ 0 + + False + \ No newline at end of file diff --git a/LarkatorGUI/SettingsWindow.xaml b/LarkatorGUI/SettingsWindow.xaml index fd16e6c..56581ac 100644 --- a/LarkatorGUI/SettingsWindow.xaml +++ b/LarkatorGUI/SettingsWindow.xaml @@ -37,6 +37,7 @@ + @@ -109,6 +110,14 @@ IsChecked="{Binding Source={StaticResource Model}, Path=Settings.TeleportGhost, Mode=TwoWay}" HorizontalAlignment="Right" Margin="7,4"/> + + Hide untameable dinosaurs + + + + diff --git a/LarkatorGUI/app.config b/LarkatorGUI/app.config index 068882a..c0d8feb 100644 --- a/LarkatorGUI/app.config +++ b/LarkatorGUI/app.config @@ -79,6 +79,9 @@ 0 + + False + \ No newline at end of file