Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New/Modified Features #33

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a1b122e
Added refresh button
jamckee May 5, 2019
b98ebc4
Working on extra stat display
jamckee May 5, 2019
c684af0
Working on extra stats
jamckee May 5, 2019
4aea1b7
Added default add to first list
jamckee May 5, 2019
e704359
Added wildcard search to add multiple dinos
jamckee May 5, 2019
0155935
Added close search window on no matched dinos
jamckee May 5, 2019
af4b14c
Add display for food and oxygen
jamckee May 5, 2019
ae7a831
Initital filter display for additional stats
jamckee May 5, 2019
054448e
Working stat hiders
jamckee May 5, 2019
81c21b5
Verified food and oxygen stats
jamckee May 6, 2019
8bd9e84
Store last selected search list and load list when add species dialog…
jamckee May 7, 2019
4578d4b
Aded option for hiding untameable WIP filter by option
jamckee May 7, 2019
d2090ff
Tameable filtering
jamckee May 7, 2019
7f5a3a6
New development branch
jamckee May 8, 2019
772e0d5
Added duplicate list checking/Fixed adding new list names
jamckee May 8, 2019
6d8f517
Merge pull request #1 from jamckee/devel
jamckee May 8, 2019
2f520dd
Made dino stat tooltip text dynamic, changed setting var names to mat…
jamckee May 10, 2019
8d19102
Fixed name of AdjustSearchColums to match project standards
jamckee May 10, 2019
2f3882a
Removed adjustcolumns function and switched to binding, corrected for…
jamckee May 10, 2019
600baa6
Hide refresh button until future features added to compliment it
jamckee May 10, 2019
7410d47
Fixed formatting on settings window with display dino stats
jamckee May 10, 2019
c2de843
Switched LastGroup to a String variable and fixed implementation with…
jamckee May 11, 2019
9d5d170
Added grouped search mode-When checked will save keyword to search so…
jamckee May 11, 2019
8efb4e0
Open dropdown box for Species on gaining focus
jamckee May 14, 2019
56d5a69
Add the Valguero map
Aug 3, 2019
f61e890
use invariant formatter for teleport coords
Dec 21, 2019
4cf2533
Merge pull request #2 from zericco/fix/invariant_teleport_coordinates
jamckee Dec 30, 2019
ee394e4
Merge pull request #3 from Rottenbeer/add_valguero
jamckee Dec 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Common/Dino.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class Dino : IEquatable<Dino>
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; }

Expand All @@ -26,6 +27,7 @@ public bool Equals(Dino other)
Name == other.Name &&
BaseLevel == other.BaseLevel &&
Female == other.Female &&
IsTameable == other.IsTameable &&
EqualityComparer<Position>.Default.Equals(Location, other.Location) &&
EqualityComparer<StatPoints>.Default.Equals(WildLevels, other.WildLevels);
}
Expand All @@ -38,6 +40,7 @@ public override int GetHashCode()
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Name);
hashCode = hashCode * -1521134295 + BaseLevel.GetHashCode();
hashCode = hashCode * -1521134295 + Female.GetHashCode();
hashCode = hashCode * -1521134295 + IsTameable.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer<Position>.Default.GetHashCode(Location);
hashCode = hashCode * -1521134295 + EqualityComparer<StatPoints>.Default.GetHashCode(WildLevels);
return hashCode;
Expand Down
2 changes: 2 additions & 0 deletions Common/SearchCriteria.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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; }

