Skip to content

Commit

Permalink
v3.2.3
Browse files Browse the repository at this point in the history
- Fix path geometries not parsing correctly with other cultures/regions/languages
- Fix resource not found on OpenFolderDialog when switching languages
- Added a launch argument to launch the game straight away when opening the launcher with -launchgame
- Code cleanup
- General bug fixes
  • Loading branch information
Eavilaswayce committed Dec 13, 2024
1 parent 3e8b6b0 commit fd3a34b
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 39 deletions.
6 changes: 3 additions & 3 deletions H1EmuLauncher/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void SendArgumentsToRunningInstance(string[] args)
{
try
{
NamedPipeClientStream pipeClient = new(".", "H1EmuLauncherPipe", PipeDirection.Out);
NamedPipeClientStream pipeClient = new(null, "H1EmuLauncherPipe", PipeDirection.Out);
StreamWriter writer = new(pipeClient);

pipeClient.Connect(1000);
Expand All @@ -88,7 +88,7 @@ private void SendArgumentsToRunningInstance(string[] args)
}
catch (Exception e)
{
CustomMessageBox.Show($"Error sending argumentsto active instance: \"{e.Message}\".");
CustomMessageBox.Show($"Error sending launch arguments to active instance: \"{e.Message}\".", LauncherWindow.launcherInstance);
}
}

Expand All @@ -103,7 +103,7 @@ private void TextBoxContextMenuPasteClick(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
CustomMessageBox.Show($"{FindResource("item184")} \"{ex.Message}\".");
CustomMessageBox.Show($"{FindResource("item220")} \"{ex.Message}\".");
}
}

