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/Common/SearchCriteria.cs b/Common/SearchCriteria.cs index d9292c3..a2ac992 100644 --- a/Common/SearchCriteria.cs +++ b/Common/SearchCriteria.cs @@ -26,6 +26,7 @@ public SearchCriteria(SearchCriteria copy) MinLevel = copy.MinLevel; MaxLevel = copy.MaxLevel; Female = copy.Female; + GroupSearch = copy.GroupSearch; } public string Group { get; set; } @@ -34,6 +35,7 @@ public SearchCriteria(SearchCriteria copy) public int? MinLevel { get; set; } public int? MaxLevel { get; set; } public bool? Female { get; set; } + public bool GroupSearch { get; set; } /// /// Compares equality based only on an internal random ID assigned on creation. diff --git a/Common/StatPoints.cs b/Common/StatPoints.cs index 30e3581..7f2c95d 100644 --- a/Common/StatPoints.cs +++ b/Common/StatPoints.cs @@ -9,6 +9,8 @@ public class StatPoints : IEquatable public int Weight { get; set; } public int Melee { get; set; } public int Speed { get; set; } + public int Food { get; set; } + public int Oxygen { get; set; } public override bool Equals(object obj) { @@ -22,7 +24,9 @@ public bool Equals(StatPoints other) Stamina == other.Stamina && Weight == other.Weight && Melee == other.Melee && - Speed == other.Speed; + Speed == other.Speed && + Food == other.Food && + Oxygen == other.Oxygen; } public override int GetHashCode() @@ -33,18 +37,20 @@ public override int GetHashCode() hashCode = hashCode * -1521134295 + Weight.GetHashCode(); hashCode = hashCode * -1521134295 + Melee.GetHashCode(); hashCode = hashCode * -1521134295 + Speed.GetHashCode(); + hashCode = hashCode * -1521134295 + Food.GetHashCode(); + hashCode = hashCode * -1521134295 + Oxygen.GetHashCode(); return hashCode; } public override string ToString() { - return $"{Health}/{Stamina}/{Weight}/{Melee}/{Speed}"; + 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}"; + return $"{Health,2}/{Stamina,2}/{Oxygen,2}/{Food,2}//{Weight,2}{Melee,2}/{Speed,2}"; else return ToString(); } diff --git a/LarkatorGUI/ArkReader.cs b/LarkatorGUI/ArkReader.cs index 4640904..7bbd59f 100644 --- a/LarkatorGUI/ArkReader.cs +++ b/LarkatorGUI/ArkReader.cs @@ -120,16 +120,19 @@ private Dino ConvertCreature(GameObject obj) Id = (ulong)obj.GetDinoId(), BaseLevel = obj.GetBaseLevel(), Name = obj.GetPropertyValue("TamedName", defaultValue: ""), + IsTameable = !obj.GetPropertyValue("bForceDisablingTaming", defaultValue: false), Location = ConvertCoordsToLatLong(obj.Location), WildLevels = new StatPoints(), }; - + var status = obj.CharacterStatusComponent(); if (status != null) { var defaultValue = new ArkByteValue(0); dino.WildLevels.Health = status.GetPropertyValue("NumberOfLevelUpPointsApplied", 0, defaultValue).ByteValue; dino.WildLevels.Stamina = status.GetPropertyValue("NumberOfLevelUpPointsApplied", 1, defaultValue).ByteValue; + dino.WildLevels.Oxygen = status.GetPropertyValue("NumberOfLevelUpPointsApplied", 3, defaultValue).ByteValue; + dino.WildLevels.Food = status.GetPropertyValue("NumberOfLevelUpPointsApplied", 4, defaultValue).ByteValue; dino.WildLevels.Weight = status.GetPropertyValue("NumberOfLevelUpPointsApplied", 7, defaultValue).ByteValue; dino.WildLevels.Melee = status.GetPropertyValue("NumberOfLevelUpPointsApplied", 8, defaultValue).ByteValue; dino.WildLevels.Speed = status.GetPropertyValue("NumberOfLevelUpPointsApplied", 9, defaultValue).ByteValue; diff --git a/LarkatorGUI/Converters.cs b/LarkatorGUI/Converters.cs index ce2745e..2d39f4d 100644 --- a/LarkatorGUI/Converters.cs +++ b/LarkatorGUI/Converters.cs @@ -132,7 +132,62 @@ public class DinoToTooltipConverter : IValueConverter public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var v = (Dino)value; - 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)})"; + 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/LarkatorGUI.csproj b/LarkatorGUI/LarkatorGUI.csproj index 8d06aa7..acb544a 100644 --- a/LarkatorGUI/LarkatorGUI.csproj +++ b/LarkatorGUI/LarkatorGUI.csproj @@ -240,6 +240,7 @@ + diff --git a/LarkatorGUI/MainWindow.xaml b/LarkatorGUI/MainWindow.xaml index 782bc5f..6a43982 100644 --- a/LarkatorGUI/MainWindow.xaml +++ b/LarkatorGUI/MainWindow.xaml @@ -4,6 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:LarkatorGUI" + xmlns:properties="clr-namespace:LarkatorGUI.Properties" xmlns:common="clr-namespace:Larkator.Common;assembly=Larkator.Common" xmlns:fa="http://schemas.fontawesome.io/icons/" xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop" @@ -313,18 +314,24 @@