Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
v0.1.0 - add about page, lets fk it ship it!
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholastay committed Oct 10, 2017
1 parent d290f89 commit cdc301f
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 1 deletion.
22 changes: 22 additions & 0 deletions About.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Window x:Class="MapleRIL.About"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MapleRIL"
mc:Ignorable="d"
Title="About - MapleRIL" Height="446.713" Width="799.875" ResizeMode="NoResize" Background="#FF4D4B4B" Icon="logo.ico">
<Grid>
<Grid HorizontalAlignment="Left" Height="117" VerticalAlignment="Top" Width="794" Background="#FF2C2C2C">
<Label Content="| MapleStory Region Item Lookup" HorizontalAlignment="Left" Height="32" Margin="221,57,0,0" VerticalAlignment="Top" Width="236" Foreground="White"/>
<Image HorizontalAlignment="Left" Height="95" Margin="14,10,0,0" VerticalAlignment="Top" Width="95" Source="logo.ico"/>
<Label Content="MapleRIL" HorizontalAlignment="Left" Height="43" Margin="114,44,0,0" VerticalAlignment="Top" Width="178" FontSize="24" Foreground="White"/>
<Image HorizontalAlignment="Left" Height="95" Margin="10,10,0,0" VerticalAlignment="Top" Width="95" Source="logo.ico"/>
</Grid>
<TextBlock x:Name="infoBlock" HorizontalAlignment="Left" Height="91" Margin="12,132,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="357" Foreground="White" Text="Info"/>
<ListBox x:Name="displayListBox" HorizontalAlignment="Left" Height="142" Margin="12,256,0,0" VerticalAlignment="Top" Width="760"/>
<Label Content="Loaded regions and files:" HorizontalAlignment="Left" Height="28" Margin="7,228,0,0" VerticalAlignment="Top" Width="148" Foreground="White"/>
<TextBlock x:Name="otherBlock" HorizontalAlignment="Left" Height="91" Margin="389,132,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="383" RenderTransformOrigin="1.018,0.527" Foreground="White"/>

</Grid>
</Window>
49 changes: 49 additions & 0 deletions About.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace MapleRIL
{
/// <summary>
/// Interaction logic for About.xaml
/// </summary>
public partial class About : Window
{
public About(MainWindow mw)
{
InitializeComponent();

string i = String.Format(@"MapleRIL: MapleStory Region Item Lookup
{0}
(c) 2017 Nicholas Tay / ""Nexerq"" <[email protected]>.
Licensed under the zlib/libpng license.
Full license text can be found in the root of the repository.", mw.FriendlyAppVersion);
infoBlock.Text = i;

System.Reflection.Assembly mlib = typeof(MapleLib.WzLib.WzFile).Assembly;
FileVersionInfo mlibFvi = FileVersionInfo.GetVersionInfo(mlib.Location);
string o = String.Format(@"MapleRIL also utilizes libraries from other open source projects, including:
MapleLib v{0} (uses WZ component(s))
{1}", $"{mlibFvi.ProductMajorPart}.{mlibFvi.ProductMinorPart}.{mlibFvi.ProductBuildPart}", mlibFvi.LegalCopyright);
otherBlock.Text = o;

foreach (var file in mw.SourceWzs.Values)
displayListBox.Items.Add($"{mw.SourceRegion}: {file.FilePath}");
foreach (var file in mw.TargetWzs.Values)
displayListBox.Items.Add($"{mw.TargetRegion}: {file.FilePath}");

}
}
}
2 changes: 1 addition & 1 deletion App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private void Application_DispatcherUnhandledException(object sender, System.Wind
{
#if !DEBUG
e.Handled = true;
MessageBox.Show("A fatal error has occured in MapleRIL. Please screenshot and report this error to Nicholas Tay <[email protected]>!\n\n" + e.Exception.ToString(), "MapleRIL - Fatal Exception", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("A fatal error has occured in MapleRIL. Please screenshot and report this error to Nexerq via Discord, or, with some extra details, submit an issue to the GitHub repository (nicholastay/MapleRIL)!\n\n" + e.Exception.ToString(), "MapleRIL - Fatal Exception", MessageBoxButton.OK, MessageBoxImage.Error);
Environment.Exit(1);
#endif
}
Expand Down
1 change: 1 addition & 0 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<Label x:Name="warningLabel" Content="" Height="29" Margin="0,15,34,0" VerticalAlignment="Top" Foreground="Red" HorizontalContentAlignment="Right" HorizontalAlignment="Right" Width="463"/>
<Image HorizontalAlignment="Left" Height="95" Margin="28,10,0,0" VerticalAlignment="Top" Width="95" Source="logo.ico" MouseLeftButtonUp="Image_MouseLeftButtonUp"/>
<Label Content="MapleRIL" HorizontalAlignment="Left" Height="43" Margin="128,44,0,0" VerticalAlignment="Top" Width="178" FontSize="24" Foreground="White"/>
<Label x:Name="aboutLabel" Content="vX.Y.Z ~ Click for about info" Margin="235,0,223,10" Foreground="White" HorizontalContentAlignment="Center" MouseLeftButtonUp="aboutLabel_MouseLeftButtonUp" Height="24" VerticalAlignment="Bottom"/>

</Grid>
</Window>
10 changes: 10 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public partial class MainWindow : Window

public ObservableCollection<SearchedItem> SearchResults = new ObservableCollection<SearchedItem>();

public Version AppVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
public string FriendlyAppVersion => $"v{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}";

public MainWindow()
{
InitializeComponent();
Expand All @@ -66,6 +69,8 @@ public MainWindow()

loadFilters();
dataGrid.ItemsSource = SearchResults;

aboutLabel.Content = $"{FriendlyAppVersion} ~ Click for about info";
}

private void checkForSetup()
Expand Down Expand Up @@ -247,5 +252,10 @@ private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)

(new Setup()).ShowDialog();
}

private void aboutLabel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
(new About(this)).ShowDialog();
}
}
}
7 changes: 7 additions & 0 deletions MapleRIL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="About.xaml.cs">
<DependentUpon>About.xaml</DependentUpon>
</Compile>
<Compile Include="Comparison.xaml.cs">
<DependentUpon>Comparison.xaml</DependentUpon>
</Compile>
Expand All @@ -97,6 +100,10 @@
<Compile Include="Structure\PetItemWzItemType.cs" />
<Compile Include="Structure\SearchedItem.cs" />
<Compile Include="Structure\WzItemType.cs" />
<Page Include="About.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Comparison.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down

0 comments on commit cdc301f

Please sign in to comment.