Expand Down
2 changes: 1 addition & 1 deletion H1EmuLauncher/Classes/CustomSettingsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public override void SetPropertyValues(SettingsContext context, SettingsProperty

private void LoadValuesFromFile()
{
// New data folder name
// New data folder name so user settings need to be migrated
if (Directory.Exists($"{Info.APPLICATION_DATA_PATH}\\H1EmuLauncher"))
{
try
Expand Down
6 changes: 3 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>
<FileVersion>3.2.2</FileVersion>
<FileVersion>3.2.3</FileVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Authors>H1Emu</Authors>
<Version>3.2.2</Version>
<Version>3.2.3</Version>
<AssemblyName>H1Emu Launcher</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>3.2.2</AssemblyVersion>
<AssemblyVersion>3.2.3</AssemblyVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down
5 changes: 3 additions & 2 deletions H1EmuLauncher/SettingsPages/AccountKey.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
Expand Down Expand Up @@ -121,13 +122,13 @@ private void ToggleKeyVisibility(object sender, RoutedEventArgs e)
{
accountKeyBoxPassword.Visibility = Visibility.Hidden;
accountKeyBoxText.Visibility = Visibility.Visible;
toggleKeyVisibilityButtonPath.Data = Geometry.Parse(FindResource("EyeHideIcon").ToString());
toggleKeyVisibilityButtonPath.Data = (PathGeometry)FindResource("EyeHideIcon");
}
else
{
accountKeyBoxPassword.Visibility = Visibility.Visible;
accountKeyBoxText.Visibility = Visibility.Hidden;
toggleKeyVisibilityButtonPath.Data = Geometry.Parse(FindResource("EyeIcon").ToString());
toggleKeyVisibilityButtonPath.Data = (PathGeometry)FindResource("EyeIcon");
}

toggleKeyVisibilityButton.Content = toggleKeyVisibilityButtonPath;
Expand Down
33 changes: 19 additions & 14 deletions H1EmuLauncher/SteamFramePages/Login.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ public partial class Login
{
private static Storyboard loadingAnimation;
public static string gameInfo = "-app 295110 -depot 295111 -manifest 8395659676467739522";
OpenFolderDialog selectDirectory = new()
{
Title = Application.Current.FindResource("item51").ToString()
};

public Login()
{
Expand Down Expand Up @@ -132,13 +128,17 @@ public async void TryLoginDownload()
SelectLocation:
bool result = true;
bool returnToLogin = false;
string selectedDirectory = string.Empty;

Dispatcher.Invoke(new Action(delegate
{
if (selectDirectory.ShowDialog() == false)
OpenFolderDialog ofd = new()
{
UpdateLang();
Title = FindResource("item51").ToString()
};

if (ofd.ShowDialog() == false)
{
MessageBoxResult mbr = CustomMessageBox.Show(FindResource("item222").ToString(), LauncherWindow.launcherInstance, false, true, true);
if (mbr == MessageBoxResult.Yes)
{
Expand All @@ -150,14 +150,17 @@ public async void TryLoginDownload()
}
else
{
if (Directory.GetFileSystemEntries(selectDirectory.FolderName).Length != 0)
if (Directory.GetFileSystemEntries(ofd.FolderName).Length != 0)
{
UpdateLang();

MessageBoxResult mbr = CustomMessageBox.Show(FindResource("item89").ToString().Replace("\\n\\n", Environment.NewLine + Environment.NewLine), LauncherWindow.launcherInstance, false, true, true);
if (mbr != MessageBoxResult.Yes)
result = false;
if (mbr != MessageBoxResult.Yes)
{
result = false;
return;
}
}

selectedDirectory = ofd.FolderName;
}
}));

Expand All @@ -166,7 +169,7 @@ public async void TryLoginDownload()
else if (returnToLogin)
return;

ContentDownloader.DEFAULT_DOWNLOAD_DIR = selectDirectory.FolderName;
ContentDownloader.DEFAULT_DOWNLOAD_DIR = selectedDirectory;

foreach (ulong manifestId in manifestIdList)
{
Expand Down Expand Up @@ -200,14 +203,14 @@ public async void TryLoginDownload()

Dispatcher.Invoke(new Action(delegate
{
UpdateLang();
LauncherWindow.launcherInstance.taskbarIcon.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None;
LauncherWindow.launcherInstance.steamFramePanel.Navigate(new Uri("..\\SteamFramePages\\DownloadComplete.xaml", UriKind.Relative));
loadingAnimation.Stop();
loadingIcon.Visibility = Visibility.Hidden;
loginEnterButton.Visibility = Visibility.Visible;
LauncherWindow.launcherInstance.directoryBox.Text = Properties.Settings.Default.activeDirectory;
LauncherWindow.launcherInstance.CheckGameVersionAndPath(LauncherWindow.launcherInstance, false, true);
UpdateLang();
CustomMessageBox.Show($"{FindResource("item37")} {version}.", LauncherWindow.launcherInstance);
}));
}
Expand All @@ -228,6 +231,7 @@ public async void TryLoginDownload()
Dispatcher.Invoke(new Action(delegate
{
BackToLogin();
UpdateLang();
CustomMessageBox.Show($"{FindResource("item38")} {version}.", LauncherWindow.launcherInstance);
}));
}
Expand All @@ -236,6 +240,7 @@ public async void TryLoginDownload()
Dispatcher.Invoke(new Action(delegate
{
BackToLogin();
UpdateLang();
if (ex.Message.Contains("is not available from this account."))
CustomMessageBox.Show($"{FindResource("item39")} \"{ex.Message}\".\n\n{FindResource("item15")}", LauncherWindow.launcherInstance);
else
Expand All @@ -247,6 +252,7 @@ public async void TryLoginDownload()
Dispatcher.Invoke(new Action(delegate
{
BackToLogin();
UpdateLang();
CustomMessageBox.Show($"{FindResource("item40")} \"{exc.Message}\".", LauncherWindow.launcherInstance);
}));
}
Expand Down Expand Up @@ -355,7 +361,6 @@ static List<T> GetParameterList<T>(string[] args, string param)

public void BackToLogin()
{
UpdateLang();
LauncherWindow.launcherInstance.taskbarIcon.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None;
LauncherWindow.launcherInstance.steamFramePanel.Navigate(new Uri("..\\SteamFramePages\\Login.xaml", UriKind.Relative));
usernameBox.Text = string.Empty;
Expand Down
4 changes: 2 additions & 2 deletions H1EmuLauncher/Windows/AddOrEditServerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void AddNewServer()
};
System.Windows.Shapes.Path pathEdit = new()
{
Data = Geometry.Parse(FindResource("EditIcon").ToString()),
Data = (PathGeometry)FindResource("EditIcon"),
Stretch = Stretch.Uniform
};
Binding bindingEdit = new("Foreground")
Expand All @@ -146,7 +146,7 @@ private void AddNewServer()
};
System.Windows.Shapes.Path pathDelete = new()
{
Data = Geometry.Parse(FindResource("BinIcon").ToString()),
Data = (PathGeometry)FindResource("BinIcon"),
Stretch = Stretch.Uniform
};
Binding bindingDelete = new("Foreground")
Expand Down
18 changes: 11 additions & 7 deletions H1EmuLauncher/Windows/LauncherWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ await Task.Run(() =>
else
SettingsWindow.SwitchToAccountKeyTab();
}
else if (string.Join(' ', rawArgs).Contains("-launchgame"))
{
playButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
}
}

private void ServerSelectorChanged(object sender, SelectionChangedEventArgs e)
Expand Down Expand Up @@ -212,7 +216,7 @@ private void LoadServers()
};
System.Windows.Shapes.Path pathH1EmuServersPlay = new()
{
Data = Geometry.Parse(FindResource("PlayIcon").ToString()),
Data = (PathGeometry)FindResource("PlayIcon"),
Stretch = Stretch.Uniform,
Width = 14,
Height = 14
Expand All @@ -239,7 +243,7 @@ private void LoadServers()
};
System.Windows.Shapes.Path pathSinglePlayerPlay = new()
{
Data = Geometry.Parse(FindResource("PlayIcon").ToString()),
Data = (PathGeometry)FindResource("PlayIcon"),
Stretch = Stretch.Uniform,
Width = 14,
Height = 14
Expand Down Expand Up @@ -272,7 +276,7 @@ private void LoadServers()
};
System.Windows.Shapes.Path pathExitNotifyIcon = new()
{
Data = Geometry.Parse(FindResource("ExitIcon").ToString()),
Data = (PathGeometry)FindResource("ExitIcon"),
Stretch = Stretch.Uniform,
Width = 14,
Height = 14,
Expand Down Expand Up @@ -305,7 +309,7 @@ private void LoadServers()
};
System.Windows.Shapes.Path pathCustomServerDelete = new()
{
Data = Geometry.Parse(FindResource("PlayIcon").ToString()),
Data = (PathGeometry)FindResource("PlayIcon"),
Stretch = Stretch.Uniform,
Width = 14,
Height = 14
Expand Down Expand Up @@ -373,7 +377,7 @@ private void LoadServers()
};
System.Windows.Shapes.Path pathCustom = new()
{
Data = Geometry.Parse(FindResource("EditIcon").ToString()),
Data = (PathGeometry)FindResource("EditIcon"),
Stretch = Stretch.Uniform
};
Binding bindingCustom = new("Foreground")
Expand All @@ -400,7 +404,7 @@ private void LoadServers()
};
System.Windows.Shapes.Path pathDeleteCustom = new()
{
Data = Geometry.Parse(FindResource("BinIcon").ToString()),
Data = (PathGeometry)FindResource("BinIcon"),
Stretch = Stretch.Uniform
};
Binding bindingDeleteCustom = new("Foreground")
Expand Down Expand Up @@ -560,7 +564,7 @@ private void AddServerToRecentList(string name)
};
System.Windows.Shapes.Path pathCustomServerPlay = new()
{
Data = Geometry.Parse(FindResource("PlayIcon").ToString()),
Data = (PathGeometry)FindResource("PlayIcon"),
Stretch = Stretch.Uniform,
Width = 14,
Height = 14
Expand Down
14 changes: 7 additions & 7 deletions H1EmuLauncherSetup/H1EmuLauncherSetup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,16 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:H1Emu Launcher"
"ProductCode" = "8:{9D73D8A0-128C-41B5-A726-02354F198B42}"
"PackageCode" = "8:{9A8EACA3-C79B-443D-A19A-00EF5674C2AD}"
"ProductCode" = "8:{B0B0D73F-52C6-4E2D-B45C-0B274A5E1FD5}"
"PackageCode" = "8:{8ED996B9-37EA-45AE-93CA-1E10C8B751C0}"
"UpgradeCode" = "8:{4E679270-65C8-4021-83BE-3B8EC3EC7AFE}"
"AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:3.2.2"
"Manufacturer" = "8:H1Emu © 2024"
"ProductVersion" = "8:3.2.3"
"Manufacturer" = "8:H1Emu"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:https://discord.com/invite/RM6jNkj"
"Title" = "8:H1Emu Launcher"
Expand Down Expand Up @@ -349,7 +349,7 @@
"Condition" = "8:"
"Transitive" = "11:FALSE"
"ValueTypes" = "3:1"
"Value" = "8:\"[TARGETDIR]H1EmuLauncher.exe\" \"%1\"\""
"Value" = "8:\"[TARGETDIR]H1Emu Launcher.exe\" \"%1\"\""
}
}
}
Expand Down Expand Up @@ -381,7 +381,7 @@
"Condition" = "8:"
"Transitive" = "11:FALSE"
"ValueTypes" = "3:1"
"Value" = "8:H1EmuLauncher.exe,1"
"Value" = "8:H1Emu Launcher.exe,1"
}
}
}
Expand All @@ -402,7 +402,7 @@
"Condition" = "8:"
"Transitive" = "11:FALSE"
"ValueTypes" = "3:1"
"Value" = "8:URL:H1EmuLauncher Protocol"
"Value" = "8:URL:H1Emu Launcher Protocol"
}
}
}
Expand Down

0 comments on commit fd3a34b

Please sign in to comment.