Skip to content

Commit

Permalink
v2.8.7
Browse files Browse the repository at this point in the history
- Added the ability to edit a custom servers' info instead of having to remove it and add a new one
- The launcher will now automatically show itself after the game closes
- Fixed some typos
  • Loading branch information
Eavilaswayce committed Nov 7, 2023
1 parent 242f52e commit 68aa835
Show file tree
Hide file tree
Showing 53 changed files with 503 additions and 455 deletions.
13 changes: 13 additions & 0 deletions H1EmuLauncher/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,19 @@
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Separator}" x:Key="SeparatorMenuItem">
<Setter Property="Foreground" Value="FloralWhite"/>
<Setter Property="FontWeight" Value="Light"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border>
<Rectangle Height="1" Fill="{TemplateBinding Background}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ContextMenu}" x:Key="ContextMenuStyle">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="True"/>
Expand Down
16 changes: 8 additions & 8 deletions H1EmuLauncher/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
using H1EmuLauncher.Classes;
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Windows;
using System.Windows.Media.Animation;

namespace H1EmuLauncher
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private void ApplicationStartup(object sender, StartupEventArgs e)
{
if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
{
File.WriteAllText($"{Classes.Info.APPLICATION_DATA_PATH}\\H1EmuLauncher\\args.txt", string.Join(" ", e.Args));
Environment.Exit(0);
}
else if (LauncherWindow.launcherInstance == null && e.Args.Length > 0)
{
LauncherWindow.rawArgs = e.Args;
LauncherWindow.executeArguments = true;
}

Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata { DefaultValue = 30 });

// Adds the correct language file to the resource dictionary and then loads it.
Resources.MergedDictionaries.Clear();
Resources.MergedDictionaries.Add(SetLanguageFile.LoadFile());
Resources.MergedDictionaries.Add(Classes.SetLanguageFile.LoadFile());

LauncherWindow.rawArgs = e.Args;
new UpdateWindow();
}
}
Expand Down
3 changes: 3 additions & 0 deletions H1EmuLauncher/Classes/ApplyPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ public static void ApplyPatch()
{
// Extract Asset_256.pack to fix blackberries
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\Resources\\Assets\\Assets_256.pack", Properties.Resources.Assets_256);

// Extract modified BattlEye to provide custom anti-cheat and asset validation
File.WriteAllBytes($"{Properties.Settings.Default.activeDirectory}\\H1Z1_BE.exe", Properties.Resources.H1Z1_BE);
}
}

Expand Down
2 changes: 0 additions & 2 deletions H1EmuLauncher/Classes/Carousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ public static void BeginImageCarousel()
foreach (DictionaryEntry entry in resourceSet)
{
if (int.TryParse(entry.Key.ToString().Replace("_", ""), out _))
{
images.Add($"{entry.Key.ToString().Replace("_", "")}.jpg");
}
}

