Skip to content

Commit

Permalink
Aded option for hiding untameable WIP filter by option
Browse files Browse the repository at this point in the history
  • Loading branch information
jamckee authored and Rottenbeer committed Aug 4, 2019
1 parent 121d72d commit 4bafb5f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 1 deletion.
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
7 changes: 7 additions & 0 deletions LarkatorGUI/ArkReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion LarkatorGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ private void UpdateSearchResults(IList<SearchCriteria> 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;
Expand Down
12 changes: 12 additions & 0 deletions LarkatorGUI/Properties/Settings.Designer.cs

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

3 changes: 3 additions & 0 deletions LarkatorGUI/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,8 @@
<Setting Name="lastGroup" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="hideUntameable" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
9 changes: 9 additions & 0 deletions LarkatorGUI/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>

<Border Grid.Row="1" Grid.Column="0">
Expand Down Expand Up @@ -109,6 +110,14 @@
IsChecked="{Binding Source={StaticResource Model}, Path=Settings.TeleportGhost, Mode=TwoWay}" HorizontalAlignment="Right"
Margin="7,4"/>
</Border>
<Border Grid.Row="9" Grid.Column="0">
<TextBlock VerticalAlignment="Center" Margin="0,0,4,0">Hide untameable dinosaurs</TextBlock>
</Border>
<Border Grid.Row="9" Grid.Column="1">
<CheckBox ToolTip="Hide dinosaurs that cannot be tamed"
IsChecked="{Binding Source={StaticResource Model}, Path=Settings.hideUntameable, Mode=TwoWay}" HorizontalAlignment="Right"
Margin="7,4"/>
</Border>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
Expand Down
3 changes: 3 additions & 0 deletions LarkatorGUI/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
<setting name="lastGroup" serializeAs="String">
<value>0</value>
</setting>
<setting name="hideUntameable" serializeAs="String">
<value>False</value>
</setting>
</LarkatorGUI.Properties.Settings>
</userSettings>
</configuration>

0 comments on commit 4bafb5f

Please sign in to comment.