Skip to content

Commit

Permalink
v2.8.4
Browse files Browse the repository at this point in the history
- Added the ability to launch the game from the context menu of the system tray icon. You can choose either H1Emu Servers, Singleplayer, or any five of your most recent custom servers (with the last one played always at the top of the list and moving down).
  • Loading branch information
Eavilaswayce committed Oct 31, 2023
1 parent 12b4bd1 commit 242f52e
Show file tree
Hide file tree
Showing 20 changed files with 317 additions and 208 deletions.
48 changes: 8 additions & 40 deletions H1EmuLauncher/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="TabItemStyleFirst" TargetType="{x:Type TabItem}">
<Style TargetType="{x:Type TabItem}" x:Key="TabItemStyleFirst">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
Expand Down Expand Up @@ -99,7 +99,7 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TabItemStyleMiddle" TargetType="{x:Type TabItem}">
<Style TargetType="{x:Type TabItem}" x:Key="TabItemStyleMiddle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
Expand Down Expand Up @@ -149,7 +149,7 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TabItemStyleLast" TargetType="{x:Type TabItem}">
<Style TargetType="{x:Type TabItem}" x:Key="TabItemStyleLast">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
Expand Down Expand Up @@ -202,7 +202,7 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
<Style TargetType="{x:Type ToggleButton}" x:Key="ToggleButtonStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
Expand Down Expand Up @@ -295,58 +295,26 @@
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type MenuItem}" x:Key="CopyMenuItem">
<Style TargetType="{x:Type MenuItem}" x:Key="CustomMenuItem">
<Setter Property="Foreground" Value="FloralWhite"/>
<Setter Property="FontWeight" Value="Light"/>
<Setter Property="Margin" Value="10,0,10,0"/>
<Setter Property="Icon" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border Background="#1C1B22">
<Border Background="#1C1B22" Margin="10,0,10,0">
<StackPanel Orientation="Horizontal">
<Image x:Name="menuItemImage" Width="15" Height="15" Source="Resources\Copy.png" RenderOptions.BitmapScalingMode="Fant" Margin="0,0,8,0"/>
<ContentPresenter ContentSource="Header"/>
<ContentPresenter ContentSource="Icon" Width="12" Height="12" RenderOptions.BitmapScalingMode="Fant" Margin="0,0,8,0" VerticalAlignment="Center"/>
<ContentPresenter ContentSource="Header" VerticalAlignment="Center" Margin="0,2,0,0"/>
</StackPanel>
</Border>

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="LightGray"/>
<Setter TargetName="menuItemImage" Property="Source" Value="Resources\Copy_Hover.png"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Foreground" Value="DarkGray"/>
<Setter TargetName="menuItemImage" Property="Source" Value="Resources\Copy_Pressed.png"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type MenuItem}" x:Key="DeleteMenuItem">
<Setter Property="Foreground" Value="FloralWhite"/>
<Setter Property="FontWeight" Value="Light"/>
<Setter Property="Margin" Value="10,0,10,0"/>
<Setter Property="Icon" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border Background="#1C1B22">
<StackPanel Orientation="Horizontal">
<Image x:Name="menuItemImage" Width="13" Height="13" Source="Resources\Delete.png" RenderOptions.BitmapScalingMode="Fant" Margin="0,0,8,0"/>
<ContentPresenter ContentSource="Header" Margin="0,2,0,0"/>
</StackPanel>
</Border>

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="LightGray"/>
<Setter TargetName="menuItemImage" Property="Source" Value="Resources\Delete_Hover.png"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Foreground" Value="DarkGray"/>
<Setter TargetName="menuItemImage" Property="Source" Value="Resources\Delete_Pressed.png"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down
2 changes: 1 addition & 1 deletion H1EmuLauncher/Classes/Carousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Carousel

public static ImageSource ConvertResourceToImageSource(string psResourceName)
{
return BitmapFrame.Create(new Uri("pack://application:,,,/H1EmuLauncher;component/" + psResourceName, UriKind.RelativeOrAbsolute));
return BitmapFrame.Create(new Uri("pack://application:,,,/H1EmuLauncher;component/" + psResourceName, UriKind.Absolute));
}

public static void BeginImageCarousel()
Expand Down
28 changes: 14 additions & 14 deletions H1EmuLauncher/Classes/SetLanguageFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,46 @@ public static ResourceDictionary LoadFile()
switch (Properties.Settings.Default.language)
{
case 0:
dict.Source = new Uri("Language/StringResources.en-EN.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.en-EN.xaml", UriKind.Relative);
break;
case 1:
dict.Source = new Uri("Language/StringResources.zh-CN.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.zh-CN.xaml", UriKind.Relative);
break;
case 2:
dict.Source = new Uri("Language/StringResources.hr-HR.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.hr-HR.xaml", UriKind.Relative);
break;
case 3:
dict.Source = new Uri("Language/StringResources.fr-FR.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.fr-FR.xaml", UriKind.Relative);
break;
case 4:
dict.Source = new Uri("Language/StringResources.tr-TR.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.tr-TR.xaml", UriKind.Relative);
break;
case 5:
dict.Source = new Uri("Language/StringResources.pl-PL.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.pl-PL.xaml", UriKind.Relative);
break;
case 6:
dict.Source = new Uri("Language/StringResources.ru-RU.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.ru-RU.xaml", UriKind.Relative);
break;
case 7:
dict.Source = new Uri("Language/StringResources.nl-NL.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.nl-NL.xaml", UriKind.Relative);
break;
case 8:
dict.Source = new Uri("Language/StringResources.bg-BG.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.bg-BG.xaml", UriKind.Relative);
break;
case 9:
dict.Source = new Uri("Language/StringResources.de-DE.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.de-DE.xaml", UriKind.Relative);
break;
case 10:
dict.Source = new Uri("Language/StringResources.pt-PT.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.pt-PT.xaml", UriKind.Relative);
break;
case 11:
dict.Source = new Uri("Language/StringResources.es-ES.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.es-ES.xaml", UriKind.Relative);
break;
case 12:
dict.Source = new Uri("Language/StringResources.se-SE.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.se-SE.xaml", UriKind.Relative);
break;
default:
dict.Source = new Uri("Language/StringResources.en-EN.xaml", UriKind.RelativeOrAbsolute);
dict.Source = new Uri("Language/StringResources.en-EN.xaml", UriKind.Relative);
break;
}

