Skip to content

Commit

Permalink
Add Download Page Link to UI
Browse files Browse the repository at this point in the history
- Links to the github release page
  • Loading branch information
ValentinoAbate committed Sep 17, 2021
1 parent 3e09616 commit dd9e8d7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions PokemonRandomizer/PokemonRandomizer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</MenuItem>
<MenuItem Header="Help">
<MenuItem Header="About" Click="ShowAboutWindow"/>
<MenuItem Header="Open Download Page in Browser" Click="GoToDownloadPage"/>
</MenuItem>
</Menu>

Expand Down
12 changes: 11 additions & 1 deletion PokemonRandomizer/PokemonRandomizer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace PokemonRandomizer
using Backend.Utilities.Debug;
using Backend.Writing;
using PokemonRandomizer.AppSettings;
using System.Diagnostics;
using UI;
using UI.Json;
using UI.Models;
Expand Down Expand Up @@ -497,6 +498,15 @@ private void ShowAboutWindow(object sender, RoutedEventArgs e)
SetUIEnabled(true);
}

#endregion
private void GoToDownloadPage(object sender, RoutedEventArgs e)
{
string url = "https://github.com/ValentinoAbate/Pokemon-Randomizer/releases";
Process.Start(new ProcessStartInfo(url));
e.Handled = true;
}

#endregion


}
}
7 changes: 6 additions & 1 deletion PokemonRandomizer/PokemonRandomizer/Windows/AboutWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PokemonRandomizer.Windows"
mc:Ignorable="d"
Title="About" Height="150" Width="250" WindowStartupLocation="CenterOwner" WindowStyle="SingleBorderWindow" ShowInTaskbar="False" ResizeMode="NoResize">
Title="About" Height="165" Width="250" WindowStartupLocation="CenterOwner" WindowStyle="SingleBorderWindow" ShowInTaskbar="False" ResizeMode="NoResize">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Name="ContentRow" Height="*" ></RowDefinition>
Expand All @@ -20,6 +20,11 @@
<TextBlock TextWrapping="WrapWithOverflow" VerticalAlignment="Center" Margin="5,-5,5,5" FontSize="11">
Emerald (BPEE), FireRed v1.0 (BPRE-01)
</TextBlock>
<TextBlock Margin="5,2,0,5" FontSize="10">
<Hyperlink NavigateUri="https://github.com/ValentinoAbate/Pokemon-Randomizer/releases" RequestNavigate="GoToDownloadPage">
Download page (check for updates)
</Hyperlink>
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="1" >
<Button Content="Ok" Click="CloseWindow" Width="80" Margin="0,0,0,5"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -60,5 +61,11 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
}
return IntPtr.Zero;
}

private void GoToDownloadPage(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}

0 comments on commit dd9e8d7

Please sign in to comment.