diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index c328e5b..9b4be55 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -274,13 +274,6 @@ namespace Bloxstrap SetStatus(Resources.Strings.Bootstrapper_Status_Starting); - if (_launchCommandLine == "--app" && App.Settings.Prop.UseDisableAppPatch) - { - Utilities.ShellExecute("https://www.roblox.com/games"); - Dialog?.CloseBootstrapper(); - return; - } - if (!File.Exists(Path.Combine(Paths.System, "mfplat.dll"))) { Frontend.ShowMessageBox( @@ -357,7 +350,7 @@ namespace Bloxstrap if (App.Settings.Prop.EnableActivityTracking) { - activityWatcher = new(); + activityWatcher = new(gameClientPid); shouldWait = true; App.NotifyIcon?.SetActivityWatcher(activityWatcher); @@ -1122,8 +1115,6 @@ namespace Bloxstrap if (!Directory.Exists(Paths.Modifications)) Directory.CreateDirectory(Paths.Modifications); - bool appDisabled = App.Settings.Prop.UseDisableAppPatch && !_launchCommandLine.Contains("--deeplink"); - // cursors await CheckModPreset(App.Settings.Prop.CursorType == CursorType.From2006, new Dictionary { @@ -1152,8 +1143,7 @@ namespace Bloxstrap }); // Mobile.rbxl - await CheckModPreset(appDisabled, @"ExtraContent\places\Mobile.rbxl", ""); - await CheckModPreset(App.Settings.Prop.UseOldAvatarBackground && !appDisabled, @"ExtraContent\places\Mobile.rbxl", "OldAvatarBackground.rbxl"); + await CheckModPreset(App.Settings.Prop.UseOldAvatarBackground, @"ExtraContent\places\Mobile.rbxl", "OldAvatarBackground.rbxl"); // emoji presets are downloaded remotely from github due to how large they are string contentFonts = Path.Combine(Paths.Modifications, "content\\fonts"); diff --git a/Bloxstrap/Integrations/ActivityWatcher.cs b/Bloxstrap/Integrations/ActivityWatcher.cs index ac0bea0..c654ffa 100644 --- a/Bloxstrap/Integrations/ActivityWatcher.cs +++ b/Bloxstrap/Integrations/ActivityWatcher.cs @@ -12,11 +12,13 @@ private const string GameDisconnectedEntry = "[FLog::Network] Time to disconnect replication data:"; private const string GameTeleportingEntry = "[FLog::SingleSurfaceApp] initiateTeleport"; private const string GameMessageEntry = "[FLog::Output] [BloxstrapRPC]"; + private const string GameLeavingEntry = "[FLog::SingleSurfaceApp] leaveUGCGameInternal"; private const string GameJoiningEntryPattern = @"! Joining game '([0-9a-f\-]{36})' place ([0-9]+) at ([0-9\.]+)"; private const string GameJoiningUDMUXPattern = @"UDMUX Address = ([0-9\.]+), Port = [0-9]+ \| RCC Server Address = ([0-9\.]+), Port = [0-9]+"; private const string GameJoinedEntryPattern = @"serverId: ([0-9\.]+)\|[0-9]+"; + private int _gameClientPid; private int _logEntriesRead = 0; private bool _teleportMarker = false; private bool _reservedTeleportMarker = false; @@ -43,6 +45,11 @@ public bool IsDisposed = false; + public ActivityWatcher(int gameClientPid) + { + _gameClientPid = gameClientPid; + } + public async void StartWatcher() { const string LOG_IDENT = "ActivityWatcher::StartWatcher"; @@ -207,7 +214,13 @@ } else if (ActivityInGame && ActivityPlaceId != 0) { - if (entry.Contains(GameDisconnectedEntry)) + if (App.Settings.Prop.UseDisableAppPatch && entry.Contains(GameLeavingEntry)) + { + App.Logger.WriteLine(LOG_IDENT, "Received desktop app exit, closing Roblox"); + using var process = Process.GetProcessById(_gameClientPid); + process.CloseMainWindow(); + } + else if (entry.Contains(GameDisconnectedEntry)) { App.Logger.WriteLine(LOG_IDENT, $"Disconnected from Game ({ActivityPlaceId}/{ActivityJobId}/{ActivityMachineAddress})"); diff --git a/Bloxstrap/LaunchSettings.cs b/Bloxstrap/LaunchSettings.cs index 16765fa..eed637d 100644 --- a/Bloxstrap/LaunchSettings.cs +++ b/Bloxstrap/LaunchSettings.cs @@ -86,11 +86,6 @@ namespace Bloxstrap } else if (arg.StartsWith("roblox:")) { - if (App.Settings.Prop.UseDisableAppPatch) - Frontend.ShowMessageBox( - Resources.Strings.Bootstrapper_DeeplinkTempEnabled, - MessageBoxImage.Information - ); RobloxLaunchArgs = $"--app --deeplink {arg}"; diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 9e16812..bb113a0 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -2448,6 +2448,24 @@ namespace Bloxstrap.Resources { } } + /// + /// Looks up a localized string similar to Roblox will fully close when you leave a game instead of dropping you back into the app.. + /// + public static string Menu_Integrations_DesktopApp_Description { + get { + return ResourceManager.GetString("Menu.Integrations.DesktopApp.Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Don't exit to desktop app. + /// + public static string Menu_Integrations_DesktopApp_Title { + get { + return ResourceManager.GetString("Menu.Integrations.DesktopApp.Title", resourceCulture); + } + } + /// /// Looks up a localized string similar to Allows for Bloxstrap to detect what Roblox game you're playing. Certain features may require this.. /// @@ -2637,24 +2655,6 @@ namespace Bloxstrap.Resources { } } - /// - /// Looks up a localized string similar to Stops the desktop app from showing, especially when you leave a game.. - /// - public static string Menu_Mods_Presets_DisableDesktopApp_Description { - get { - return ResourceManager.GetString("Menu.Mods.Presets.DisableDesktopApp.Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Disable desktop app. - /// - public static string Menu_Mods_Presets_DisableDesktopApp_Title { - get { - return ResourceManager.GetString("Menu.Mods.Presets.DisableDesktopApp.Title", resourceCulture); - } - } - /// /// Looks up a localized string similar to Choose which type of emoji should Roblox use.. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index 2122862..a44cdab 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -927,6 +927,12 @@ Selecting 'No' will ignore this warning and continue installation. Configure quick and easy ways to improve the Roblox gameplay experience. + + Roblox will fully close when you leave a game instead of dropping you back into the app. + + + Don't exit to desktop app + Allows for Bloxstrap to detect what Roblox game you're playing. Certain features may require this. @@ -991,12 +997,6 @@ Selecting 'No' will ignore this warning and continue installation. Open Mods Folder - - Stops the desktop app from showing, especially when you leave a game. - - - Disable desktop app - Choose which type of emoji should Roblox use. diff --git a/Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml index 8eb7665..0e74456 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml +++ b/Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml @@ -32,6 +32,13 @@ + + + + diff --git a/Bloxstrap/UI/Elements/Menu/Pages/ModsPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/ModsPage.xaml index 1236e37..f92b0e4 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/ModsPage.xaml +++ b/Bloxstrap/UI/Elements/Menu/Pages/ModsPage.xaml @@ -93,12 +93,6 @@ - - - - diff --git a/Bloxstrap/UI/ViewModels/Menu/IntegrationsViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/IntegrationsViewModel.cs index adff1bb..894aa7a 100644 --- a/Bloxstrap/UI/ViewModels/Menu/IntegrationsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Menu/IntegrationsViewModel.cs @@ -49,10 +49,12 @@ namespace Bloxstrap.UI.ViewModels.Menu if (!value) { ShowServerDetailsEnabled = value; + DisableAppPatchEnabled = value; DiscordActivityEnabled = value; DiscordActivityJoinEnabled = value; OnPropertyChanged(nameof(ShowServerDetailsEnabled)); + OnPropertyChanged(nameof(DisableAppPatchEnabled)); OnPropertyChanged(nameof(DiscordActivityEnabled)); OnPropertyChanged(nameof(DiscordActivityJoinEnabled)); } @@ -92,6 +94,12 @@ namespace Bloxstrap.UI.ViewModels.Menu set => App.Settings.Prop.MultiInstanceLaunching = value; } + public bool DisableAppPatchEnabled + { + get => App.Settings.Prop.UseDisableAppPatch; + set => App.Settings.Prop.UseDisableAppPatch = value; + } + public ObservableCollection CustomIntegrations { get => App.Settings.Prop.CustomIntegrations; diff --git a/Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs index a285d50..b342308 100644 --- a/Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs @@ -96,12 +96,6 @@ namespace Bloxstrap.UI.ViewModels.Menu set => App.Settings.Prop.UseOldAvatarBackground = value; } - public bool DisableAppPatchEnabled - { - get => App.Settings.Prop.UseDisableAppPatch; - set => App.Settings.Prop.UseDisableAppPatch = value; - } - public IReadOnlyCollection EmojiTypes => EmojiTypeEx.Selections; public EmojiType SelectedEmojiType