Expand Down
26 changes: 7 additions & 19 deletions H1EmuLauncher/H1EmuLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Icon.ico</ApplicationIcon>
<AssemblyVersion>2.8.3</AssemblyVersion>
<FileVersion>2.8.3</FileVersion>
<AssemblyVersion>2.8.4</AssemblyVersion>
<FileVersion>2.8.4</FileVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Authors>H1Emu</Authors>
<Version>2.8.3</Version>
<Version>2.8.4</Version>
<AssemblyName>H1EmuLauncher</AssemblyName>
<SignAssembly>false</SignAssembly>
<Copyright>© H1Emu</Copyright>
Expand Down Expand Up @@ -41,12 +41,8 @@
<None Remove="Resources\Arrow_Pressed.png" />
<None Remove="Resources\Assets_256.pack" />
<None Remove="Resources\Copy.png" />
<None Remove="Resources\Copy_Hover.png" />
<None Remove="Resources\Copy_Pressed.png" />
<None Remove="Resources\CustomClientConfig.ini" />
<None Remove="Resources\Delete.png" />
<None Remove="Resources\Delete_Hover.png" />
<None Remove="Resources\Delete_Pressed.png" />
<None Remove="Resources\Discord.png" />
<None Remove="Resources\Discord_Hover.png" />
<None Remove="Resources\Discord_Pressed.png" />
Expand Down Expand Up @@ -74,6 +70,7 @@
<None Remove="Resources\NextButton_Pressed.png" />
<None Remove="Resources\Node-18.12.1.zip" />
<None Remove="Resources\Padlock.png" />
<None Remove="Resources\Play.png" />
<None Remove="Resources\PrevButton.png" />
<None Remove="Resources\PrevButton_Hover.png" />
<None Remove="Resources\PrevButton_Pressed.png" />
Expand Down Expand Up @@ -177,24 +174,12 @@
<Resource Include="Resources\Copy.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Copy_Hover.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Copy_Pressed.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\CustomClientConfig.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Delete.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Delete_Hover.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Delete_Pressed.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Discord.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
Expand Down Expand Up @@ -273,6 +258,9 @@
<Resource Include="Resources\Padlock.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Play.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\PrevButton.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
Expand Down
50 changes: 10 additions & 40 deletions H1EmuLauncher/Properties/Resources.Designer.cs

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

15 changes: 3 additions & 12 deletions H1EmuLauncher/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@
<data name="Copy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Copy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Copy_Hover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Copy_Hover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Copy_Pressed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Copy_Pressed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NextButton_Pressed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\NextButton_Pressed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand All @@ -292,12 +286,6 @@
<data name="Delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Delete_Hover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Delete_Hover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Delete_Pressed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Delete_Pressed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Loading" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Loading.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down Expand Up @@ -325,4 +313,7 @@
<data name="MinimiseToSystemTray" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MinimiseToSystemTray.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Play" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Play.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file removed H1EmuLauncher/Resources/Copy_Hover.png
Binary file not shown.
Binary file removed H1EmuLauncher/Resources/Copy_Pressed.png
Binary file not shown.
Binary file removed H1EmuLauncher/Resources/Delete_Hover.png
Binary file not shown.
Binary file removed H1EmuLauncher/Resources/Delete_Pressed.png
Binary file not shown.
Binary file added H1EmuLauncher/Resources/Play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions H1EmuLauncher/SettingsPages/AccountKey.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@
<ContextMenu Style="{DynamicResource ContextMenuStyle}">
<MenuItem Click="AccountKeyLinkCopy"
Header="{DynamicResource item193}"
Style="{DynamicResource CopyMenuItem}"/>

Style="{DynamicResource CustomMenuItem}">

<MenuItem.Icon>
<Image Source="..\Resources\Copy.png" RenderOptions.BitmapScalingMode="Fant"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</TextBlock.ContextMenu>
</TextBlock>
Expand Down
12 changes: 0 additions & 12 deletions H1EmuLauncher/SettingsPages/GameFiles.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
using H1EmuLauncher.Classes;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Compression;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
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.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace H1EmuLauncher.SettingsPages
{
Expand Down
Loading

0 comments on commit 242f52e

Please sign in to comment.