Skip to content

Commit

Permalink
Added a link to the "Statistics" page (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed May 8, 2021
1 parent 9965f1c commit ebda0ac
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Gavilya/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ protected override void OnStartup(StartupEventArgs e)
Definitions.GamesListPage.LoadGames(); // Load the games

ProfileManager.LoadProfiles(); // Load profiles
new GameSaver().Load(); // Load the .gav file in the Definitions class
Definitions.Statistics = new(); // New page

if (Definitions.Settings.IsFirstRun) // If it is the app first run
{
Expand Down
7 changes: 6 additions & 1 deletion Gavilya/Classes/Definitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static string BetaVersion
/// <summary>
/// Define if the current build is a preversion of Gavilya, not made for production nor Pre-Release.
/// </summary>
public static bool IsBeta => false;
public static bool IsBeta => true;


/// <summary>
Expand Down Expand Up @@ -122,6 +122,11 @@ public static string BetaVersion
/// </summary>
public static RecentGamesPage RecentGamesPage { get; set; }

/// <summary>
/// The <see cref="Pages.Statistics"/> page.
/// </summary>
public static Statistics Statistics { get; set; }

/// <summary>
/// The state of the checkboxes of all the <see cref="UserControls.GameCard"/>.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion Gavilya/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public MainWindow()
Definitions.MainWindow = this; // Define the Main Window

LoadPage(); // Load the button on the button corresponding to the active page
new GameSaver().Load(); // Load the .gav file in the Definitions class
Global.SortGames();

LoadGames();
Expand Down
7 changes: 6 additions & 1 deletion Gavilya/Windows/ProfilesPopupMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@

<StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Center">
<Button x:Name="StatsBtn" Click="StatsBtn_Click" Padding="5" Margin="0,0,0,0" Content="&#xE9C4;" Style="{StaticResource RegularButton}" Foreground="#FFF" Background="{x:Null}" FontFamily="..\Fonts\#FluentlyIcons" VerticalAlignment="Center" HorizontalAlignment="Right">
<Button.ToolTip>
<ToolTip Content="{x:Static lang:Resources.Statistics}" Background="#000014" Foreground="White"/>
</Button.ToolTip>
</Button>
<Rectangle RadiusX="25" RadiusY="25" Width="50" Height="50" HorizontalAlignment="Center" Margin="10">
<Rectangle.Fill>
<ImageBrush x:Name="ProfilePicture" ImageSource="../Assets/DefaultPP.png"/>
Expand All @@ -44,7 +49,7 @@
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock d:Text="ProfileName" x:Name="ProfileNameTxt" VerticalAlignment="Center" Margin="0,0,0,0" Foreground="White" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center"/>
<Button x:Name="EditProfileBtn" Click="EditProfileBtn_Click" Padding="5" Margin="5,0,0,0" Content="&#xe9ef;" Style="{StaticResource RegularButton}" Foreground="#FFF" Background="#FF0A0A1E" FontFamily="..\Fonts\#FluentlyIcons">
<Button x:Name="EditProfileBtn" Click="EditProfileBtn_Click" Padding="5" Margin="5,0,0,0" Content="&#xe9ef;" Style="{StaticResource RegularButton}" Foreground="#FFF" Background="{x:Null}" FontFamily="..\Fonts\#FluentlyIcons">
<Button.ToolTip>
<ToolTip Content="{x:Static lang:Resources.EditProfile}" Background="#000014" Foreground="White"/>
</Button.ToolTip>
Expand Down
5 changes: 5 additions & 0 deletions Gavilya/Windows/ProfilesPopupMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,10 @@ private void EditProfileBtn_Click(object sender, RoutedEventArgs e)
{
new AddEditProfileWindow(EditMode.Edit, CurrentProfile).Show(); // Edit
}

private void StatsBtn_Click(object sender, RoutedEventArgs e)
{
Definitions.MainWindow.PageContent.Navigate(Definitions.Statistics); // Navigate
}
}
}

0 comments on commit ebda0ac

Please sign in to comment.