/// <summary>
/// Compares equality based only on an internal random ID assigned on creation.
Expand Down
12 changes: 9 additions & 3 deletions Common/StatPoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class StatPoints : IEquatable<StatPoints>
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)
{
Expand All @@ -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()
Expand All @@ -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();
}
Expand Down
5 changes: 4 additions & 1 deletion LarkatorGUI/ArkReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
57 changes: 56 additions & 1 deletion LarkatorGUI/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions LarkatorGUI/LarkatorGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
<Resource Include="imgs\map_ScorchedEarth.jpg" />
<Resource Include="imgs\map_TheCenter.jpg" />
<Resource Include="imgs\map_TheIsland.jpg" />
<Resource Include="imgs\map_Valguero_P.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="imgs\map_Extinction.jpg" />
Expand Down
30 changes: 20 additions & 10 deletions LarkatorGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -313,18 +314,24 @@
</StackPanel>
<Button Width="32" FontFamily="Arial Black" FontSize="28" FontWeight="Bold" Padding="-4" Margin="16" Content="+" Click="CreateSearch_Click"
Visibility="{Binding CreateSearchAvailable, Converter={StaticResource BoolToVisibilityConverter}}"/>
<Grid Margin="16,0,16,16" Visibility="{Binding NewSearchActive, Converter={StaticResource BoolToVisibilityConverter}}" Background="#44ffffff">
<Grid Margin="16,0,16,16" Visibility="{Binding NewSearchActive, Converter={StaticResource BoolToVisibilityConverter}}" Background="#44ffffff">
<StackPanel Margin="8" Orientation="Vertical" HorizontalAlignment="Stretch" DataContext="{Binding NewSearch}">
<ComboBox x:Name="groupsCombo" Text="{Binding Group}" IsEditable="True"/>
<ComboBox x:Name="speciesCombo" Text="{Binding Species}"/>
<ComboBox x:Name="groupsCombo" Text="{Binding Group}" IsEditable="True" />
<ComboBox x:Name="speciesCombo" Text="{Binding Species}" IsEditable="True" StaysOpenOnEdit="True" GotFocus="ComboOpen" AllowDrop="True"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="4">
<TextBlock Text="Min"/>
<TextBlock Text="Min "/>
<TextBlock Text="{Binding MinLevel, ConverterParameter=-, Converter={StaticResource OptionalIntConverter}}" MinWidth="64" MouseWheel="AdjustableInteger_MouseWheel"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="4">
<TextBlock Text="Max"/>
<TextBlock Text="Max "/>
<TextBlock Text="{Binding MinLevel, ConverterParameter=-, Converter={StaticResource OptionalIntConverter}}" MinWidth="64" MouseWheel="AdjustableInteger_MouseWheel"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="4">
<TextBlock Text="Grouped search "/>
<CheckBox x:Name="groupCheck" ToolTip="Keyword search for a group of dinosaurs"
IsChecked="{Binding Source={StaticResource Settings}, Path=Settings.GroupSearch, Mode=TwoWay}" HorizontalAlignment="Right"
Margin="7,4"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Width="32" FontFamily="Arial Black" FontSize="28" FontWeight="Bold" Padding="-4" Margin="4,0" Content="+" Click="SaveSearch_Click" />
<TextBlock VerticalAlignment="Center" MouseDown="CloseNewSearch_Click"><Underline><Run Text="X"/></Underline></TextBlock>
Expand Down Expand Up @@ -378,11 +385,13 @@
</DataGridTemplateColumn>
<DataGridTextColumn Header="Lvl" Width="1.2*" Binding="{Binding Dino.BaseLevel}"/>
<DataGridTextColumn Header="Pos" Width="2.2*" Binding="{Binding Path=Dino.Location, Converter={StaticResource PositionToStringConverter}}"/>
<DataGridTextColumn Header="Hp" Width="1*" Binding="{Binding Path=Dino.WildLevels.Health}"/>
<DataGridTextColumn Header="St" Width="1*" Binding="{Binding Path=Dino.WildLevels.Stamina}"/>
<DataGridTextColumn Header="We" Width="1*" Binding="{Binding Path=Dino.WildLevels.Weight}"/>
<DataGridTextColumn Header="Me" Width="1*" Binding="{Binding Path=Dino.WildLevels.Melee}"/>
<DataGridTextColumn Header="Sp" Width="1*" Binding="{Binding Path=Dino.WildLevels.Speed}"/>
<DataGridTextColumn x:Name="health" Header="Hp" Visibility="{Binding Source={StaticResource Settings}, Path=Default.ShowHealth, Converter={StaticResource BoolToVisibilityConverter}}" Width="1*" Binding="{Binding Path=Dino.WildLevels.Health}"/>
<DataGridTextColumn x:Name="stamina" Header="St" Visibility="{Binding Source={StaticResource Settings}, Path=Default.ShowStam, Converter={StaticResource BoolToVisibilityConverter}}" Width="1*" Binding="{Binding Path=Dino.WildLevels.Stamina}"/>
<DataGridTextColumn x:Name="oxygen" Header="Ox" Visibility="{Binding Source={StaticResource Settings}, Path=Default.ShowOxygen, Converter={StaticResource BoolToVisibilityConverter}}" Width="1*" Binding="{Binding Path=Dino.WildLevels.Weight}"/>
<DataGridTextColumn x:Name="food" Header="Fd" Visibility="{Binding Source={StaticResource Settings}, Path=Default.ShowFood, Converter={StaticResource BoolToVisibilityConverter}}" Width="1*" Binding="{Binding Path=Dino.WildLevels.Melee}"/>
<DataGridTextColumn x:Name="weight" Header="We" Visibility="{Binding Source={StaticResource Settings}, Path=Default.ShowWeight, Converter={StaticResource BoolToVisibilityConverter}}" Width="1*" Binding="{Binding Path=Dino.WildLevels.Speed}"/>
<DataGridTextColumn x:Name="melee" Header="Me" Visibility="{Binding Source={StaticResource Settings}, Path=Default.ShowMelee, Converter={StaticResource BoolToVisibilityConverter}}" Width="1*" Binding="{Binding Path=Dino.WildLevels.Food}"/>
<DataGridTextColumn x:Name="speed" Header="Sp" Visibility="{Binding Source={StaticResource Settings}, Path=Default.ShowSpeed, Converter={StaticResource BoolToVisibilityConverter}}" Width="1*" Binding="{Binding Path=Dino.WildLevels.Oxygen}"/>
</DataGrid.Columns>
</DataGrid>

Expand All @@ -398,6 +407,7 @@
<fa:ImageAwesome Icon="Remove" Height="30" Width="30" Margin="8" Foreground="#88FFFF00" ToolTip="Remove user settings &amp; exit" MouseDown="Dev_RemoveSettings_Click"/>
</StackPanel>
<fa:ImageAwesome Icon="cogs" Width="30" Height="30" Margin="8" Foreground="#44ffffff" ToolTip="Settings" MouseDown="Settings_Click"/>
<fa:ImageAwesome Icon="refresh" Width="30" Height="30" Margin="8" Foreground="#44ffffff" ToolTip="Refresh" Visibility="Hidden" MouseDown="Refresh_Click"/>
</StackPanel>
</Grid>
</Grid>
Expand Down
Loading