Skip to content

Commit

Permalink
Working stat hiders
Browse files Browse the repository at this point in the history
  • Loading branch information
jamckee authored and Rottenbeer committed Aug 4, 2019
1 parent e33e2a1 commit 00266c4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 33 deletions.
1 change: 1 addition & 0 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
18 changes: 12 additions & 6 deletions LarkatorGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -758,12 +758,7 @@ private void UpdateSearchResults(IList<SearchCriteria> searches)
ResultTotalCount = ShowTames ? sourceDinos.Sum(species => species.Value.Count()) : total;
ResultMatchingCount = ListResults.Count;

this.resultsList.Columns["health"].Visibility="{ Binding Source = { StaticResource Model }, Path = Settings.showHealth, Mode = TwoWay}";
this.resultsList.Columns["health"].Visibility = "{ Binding Source = { StaticResource Model }, Path = Settings.showHealth, Mode = TwoWay}";
this.resultsList.Columns["health"].Visibility = "{ Binding Source = { StaticResource Model }, Path = Settings.showHealth, Mode = TwoWay}";
this.resultsList.Columns["health"].Visibility = "{ Binding Source = { StaticResource Model }, Path = Settings.showHealth, Mode = TwoWay}";
this.resultsList.Columns["health"].Visibility = "{ Binding Source = { StaticResource Model }, Path = Settings.showHealth, Mode = TwoWay}";
this.resultsList.Columns["health"].Visibility = "{ Binding Source = { StaticResource Model }, Path = Settings.showHealth, Mode = TwoWay}";
adjustSearchColumns();

}

Expand All @@ -772,6 +767,17 @@ private void UpdateSearchResults(IList<SearchCriteria> searches)
TriggerNameSearch(true);
}

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;
}

private async Task PerformConversion()
{
string arkDirName = Path.GetFileNameWithoutExtension(Properties.Settings.Default.SaveFile);
Expand Down
54 changes: 27 additions & 27 deletions LarkatorGUI/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
IsChecked="{Binding Source={StaticResource Model}, Path=Settings.TeleportFly, Mode=TwoWay}" HorizontalAlignment="Right"
Margin="7,4"/>
</Border>

<Border Grid.Row="8" Grid.Column="0">
<TextBlock VerticalAlignment="Center" Margin="0,0,4,0">Enable ghost after teleport</TextBlock>
</Border>
Expand All @@ -112,68 +112,68 @@
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="2.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.Column="1">
<Border Grid.Row="0" Grid.Column="2">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Hp</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="2">
<Border Grid.Row="0" Grid.Column="3">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">St</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="3">
<Border Grid.Row="0" Grid.Column="4">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">We</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="4">
<Border Grid.Row="0" Grid.Column="5">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Me</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="5">
<Border Grid.Row="0" Grid.Column="6">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Sp</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="6">
<Border Grid.Row="0" Grid.Column="7">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Fd</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="7">
<Border Grid.Row="0" Grid.Column="8">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Ox</TextBlock>
</Border>

<Border Grid.Row="1" Grid.Column="0">
<Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
<TextBlock VerticalAlignment="Center" Margin="0,0,4,0">Display Stats:</TextBlock>
</Border>
<Border Grid.Row="1" Grid.Column="1">
<Border Grid.Row="1" Grid.Column="2">
<CheckBox ToolTip="Display Health" IsChecked="{Binding Source={StaticResource Model}, Path=Settings.showHealth, Mode=TwoWay}" HorizontalAlignment="Right" Margin="7,4"/>
</Border>
<Border Grid.Row="1" Grid.Column="2">
<Border Grid.Row="1" Grid.Column="3">
<CheckBox ToolTip="Display Stamina" IsChecked="{Binding Source={StaticResource Model}, Path=Settings.showStam, Mode=TwoWay}" HorizontalAlignment="Right" Margin="7,4"/>
</Border>
<Border Grid.Row="1" Grid.Column="3">
<Border Grid.Row="1" Grid.Column="4">
<CheckBox ToolTip="Display Weight" IsChecked="{Binding Source={StaticResource Model}, Path=Settings.showWeight, Mode=TwoWay}" HorizontalAlignment="Right" Margin="7,4"/>
</Border>
<Border Grid.Row="1" Grid.Column="4">
<Border Grid.Row="1" Grid.Column="5">
<CheckBox ToolTip="Display Melee" IsChecked="{Binding Source={StaticResource Model}, Path=Settings.showMelee, Mode=TwoWay}" HorizontalAlignment="Right" Margin="7,4"/>
</Border>
<Border Grid.Row="1" Grid.Column="5">
<Border Grid.Row="1" Grid.Column="6">
<CheckBox ToolTip="Display Speed" IsChecked="{Binding Source={StaticResource Model}, Path=Settings.showSpeed, Mode=TwoWay}" HorizontalAlignment="Right" Margin="7,4"/>
</Border>
<Border Grid.Row="1" Grid.Column="6">
<Border Grid.Row="1" Grid.Column="7">
<CheckBox ToolTip="Display Food" IsChecked="{Binding Source={StaticResource Model}, Path=Settings.showFood, Mode=TwoWay}" HorizontalAlignment="Right" Margin="7,4"/>
</Border>
<Border Grid.Row="1" Grid.Column="7">
<CheckBox ToolTip="Display Oxygen"
IsChecked="{Binding Source={StaticResource Model}, Path=Settings.showOxygen, Mode=TwoWay}" HorizontalAlignment="Right"
Margin="7,4"/>
<Border Grid.Row="1" Grid.Column="8">
<CheckBox ToolTip="Display Oxygen" IsChecked="{Binding Source={StaticResource Model}, Path=Settings.showOxygen, Mode=TwoWay}" HorizontalAlignment="Right" Margin="7,4"/>
</Border>
</Grid>

<DockPanel Margin="4,6,6,4" LastChildFill="True">
<TextBlock Text="Restore all defaults" DockPanel.Dock="Left" VerticalAlignment="Bottom" TextDecorations="Underline" MouseDown="Restore_MouseDown" FontSize="10"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
Expand Down

0 comments on commit 00266c4

Please sign in to comment.