Skip to content

Commit

Permalink
Added refresh button
Browse files Browse the repository at this point in the history
  • Loading branch information
jamckee authored and Rottenbeer committed Aug 4, 2019
1 parent c21f9d8 commit 502dc3e
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 5 deletions.
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}/{Weight}/{Melee}/{Speed}/{Food}/{Oxygen}";
}

public string ToString(bool fixedWidth = false)
{
if (fixedWidth)
return $"{Health,2}/{Stamina,2}/{Weight,2}/{Melee,2}/{Speed,2}";
return $"{Health,2}/{Stamina,2}/{Weight,2}/{Melee,2}/{Speed,2}/{Food,2}/{Oxygen,2}";
else
return ToString();
}
Expand Down
1 change: 1 addition & 0 deletions LarkatorGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,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" MouseDown="Refresh_Click"/>
</StackPanel>
</Grid>
</Grid>
Expand Down
7 changes: 6 additions & 1 deletion LarkatorGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public bool ShowCounts
private string lastArk;
private DebounceDispatcher refreshSearchesTimer = new DebounceDispatcher();
private DebounceDispatcher settingsSaveTimer = new DebounceDispatcher();

public MainWindow()
{
ValidateWindowPositionAndSize();
Expand Down Expand Up @@ -576,6 +576,11 @@ private void Settings_Click(object sender, MouseButtonEventArgs e)
OnSettingsChanged();
}

private async void Refresh_Click(object sender, MouseButtonEventArgs e)
{
await ReReadArk();
}

private void AdjustableInteger_MouseWheel(object sender, MouseWheelEventArgs e)
{
var tb = (TextBlock)sender;
Expand Down
86 changes: 85 additions & 1 deletion LarkatorGUI/Properties/Settings.Designer.cs

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

21 changes: 21 additions & 0 deletions LarkatorGUI/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,26 @@
<Setting Name="TeleportGhost" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="showHealth" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<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>
<Setting Name="showMelee" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="showSpeed" 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>
<Setting Name="showOxygen" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
64 changes: 64 additions & 0 deletions LarkatorGUI/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,70 @@
Margin="7,4"/>
</Border>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.Column="1">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Hp</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="2">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">St</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="3">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">We</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="4">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Me</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="5">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Sp</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="6">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Fd</TextBlock>
</Border>
<Border Grid.Row="0" Grid.Column="7">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Margin="7,4">Ox</TextBlock>
</Border>

<Border Grid.Row="1" Grid.Column="0">
<TextBlock VerticalAlignment="Center" Margin="0,0,4,0">Display Stats:</TextBlock>
</Border>
<Border Grid.Row="1" Grid.Column="1">
<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">
<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">
<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">
<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">
<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">
<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>
<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
21 changes: 21 additions & 0 deletions LarkatorGUI/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@
<setting name="TeleportGhost" serializeAs="String">
<value>False</value>
</setting>
<setting name="showHealth" serializeAs="String">
<value>True</value>
</setting>
<setting name="showStam" serializeAs="String">
<value>True</value>
</setting>
<setting name="showWeight" serializeAs="String">
<value>True</value>
</setting>
<setting name="showMelee" serializeAs="String">
<value>True</value>
</setting>
<setting name="showSpeed" serializeAs="String">
<value>True</value>
</setting>
<setting name="showFood" serializeAs="String">
<value>False</value>
</setting>
<setting name="showOxygen" serializeAs="String">
<value>False</value>
</setting>
</LarkatorGUI.Properties.Settings>
</userSettings>
</configuration>

0 comments on commit 502dc3e

Please sign in to comment.