From ab41588eeb462f381e7a8c257dbaa09cdc3023f4 Mon Sep 17 00:00:00 2001 From: jamckee Date: Fri, 10 May 2019 16:04:59 -0600 Subject: [PATCH] Made dino stat tooltip text dynamic, changed setting var names to match project standards, arranged stat order to match in game order --- Common/StatPoints.cs | 4 +- LarkatorGUI/Converters.cs | 58 ++++++++++++++++++- LarkatorGUI/MainWindow.xaml | 10 ++-- LarkatorGUI/MainWindow.xaml.cs | 22 ++++---- LarkatorGUI/Properties/Settings.Designer.cs | 62 ++++++++++----------- LarkatorGUI/Properties/Settings.settings | 26 ++++----- LarkatorGUI/SettingsWindow.xaml | 24 ++++---- LarkatorGUI/app.config | 26 ++++----- 8 files changed, 144 insertions(+), 88 deletions(-) diff --git a/Common/StatPoints.cs b/Common/StatPoints.cs index 61971d5..7f2c95d 100644 --- a/Common/StatPoints.cs +++ b/Common/StatPoints.cs @@ -44,13 +44,13 @@ public override int GetHashCode() public override string ToString() { - return $"{Health}/{Stamina}/{Weight}/{Melee}/{Speed}/{Food}/{Oxygen}"; + return $"{Health}/{Stamina}/{Oxygen}/{Food}/{Weight}/{Melee}/{Speed}"; } public string ToString(bool fixedWidth = false) { if (fixedWidth) - return $"{Health,2}/{Stamina,2}/{Weight,2}/{Melee,2}/{Speed,2}/{Food,2}/{Oxygen,2}"; + return $"{Health,2}/{Stamina,2}/{Oxygen,2}/{Food,2}//{Weight,2}{Melee,2}/{Speed,2}"; else return ToString(); } diff --git a/LarkatorGUI/Converters.cs b/LarkatorGUI/Converters.cs index cbf1d4c..2d39f4d 100644 --- a/LarkatorGUI/Converters.cs +++ b/LarkatorGUI/Converters.cs @@ -132,8 +132,62 @@ public class DinoToTooltipConverter : IValueConverter public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var v = (Dino)value; - StatPoints temp = v.WildLevels; - return $"{(String.IsNullOrWhiteSpace(v.Name) ? "" : "\"" + v.Name + "\" ")}{v.Type} {(v.Female ? 'F' : 'M')}{v.BaseLevel} @ {v.Location.ToString(PositionFormat.LatLong)} ({v.Location.ToString(PositionFormat.XYZ)}) ({temp})"; + String displayStats = ""; + //Build the string to display only shown stats + //Health, Stamina, Oxygen, Food, Weight, Melee, Speed + if (Properties.Settings.Default.ShowHealth) + { + displayStats += v.WildLevels.Health; + } + if (Properties.Settings.Default.ShowStam) + { + if (!displayStats.Equals("")) + { + displayStats += "/"; + } + displayStats += v.WildLevels.Stamina; + } + if (Properties.Settings.Default.ShowOxygen) + { + if (!displayStats.Equals("")) + { + displayStats += "/"; + } + displayStats += v.WildLevels.Oxygen; + } + if (Properties.Settings.Default.ShowFood) + { + if (!displayStats.Equals("")) + { + displayStats += "/"; + } + displayStats += v.WildLevels.Food; + } + if (Properties.Settings.Default.ShowWeight) + { + if (!displayStats.Equals("")) + { + displayStats += "/"; + } + displayStats += v.WildLevels.Weight; + } + if (Properties.Settings.Default.ShowMelee) + { + if (!displayStats.Equals("")) + { + displayStats += "/"; + } + displayStats += v.WildLevels.Melee; + } + if (Properties.Settings.Default.ShowSpeed) + { + if (!displayStats.Equals("")) + { + displayStats += "/"; + } + displayStats += v.WildLevels.Speed; + } + return $"{(String.IsNullOrWhiteSpace(v.Name) ? "" : "\"" + v.Name + "\" ")}{v.Type} {(v.Female ? 'F' : 'M')}{v.BaseLevel} @ {v.Location.ToString(PositionFormat.LatLong)} ({v.Location.ToString(PositionFormat.XYZ)}) ({displayStats})"; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/LarkatorGUI/MainWindow.xaml b/LarkatorGUI/MainWindow.xaml index 5a412c3..ab97d7b 100644 --- a/LarkatorGUI/MainWindow.xaml +++ b/LarkatorGUI/MainWindow.xaml @@ -381,11 +381,11 @@ - - - - - + + + + + diff --git a/LarkatorGUI/MainWindow.xaml.cs b/LarkatorGUI/MainWindow.xaml.cs index d0a87a8..5c9b853 100644 --- a/LarkatorGUI/MainWindow.xaml.cs +++ b/LarkatorGUI/MainWindow.xaml.cs @@ -477,7 +477,7 @@ private void CreateSearch_Click(object sender, RoutedEventArgs e) speciesCombo.ItemsSource = arkReader.AllSpecies; groupsCombo.ItemsSource = ListSearches.Select(sc => sc.Group).Distinct().OrderBy(g => g).ToArray(); - groupsCombo.SelectedIndex = Properties.Settings.Default.lastGroup; + groupsCombo.SelectedIndex = Properties.Settings.Default.LastGroup; } private void Dev_Calibration_Click(object sender, MouseButtonEventArgs e) @@ -533,7 +533,7 @@ private void SaveSearch_Click(object sender, RoutedEventArgs e) SearchCriteria tempSearch; int order = 100; - Properties.Settings.Default.lastGroup = groupsCombo.SelectedIndex; + Properties.Settings.Default.LastGroup = groupsCombo.SelectedIndex; Properties.Settings.Default.Save(); @@ -768,7 +768,7 @@ private void UpdateSearchResults(IList searches) ListResults.Clear(); foreach (var result in found) - if (!Properties.Settings.Default.hideUntameable || (result.IsTameable)) + if (!Properties.Settings.Default.HideUntameable || (result.IsTameable)) ListResults.Add(result); ShowCounts = true; @@ -786,13 +786,15 @@ private void UpdateSearchResults(IList searches) private void adjustSearchColumns() { - resultsList.Columns[3].Visibility = Properties.Settings.Default.showHealth ? Visibility.Visible : Visibility.Collapsed; - resultsList.Columns[4].Visibility = Properties.Settings.Default.showStam ? Visibility.Visible : Visibility.Collapsed; - resultsList.Columns[5].Visibility = Properties.Settings.Default.showWeight ? Visibility.Visible : Visibility.Collapsed; - resultsList.Columns[6].Visibility = Properties.Settings.Default.showMelee ? Visibility.Visible : Visibility.Collapsed; - resultsList.Columns[7].Visibility = Properties.Settings.Default.showSpeed ? Visibility.Visible : Visibility.Collapsed; - resultsList.Columns[8].Visibility = Properties.Settings.Default.showFood ? Visibility.Visible : Visibility.Collapsed; - resultsList.Columns[9].Visibility = Properties.Settings.Default.showOxygen ? Visibility.Visible : Visibility.Collapsed; + resultsList.Columns[3].Visibility = Properties.Settings.Default.ShowHealth ? Visibility.Visible : Visibility.Collapsed; + resultsList.Columns[4].Visibility = Properties.Settings.Default.ShowStam ? Visibility.Visible : Visibility.Collapsed; + resultsList.Columns[5].Visibility = Properties.Settings.Default.ShowOxygen ? Visibility.Visible : Visibility.Collapsed; + resultsList.Columns[6].Visibility = Properties.Settings.Default.ShowFood ? Visibility.Visible : Visibility.Collapsed; + resultsList.Columns[7].Visibility = Properties.Settings.Default.ShowWeight ? Visibility.Visible : Visibility.Collapsed; + resultsList.Columns[8].Visibility = Properties.Settings.Default.ShowMelee ? Visibility.Visible : Visibility.Collapsed; + resultsList.Columns[9].Visibility = Properties.Settings.Default.ShowSpeed ? Visibility.Visible : Visibility.Collapsed; + + } private async Task PerformConversion() diff --git a/LarkatorGUI/Properties/Settings.Designer.cs b/LarkatorGUI/Properties/Settings.Designer.cs index 1803d35..c2075d0 100644 --- a/LarkatorGUI/Properties/Settings.Designer.cs +++ b/LarkatorGUI/Properties/Settings.Designer.cs @@ -240,108 +240,108 @@ public bool TeleportGhost { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool showHealth { + public bool ShowHealth { get { - return ((bool)(this["showHealth"])); + return ((bool)(this["ShowHealth"])); } set { - this["showHealth"] = value; + this["ShowHealth"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool showStam { + public bool ShowStam { get { - return ((bool)(this["showStam"])); + return ((bool)(this["ShowStam"])); } set { - this["showStam"] = value; + this["ShowStam"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool showWeight { + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool ShowOxygen { get { - return ((bool)(this["showWeight"])); + return ((bool)(this["ShowOxygen"])); } set { - this["showWeight"] = value; + this["ShowOxygen"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool showMelee { + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool ShowFood { get { - return ((bool)(this["showMelee"])); + return ((bool)(this["ShowFood"])); } set { - this["showMelee"] = value; + this["ShowFood"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool showSpeed { + public bool ShowWeight { get { - return ((bool)(this["showSpeed"])); + return ((bool)(this["ShowWeight"])); } set { - this["showSpeed"] = value; + this["ShowWeight"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool showFood { + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool ShowMelee { get { - return ((bool)(this["showFood"])); + return ((bool)(this["ShowMelee"])); } set { - this["showFood"] = value; + this["ShowMelee"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool showOxygen { + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool ShowSpeed { get { - return ((bool)(this["showOxygen"])); + return ((bool)(this["ShowSpeed"])); } set { - this["showOxygen"] = value; + this["ShowSpeed"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int lastGroup { + public int LastGroup { get { - return ((int)(this["lastGroup"])); + return ((int)(this["LastGroup"])); } set { - this["lastGroup"] = value; + this["LastGroup"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool hideUntameable { + public bool HideUntameable { get { - return ((bool)(this["hideUntameable"])); + return ((bool)(this["HideUntameable"])); } set { - this["hideUntameable"] = value; + this["HideUntameable"] = value; } } } diff --git a/LarkatorGUI/Properties/Settings.settings b/LarkatorGUI/Properties/Settings.settings index c899f79..d919ca7 100644 --- a/LarkatorGUI/Properties/Settings.settings +++ b/LarkatorGUI/Properties/Settings.settings @@ -50,31 +50,31 @@ False - + True - + True - - True + + False - - True + + False - + True - - False + + True - - False + + True - + 0 - + False diff --git a/LarkatorGUI/SettingsWindow.xaml b/LarkatorGUI/SettingsWindow.xaml index 56581ac..29a37d5 100644 --- a/LarkatorGUI/SettingsWindow.xaml +++ b/LarkatorGUI/SettingsWindow.xaml @@ -142,44 +142,44 @@ St - We + Ox - Me + Fd - Sp + We - Fd + Me - Ox + Sp Display Stats: - + - + - + - + - + - + - + diff --git a/LarkatorGUI/app.config b/LarkatorGUI/app.config index c0d8feb..c3890f1 100644 --- a/LarkatorGUI/app.config +++ b/LarkatorGUI/app.config @@ -55,31 +55,31 @@ False - + True - + True - + + False + + + False + + True - + True - + True - - False - - - False - - + 0 - + False