From d1343d35dc0831554576c83b97bf5eb00c794127 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Mon, 29 Jul 2024 19:29:39 +0100 Subject: [PATCH] Fix #2315 --- Bloxstrap/Resources/Strings.Designer.cs | 10 ++++++++++ Bloxstrap/Resources/Strings.resx | 3 +++ .../UI/Elements/ContextMenu/MenuContainer.xaml.cs | 13 +++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 77db067e..7b20e22a 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -1,6 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -556,6 +557,15 @@ public static string ContextMenu_OpenLogFile { } } + /// + /// Looks up a localized string similar to Roblox is still launching. A log file will only be available once Roblox launches.. + /// + public static string ContextMenu_RobloxNotRunning { + get { + return ResourceManager.GetString("ContextMenu.RobloxNotRunning", resourceCulture); + } + } + /// /// Looks up a localized string similar to See server details. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index c749c3df..fa1bdb3b 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -1024,4 +1024,7 @@ Selecting 'No' will ignore this warning and continue installation. The entry for '{0}' is not valid as the place filter is not formatted correctly. + + Roblox is still launching. A log file will only be available once Roblox launches. + \ No newline at end of file diff --git a/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs b/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs index dbbe2349..aec124a0 100644 --- a/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs +++ b/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs @@ -11,6 +11,7 @@ using Windows.Win32.UI.WindowsAndMessaging; using Bloxstrap.Integrations; +using Bloxstrap.Resources; namespace Bloxstrap.UI.Elements.ContextMenu { @@ -108,13 +109,21 @@ private void Window_Loaded(object? sender, RoutedEventArgs e) private void LogTracerMenuItem_Click(object sender, RoutedEventArgs e) { - Utilities.ShellExecute(_activityWatcher?.LogLocation!); + string? location = _activityWatcher?.LogLocation; + + if (location is null) + { + Frontend.ShowMessageBox(Strings.ContextMenu_RobloxNotRunning, MessageBoxImage.Information); + return; + } + + Utilities.ShellExecute(location); } private void CloseRobloxMenuItem_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = Frontend.ShowMessageBox( - Bloxstrap.Resources.Strings.ContextMenu_CloseRobloxMessage, + Strings.ContextMenu_CloseRobloxMessage, MessageBoxImage.Warning, MessageBoxButton.YesNo );