Skip to content

Commit

Permalink
Made dino stat tooltip text dynamic, changed setting var names to mat…
Browse files Browse the repository at this point in the history
…ch project standards, arranged stat order to match in game order
  • Loading branch information
jamckee authored and Rottenbeer committed Aug 4, 2019
1 parent 07d812c commit ab41588
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 88 deletions.
4 changes: 2 additions & 2 deletions Common/StatPoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
58 changes: 56 additions & 2 deletions LarkatorGUI/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions LarkatorGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,11 @@
<DataGridTextColumn Header="Pos" Width="2.2*" Binding="{Binding Path=Dino.Location, Converter={StaticResource PositionToStringConverter}}"/>
<DataGridTextColumn x:Name="health" Header="Hp" Width="1*" Binding="{Binding Path=Dino.WildLevels.Health}"/>
<DataGridTextColumn x:Name="stamina" Header="St" Width="1*" Binding="{Binding Path=Dino.WildLevels.Stamina}"/>
<DataGridTextColumn x:Name="weight" Header="We" Width="1*" Binding="{Binding Path=Dino.WildLevels.Weight}"/>
<DataGridTextColumn x:Name="melee" Header="Me" Width="1*" Binding="{Binding Path=Dino.WildLevels.Melee}"/>
<DataGridTextColumn x:Name="speed" Header="Sp" Width="1*" Binding="{Binding Path=Dino.WildLevels.Speed}"/>
<DataGridTextColumn x:Name="food" Header="Fd" Width="1*" Binding="{Binding Path=Dino.WildLevels.Food}"/>
<DataGridTextColumn x:Name="oxygen" Header="Ox" Width="1*" Binding="{Binding Path=Dino.WildLevels.Oxygen}"/>
<DataGridTextColumn x:Name="weight" Header="Fd" Width="1*" Binding="{Binding Path=Dino.WildLevels.Weight}"/>
<DataGridTextColumn x:Name="melee" Header="Ox" Width="1*" Binding="{Binding Path=Dino.WildLevels.Melee}"/>
<DataGridTextColumn x:Name="speed" Header="We" Width="1*" Binding="{Binding Path=Dino.WildLevels.Speed}"/>
<DataGridTextColumn x:Name="food" Header="Me" Width="1*" Binding="{Binding Path=Dino.WildLevels.Food}"/>
<DataGridTextColumn x:Name="oxygen" Header="Sp" Width="1*" Binding="{Binding Path=Dino.WildLevels.Oxygen}"/>
</DataGrid.Columns>
</DataGrid>

Expand Down
22 changes: 12 additions & 10 deletions LarkatorGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();


Expand Down Expand Up @@ -768,7 +768,7 @@ private void UpdateSearchResults(IList<SearchCriteria> 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;
Expand All @@ -786,13 +786,15 @@ private void UpdateSearchResults(IList<SearchCriteria> 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()
Expand Down
62 changes: 31 additions & 31 deletions LarkatorGUI/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions LarkatorGUI/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,31 @@
<Setting Name="TeleportGhost" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="showHealth" Type="System.Boolean" Scope="User">
<Setting Name="ShowHealth" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="showStam" Type="System.Boolean" Scope="User">
<Setting Name="ShowStam" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="showWeight" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
<Setting Name="ShowOxygen" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="showMelee" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
<Setting Name="ShowFood" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="showSpeed" Type="System.Boolean" Scope="User">
<Setting Name="ShowWeight" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="showFood" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
<Setting Name="ShowMelee" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="showOxygen" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
<Setting Name="ShowSpeed" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="lastGroup" Type="System.Int32" Scope="User">
<Setting Name="LastGroup" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="hideUntameable" Type="System.Boolean" Scope="User">
<Setting Name="HideUntameable" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
Expand Down
Loading

0 comments on commit ab41588

Please sign in to comment.