Application.Current.Dispatcher.Invoke(new Action(delegate
Expand Down
32 changes: 28 additions & 4 deletions H1EmuLauncher/Classes/CustomMessageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,38 @@ public static void AddServer(Window owner, string newServerName = null, string n

if (!string.IsNullOrEmpty(newServerName) || !string.IsNullOrEmpty(newServerIp))
{
AddServerWindow.addServerInstance.serverNameBox.Text = newServerName;
AddServerWindow.addServerInstance.serverIpBox.Text = newServerIp;
AddServerWindow.addServerInstance.serverNameHint.Visibility = Visibility.Hidden;
AddServerWindow.addServerInstance.serverIpHint.Visibility = Visibility.Hidden;
addServer.serverNameBox.Text = newServerName;
addServer.serverIpBox.Text = newServerIp;
addServer.serverNameHint.Visibility = Visibility.Hidden;
addServer.serverIpHint.Visibility = Visibility.Hidden;
}

addServer.Show();
LauncherWindow.launcherInstance.launcherFade.IsHitTestVisible = true;
}

public static void EditServer(Window owner, int editIndex, string newServerName = null, string newServerIp = null)
{
AddServerWindow editServer = new();

if (owner != null)
editServer.Owner = owner;
else
editServer.WindowStartupLocation = WindowStartupLocation.CenterScreen;

if (!string.IsNullOrEmpty(newServerName) || !string.IsNullOrEmpty(newServerIp))
{
editServer.serverNameBox.Text = newServerName;
editServer.serverIpBox.Text = newServerIp;
editServer.serverNameHint.Visibility = Visibility.Hidden;
editServer.serverIpHint.Visibility = Visibility.Hidden;
}

editServer.saveServerButton.Content = LauncherWindow.launcherInstance.FindResource("item213").ToString();
editServer.editIndex = editIndex;

editServer.Show();
LauncherWindow.launcherInstance.launcherFade.IsHitTestVisible = true;
}
}
}
18 changes: 15 additions & 3 deletions H1EmuLauncher/H1EmuLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Icon.ico</ApplicationIcon>
<AssemblyVersion>2.8.4</AssemblyVersion>
<FileVersion>2.8.4</FileVersion>
<FileVersion>2.8.7</FileVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Authors>H1Emu</Authors>
<Version>2.8.4</Version>
<Version>2.8.7</Version>
<AssemblyName>H1EmuLauncher</AssemblyName>
<SignAssembly>false</SignAssembly>
<Copyright>© H1Emu</Copyright>
<Product>H1Emu Launcher</Product>
<Description>A launcher for the H1Emu project.</Description>
<Title>H1Emu Launcher</Title>
<PackageIcon>Icon.ico</PackageIcon>
<AssemblyVersion>2.8.7</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -47,6 +47,7 @@
<None Remove="Resources\Discord_Hover.png" />
<None Remove="Resources\Discord_Pressed.png" />
<None Remove="Resources\DisplayImage.png" />
<None Remove="Resources\Edit.png" />
<None Remove="Resources\Exit.png" />
<None Remove="Resources\Folder.png" />
<None Remove="Resources\Folder_Hover.png" />
Expand All @@ -57,6 +58,7 @@
<None Remove="Resources\Grain.png" />
<None Remove="Resources\H1EmuIcon.png" />
<None Remove="Resources\H1EmuLogo.png" />
<None Remove="Resources\H1Z1_BE.exe" />
<None Remove="Resources\HideKey.png" />
<None Remove="Resources\HideKey_Hover.png" />
<None Remove="Resources\HideKey_Pressed.png" />
Expand All @@ -70,6 +72,7 @@
<None Remove="Resources\NextButton_Pressed.png" />
<None Remove="Resources\Node-18.12.1.zip" />
<None Remove="Resources\Padlock.png" />
<None Remove="Resources\Placeholder.jpg" />
<None Remove="Resources\Play.png" />
<None Remove="Resources\PrevButton.png" />
<None Remove="Resources\PrevButton_Hover.png" />
Expand Down Expand Up @@ -189,6 +192,9 @@
<Resource Include="Resources\Discord_Pressed.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Edit.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Exit.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
Expand Down Expand Up @@ -219,6 +225,9 @@
<Resource Include="Resources\H1EmuLogo.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\H1Z1_BE.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\HideKey.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
Expand Down Expand Up @@ -258,6 +267,9 @@
<Resource Include="Resources\Padlock.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Placeholder.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Play.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
Expand Down
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.bg-BG.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Ново обновление е налично,желаете ли да го изтеглите?</system:String>
<system:String x:Key="item1">Необходима е нова актуализация за игра, моля, изчакайте.</system:String>
<system:String x:Key="item2">Обновление</system:String>
<system:String x:Key="item3">Версия</system:String>
<system:String x:Key="item4">Моля Изчакай</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Съобщение</system:String>
<system:String x:Key="item210">Начален Eкран</system:String>
<system:String x:Key="item211">Налична Aктуализация</system:String>
<system:String x:Key="item212">Pедактиране</system:String>
<system:String x:Key="item213">ЗАПАЗЕТЕ</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.de-DE.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Eine neue Aktualisierung ist verfügbar, möchtest du die Aktualisierung jetzt ausführen?</system:String>
<system:String x:Key="item1">Zum spielen ist ein neues update erforderlich. Bitte warten sie.</system:String>
<system:String x:Key="item2">Aktualisierung</system:String>
<system:String x:Key="item3">Aktualisieren</system:String>
<system:String x:Key="item4">Warten Sie mal</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Nachricht</system:String>
<system:String x:Key="item210">Begrüßungsbildschirm</system:String>
<system:String x:Key="item211">Update Verfügbar</system:String>
<system:String x:Key="item212">Bearbeiten</system:String>
<system:String x:Key="item213">SPEICHERN</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.en-EN.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">A new update is available, would you like to update now?</system:String>
<system:String x:Key="item1">A new update is required to play, please wait.</system:String>
<system:String x:Key="item2">UPDATE</system:String>
<system:String x:Key="item3">Version</system:String>
<system:String x:Key="item4">Please wait</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Message</system:String>
<system:String x:Key="item210">Splash Screen</system:String>
<system:String x:Key="item211">Update Available</system:String>
<system:String x:Key="item212">Edit</system:String>
<system:String x:Key="item213">SAVE</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.es-ES.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Existe una nueva actualización disponible; ¿quieres actualizar ahora?</system:String>
<system:String x:Key="item1">Se requiere una nueva actualización para jugar, espera.</system:String>
<system:String x:Key="item2">ACTUALIZAR</system:String>
<system:String x:Key="item3">Versión</system:String>
<system:String x:Key="item4">Espere por favor</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Mensaje</system:String>
<system:String x:Key="item210">Pantalla de Bienvenida</system:String>
<system:String x:Key="item211">Actualización Disponible</system:String>
<system:String x:Key="item212">Editar</system:String>
<system:String x:Key="item213">AHORRAR</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.fr-FR.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Une mise à jour est disponible, voulez vous la télécharger?</system:String>
<system:String x:Key="item1">Une nouvelle mise à jour est nécessaire pour jouer, veuillez patienter.</system:String>
<system:String x:Key="item2">Mise à jour</system:String>
<system:String x:Key="item3">Màj Version</system:String>
<system:String x:Key="item4">S'il vous plaît, attendez</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Message</system:String>
<system:String x:Key="item210">Écran de Démarrage</system:String>
<system:String x:Key="item211">Mise à Jour Disponible</system:String>
<system:String x:Key="item212">Modifier</system:String>
<system:String x:Key="item213">SAUVEGARDER</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.hr-HR.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Nova verzija je dostupna, želite li ažurirati?</system:String>
<system:String x:Key="item1">Novi update je potreban za igranje, molim pričekajte.</system:String>
<system:String x:Key="item2">AŽURIRANJE</system:String>
<system:String x:Key="item3">Verzija</system:String>
<system:String x:Key="item4">Molimo pričekajte</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Poruka</system:String>
<system:String x:Key="item210">Početni Zaslon</system:String>
<system:String x:Key="item211">Ažuriranje Dostupno</system:String>
<system:String x:Key="item212">Uredi</system:String>
<system:String x:Key="item213">UŠTEDJETI</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.nl-NL.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Een niewe versie is beschikbaar, wilt u deze instaleren?</system:String>
<system:String x:Key="item1">Er is een nieuwe update vereist om te kunnen spelen. Een ogenblik geduld.</system:String>
<system:String x:Key="item2">INSTALEREN</system:String>
<system:String x:Key="item3">Versie</system:String>
<system:String x:Key="item4">Even geduld aub</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Bericht</system:String>
<system:String x:Key="item210">Opstartscherm</system:String>
<system:String x:Key="item211">Update Beschikbaar</system:String>
<system:String x:Key="item212">Bewerking</system:String>
<system:String x:Key="item213">REDDEN</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.pl-PL.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Dostępna jest nowa aktualizacja, Czy chcesz zaktualizować teraz?</system:String>
<system:String x:Key="item1">Aby zagrać, wymagana jest nowa aktualizacja. Proszę czekać.</system:String>
<system:String x:Key="item2">AKTUALIZACJA</system:String>
<system:String x:Key="item3">Wersja</system:String>
<system:String x:Key="item4">Proszę czekać</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Wiadomość</system:String>
<system:String x:Key="item210">Ekran Powitalny</system:String>
<system:String x:Key="item211">Dostępna Aktualizacja</system:String>
<system:String x:Key="item212">Edytować</system:String>
<system:String x:Key="item213">RATOWAĆ</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.pt-PT.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Uma nova atualização está disponível, quer atualizar agora?</system:String>
<system:String x:Key="item1">Uma nova atualização é necessária para jogar, aguarde.</system:String>
<system:String x:Key="item2">ATUALIZAR</system:String>
<system:String x:Key="item3">Versão</system:String>
<system:String x:Key="item4">Por favor, espere</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Mensagem</system:String>
<system:String x:Key="item210">Tela de Abertura</system:String>
<system:String x:Key="item211">Atualização Disponível</system:String>
<system:String x:Key="item212">Editar</system:String>
<system:String x:Key="item213">SALVAR</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.ru-RU.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">Доступно новое обновление, хотите обновить сейчас?</system:String>
<system:String x:Key="item1">Для игры требуется новое обновление, подождите.</system:String>
<system:String x:Key="item2">ОБНОВИТЬ</system:String>
<system:String x:Key="item3">Обновление</system:String>
<system:String x:Key="item4">Пожалуйста подождите</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Сообщение</system:String>
<system:String x:Key="item210">Заставка</system:String>
<system:String x:Key="item211">Доступно Oбновление</system:String>
<system:String x:Key="item212">Редактировать</system:String>
<system:String x:Key="item213">СОХРАНЯТЬ</system:String>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion H1EmuLauncher/Language/StringResources.se-SE.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="item1">En ny uppdatering är tillgänglig, vill du uppdatera nu?</system:String>
<system:String x:Key="item1">En ny uppdatering krävs för att spela, vänligen vänta.</system:String>
<system:String x:Key="item2">UPPDATERA</system:String>
<system:String x:Key="item3">Version</system:String>
<system:String x:Key="item4">Var god vänta</system:String>
Expand Down Expand Up @@ -186,4 +186,6 @@
<system:String x:Key="item209">Meddelande</system:String>
<system:String x:Key="item210">Startbild</system:String>
<system:String x:Key="item211">Uppdatering Tillgänglig</system:String>
<system:String x:Key="item212">Redigera</system:String>
<system:String x:Key="item213">SPARA</system:String>
</ResourceDictionary>
Loading

0 comments on commit 68aa835

Please sign in to comment.