Skip to content

Commit

Permalink
v0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fmmmlee committed Aug 27, 2019
1 parent b2588b9 commit 4977abf
Show file tree
Hide file tree
Showing 116 changed files with 1,960 additions and 949 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Make sure your system meets the **Requirements** and that you don't have any uns
Make sure that the game path is set correctly (the default is C:\Program Files\Guild Wars 2). The first time GW2-UOAOM is run, **all selected add-ons will be redownloaded**. This is due to the way the application keeps track of what add-ons are installed and the version of each. Subsequent runs should only download new files if your version of an add-on is not the same as their latest release.

### Application Requirements:
- **Windows** (64-bit)
- **Windows**
- **.NET Framework** (included in Windows 10)

### Currently Supported Add-Ons:
Expand All @@ -33,7 +33,6 @@ If something doesn't work, please open an issue describing the problem and inclu

#### To-Do:
- add settings panel with options to manually set .dll filenames and override the auto-naming
- add option to clear config.ini and start anew (for if it gets corrupted or messed up somehow)
- add ability to clean /bin64/ of all non-default .dlls

 
Expand Down
3 changes: 1 addition & 2 deletions application/source/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:GW2_Addon_Manager"
StartupUri="MainWindow.xaml"
Startup="Application_Startup">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Resources/Components/dropdown.xaml"/>
<ResourceDictionary Source="/Resources/Components/styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<system:Boolean x:Key="ArcDPS"/>
<system:Boolean x:Key="GW2Radial"/>
Expand Down
50 changes: 40 additions & 10 deletions application/source/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.IO;
using System.Windows;
using System.Windows.Threading;

namespace GW2_Addon_Manager
{
/// <summary>
/// Interaction logic for App.xaml
/// Interaction logic for App.xaml. Currently, the functions here are dedicated solely to application-wide exception handling and error logging.
/// </summary>
public partial class App : Application
{

static string logPath = "log.txt";

private void Application_Startup(object sender, StartupEventArgs e)
{
Application.Current.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(AppDispatcherUnhandledException);
}

/// <summary>
/// Displays a message and exits when an exception is thrown.
/// </summary>
/// <param name="sender">The object sending the exception.</param>
/// <param name="e">The exception information.</param>
void AppDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
#if DEBUG
Expand All @@ -33,17 +35,45 @@ void AppDispatcherUnhandledException(object sender, DispatcherUnhandledException
#endif
}

/// <summary>
/// Displays an error message when an unhandled exception is thrown.
/// </summary>
/// <param name="e">The exception information.</param>
void ShowUnhandledException(DispatcherUnhandledExceptionEventArgs e)
{
e.Handled = true;

string errmsg = string.Format("An unhandled exception occurred.",
e.Exception.Message + (e.Exception.InnerException != null ? "\n" + e.Exception.InnerException : null));
LogError(logPath, e);
string errmsg = "An unhandled exception occurred." + "\n" + e.Exception.Message + (e.Exception.InnerException != null ? "\n" + e.Exception.InnerException.Message : "");
if (MessageBox.Show(errmsg, "Critical Error", MessageBoxButton.OK, MessageBoxImage.Error) == MessageBoxResult.OK)
{
Application.Current.Shutdown();
}

}

/// <summary>
/// Writes information about unhandled exceptions to a log file.
/// </summary>
/// <param name="logfile">The path to the log file to be written to.</param>
/// <param name="e">The exception information.</param>
void LogError(string logfile, DispatcherUnhandledExceptionEventArgs e)
{
string header = "[Log Entry]\n";
string exceptionTree = "";

Exception ex = e.Exception;
exceptionTree += ex.Message + "\n";

while (ex.InnerException != null)
{
ex = ex.InnerException;
exceptionTree += ex.Message + "\n";
}

string date = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToString() + "\n";

string fullLogMsg = header + date + exceptionTree;
File.AppendAllText(logfile, fullLogMsg);
}
}
}
3 changes: 1 addition & 2 deletions application/source/GW2 Addon Manager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
<Compile Include="arcdps.cs" />
<Compile Include="configuration.cs" />
<Compile Include="d912pxy.cs" />
<Compile Include="gw2hook.cs" />
<Compile Include="gw2radial.cs" />
<Compile Include="OpeningViewModel.cs" />
<Compile Include="PluginManagement.cs" />
Expand Down Expand Up @@ -153,7 +152,7 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Resources\Components\dropdown.xaml">
<Page Include="Resources\Components\styles.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down
11 changes: 5 additions & 6 deletions application/source/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<NavigationWindow x:Class="GW2_Addon_Manager.MainWindow"
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:GW2_Addon_Manager"
mc:Ignorable="d"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="GW2 Add-On Updater" Height="600" Width="1130" Source="OpeningView.xaml" ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True">
<NavigationWindow.Background>
<ImageBrush ImageSource="/Resources/GW2-UOAOU-UI.png"/>
Expand Down
3 changes: 3 additions & 0 deletions application/source/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ namespace GW2_Addon_Manager
/// </summary>
public partial class MainWindow : NavigationWindow
{
/// <summary>
/// Initializes the application's main window.
/// </summary>
public MainWindow()
{
InitializeComponent();
Expand Down
121 changes: 13 additions & 108 deletions application/source/OpeningView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
x:Class="GW2_Addon_Manager.AddOnSelector"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="1130"
Expand All @@ -20,90 +19,6 @@
</Setter.Value>
</Setter>
</Style>
<SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFFF4747"/>
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
<SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
<SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
<Style x:Key="Xbutton" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="BigContentButtons" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</Page.Resources>

<Grid Margin="0,0,0,0">
Expand All @@ -116,7 +31,7 @@
</Grid.RowDefinitions>

<DockPanel Grid.Row="0" x:Name="windowControls" DockPanel.Dock="Top" VerticalAlignment="Top" Height="40" Margin="0,20,0,0">
<Button x:Name="close" Content="x" Click="close_clicked" Width="20" Height = "25" DockPanel.Dock="Right" Background="Transparent" Foreground="Black" FontSize="16" Margin="0,0,60,0" BorderThickness="0" Style="{DynamicResource Xbutton}" FontFamily="Leelawadee UI"/>
<Button x:Name="close" Content="x" Click="close_clicked" Width="20" Height = "25" DockPanel.Dock="Right" Background="Transparent" Foreground="Black" FontSize="16" Margin="0,0,100,0" BorderThickness="0" Style="{StaticResource navbarclose}" FontFamily="Leelawadee UI"/>
<Button x:Name="minimize" Content="-" Click="minimize_clicked" Width="20" Height = "25" DockPanel.Dock="Right" HorizontalAlignment="Right" Background="Transparent" Foreground="Black" FontSize="16" BorderThickness="0" FontFamily="Leelawadee UI"/>
<Label PreviewMouseDown="TitleBar_MouseHeld"/>
<!--<Button x:Name="settings" Content="Settings" HorizontalAlignment="Left" Height="20" Background="Transparent" BorderThickness="0" Margin="35,0,0,0" FontFamily="Microsoft YaHei Light"/>-->
Expand All @@ -135,7 +50,7 @@
Width="75"
Template="{StaticResource settings_dropdown}"
>
<ComboBoxItem>
<ComboBoxItem Padding="0,0,0,0">
<Button Command="{Binding Path=CreateShortcut}"
Content="Create Shortcut"
ToolTip="Adds a shortcut to the application to the start menu - if program is moved, the shortcut will not function!"
Expand All @@ -144,8 +59,9 @@
BorderThickness="0"
FontSize="12"
FontFamily="Microsoft YaHei UI Light"
Height="25"
Width="100"
Height="30"
Width="105"
Style="{DynamicResource dropdownbutton}"
/>
</ComboBoxItem>
</ComboBox>
Expand Down Expand Up @@ -197,7 +113,7 @@
Width="40"
BorderThickness="1"
BorderBrush="#ff8787"
Style="{DynamicResource BigContentButtons}"
Style="{StaticResource BigContentButton}"
/>
<TextBox Text="{Binding GamePath}"
Grid.Row="2"
Expand Down Expand Up @@ -238,7 +154,7 @@
FontFamily="Microsoft YaHei UI Light"
BorderThickness="1"
BorderBrush="#ff8787"
Style="{DynamicResource BigContentButtons}"
Style="{StaticResource BigContentButton}"
/>
<Button Command="{Binding Path=DeleteSelected}"
Grid.Row="3"
Expand All @@ -254,7 +170,7 @@
FontFamily="Microsoft YaHei UI Light"
BorderThickness="1"
BorderBrush="#ff8787"
Style="{DynamicResource BigContentButtons}"
Style="{StaticResource BigContentButton}"
/>
<Button Command="{Binding Path=DisableSelected}"
Grid.Row="3"
Expand All @@ -270,7 +186,7 @@
FontFamily="Microsoft YaHei UI Light"
BorderThickness="1"
BorderBrush="DimGray"
Style="{DynamicResource BigContentButtons}"
Style="{StaticResource BigContentButton}"
/>
<Button Command="{Binding Path=EnableSelected}"
Grid.Row="3"
Expand All @@ -286,32 +202,21 @@
FontFamily="Microsoft YaHei UI Light"
BorderThickness="1"
BorderBrush="DimGray"
Style="{DynamicResource BigContentButtons}"
Style="{StaticResource BigContentButton}"
/>
<Button Grid.Row="3" x:Name="nextPage" Height="45" Width="120" Content="UPDATE"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Margin="0,50,175,25"
Foreground="White"
Background="Red"
Click="update_button_clicked"
FontFamily="Footlight MT Light"
FontSize="16"
BorderThickness="1"
BorderBrush="#ff8787" Style="{DynamicResource BigContentButtons}"

BorderBrush="#ff8787"
Style="{StaticResource BigContentButton}"
>
<Button.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color= "Red" Offset="0.5"/>
</LinearGradientBrush>
<!--<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color= "#ffffff" Offset="0"/>
<GradientStop Color= "#f54242" Offset="0.25"/>
<GradientStop Color= "Red" Offset="0.5"/>
<GradientStop Color= "#f54242" Offset="0.75"/>
<GradientStop Color= "#ffffff" Offset="1"/>
</LinearGradientBrush>-->
</Button.Background>
</Button>

</Grid>
Expand Down
Loading

0 comments on commit 4977abf

Please sign in to comment.