diff --git a/Bloxstrap/FastFlagManager.cs b/Bloxstrap/FastFlagManager.cs index b4c01e0..99b1f5d 100644 --- a/Bloxstrap/FastFlagManager.cs +++ b/Bloxstrap/FastFlagManager.cs @@ -17,13 +17,15 @@ namespace Bloxstrap public static IReadOnlyDictionary PresetFlags = new Dictionary { { "Network.Log", "FLogNetwork" }, - + +#if DEBUG { "HTTP.Log", "DFLogHttpTraceLight" }, { "HTTP.Proxy.Enable", "DFFlagDebugEnableHttpProxy" }, { "HTTP.Proxy.Address.1", "DFStringDebugPlayerHttpProxyUrl" }, { "HTTP.Proxy.Address.2", "DFStringHttpCurlProxyHostAndPort" }, { "HTTP.Proxy.Address.3", "DFStringHttpCurlProxyHostAndPortForExternalUrl" }, +#endif { "Rendering.Framerate", "DFIntTaskSchedulerTargetFps" }, { "Rendering.ManualFullscreen", "FFlagHandleAltEnterFullscreenManually" }, @@ -43,7 +45,9 @@ namespace Bloxstrap { "Rendering.Lighting.Future", "FFlagDebugForceFutureIsBrightPhase3" }, { "UI.Hide", "DFIntCanHideGuiGroupId" }, +#if DEBUG { "UI.FlagState", "FStringDebugShowFlagState" }, +#endif { "UI.Menu.GraphicsSlider", "FFlagFixGraphicsQuality" }, diff --git a/Bloxstrap/Integrations/ActivityWatcher.cs b/Bloxstrap/Integrations/ActivityWatcher.cs index c654ffa..431ab5b 100644 --- a/Bloxstrap/Integrations/ActivityWatcher.cs +++ b/Bloxstrap/Integrations/ActivityWatcher.cs @@ -65,11 +65,6 @@ // // we'll tail the log file continuously, monitoring for any log entries that we need to determine the current game activity - int delay = 1000; - - if (App.Settings.Prop.PowerTools) - delay = 250; - string logDirectory = Path.Combine(Paths.LocalAppData, "Roblox\\logs"); if (!Directory.Exists(logDirectory)) @@ -118,7 +113,7 @@ string? log = await sr.ReadLineAsync(); if (string.IsNullOrEmpty(log)) - logUpdatedEvent.WaitOne(delay); + logUpdatedEvent.WaitOne(1000); else ExamineLogEntry(log); } diff --git a/Bloxstrap/Models/Settings.cs b/Bloxstrap/Models/Settings.cs index a8f8469..79bac69 100644 --- a/Bloxstrap/Models/Settings.cs +++ b/Bloxstrap/Models/Settings.cs @@ -13,10 +13,6 @@ namespace Bloxstrap.Models public bool CheckForUpdates { get; set; } = true; public bool CreateDesktopIcon { get; set; } = true; - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] - [JsonPropertyName("OhHeyYouFoundMeAgain")] - public bool PowerTools { get; set; } = false; - // channel configuration public string Channel { get; set; } = RobloxDeployment.DefaultChannel; diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index bb113a0..549393e 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -505,56 +505,11 @@ namespace Bloxstrap.Resources { } /// - /// Looks up a localized string similar to Keep on top. + /// Looks up a localized string similar to Open log file. /// - public static string ContextMenu_LogTracer_KeepOnTop { + public static string ContextMenu_OpenLogFile { get { - return ResourceManager.GetString("ContextMenu.LogTracer.KeepOnTop", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scroll to end. - /// - public static string ContextMenu_LogTracer_ScrollToEnd { - get { - return ResourceManager.GetString("ContextMenu.LogTracer.ScrollToEnd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Text wrapping. - /// - public static string ContextMenu_LogTracer_TextWrapping { - get { - return ResourceManager.GetString("ContextMenu.LogTracer.TextWrapping", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Log tracer. - /// - public static string ContextMenu_LogTracer_Title { - get { - return ResourceManager.GetString("ContextMenu.LogTracer.Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tracing {0}. - /// - public static string ContextMenu_LogTracer_TracingFormat { - get { - return ResourceManager.GetString("ContextMenu.LogTracer.TracingFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Open log tracer. - /// - public static string ContextMenu_OpenLogTracer { - get { - return ResourceManager.GetString("ContextMenu.OpenLogTracer", resourceCulture); + return ResourceManager.GetString("ContextMenu.OpenLogFile", resourceCulture); } } diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index a44cdab..47c6b20 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -269,23 +269,8 @@ Your ReShade configuration files will still be saved, and you can locate them by Copy invite deeplink - - Keep on top - - - Scroll to end - - - Text wrapping - - - Log tracer - - - Tracing {0} - - - Open log tracer + + Open log file See server details diff --git a/Bloxstrap/UI/Elements/ContextMenu/LogTracer.xaml b/Bloxstrap/UI/Elements/ContextMenu/LogTracer.xaml deleted file mode 100644 index a140dd2..0000000 --- a/Bloxstrap/UI/Elements/ContextMenu/LogTracer.xaml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Bloxstrap/UI/Elements/ContextMenu/LogTracer.xaml.cs b/Bloxstrap/UI/Elements/ContextMenu/LogTracer.xaml.cs deleted file mode 100644 index f1cdc5a..0000000 --- a/Bloxstrap/UI/Elements/ContextMenu/LogTracer.xaml.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Windows; -using System.Windows.Controls; - -using Bloxstrap.Integrations; -using Bloxstrap.UI.ViewModels.ContextMenu; - -namespace Bloxstrap.UI.Elements.ContextMenu -{ - /// - /// Interaction logic for LogTracer.xaml - /// - public partial class LogTracer - { - private bool _autoscroll = true; - - public LogTracer(ActivityWatcher activityWatcher) - { - DataContext = new LogTracerViewModel(this, activityWatcher); - InitializeComponent(); - } - - private void KeepOnTopMenuItem_Click(object sender, RoutedEventArgs e) => Topmost = ((MenuItem)sender).IsChecked; - - private void AutoScrollMenuItem_Click(object sender, RoutedEventArgs e) => _autoscroll = ((MenuItem)sender).IsChecked; - - private void TextBox_TextChanged(object sender, TextChangedEventArgs e) - { - if (_autoscroll) - ScrollViewer.ScrollToEnd(); - } - } -} diff --git a/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml b/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml index c239fb0..1e094c6 100644 --- a/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml +++ b/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml @@ -73,7 +73,7 @@ - + diff --git a/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs b/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs index 30ee5f7..3ccc390 100644 --- a/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs +++ b/Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs @@ -24,7 +24,6 @@ namespace Bloxstrap.UI.Elements.ContextMenu private readonly ActivityWatcher? _activityWatcher; private readonly DiscordRichPresence? _richPresenceHandler; - private LogTracer? _logTracerWindow; private ServerInformation? _serverInformationWindow; private int? _processId; @@ -39,9 +38,10 @@ namespace Bloxstrap.UI.Elements.ContextMenu if (_activityWatcher is not null) { - if (App.Settings.Prop.PowerTools) - LogTracerMenuItem.Visibility = Visibility.Visible; - +#if DEBUG + LogTracerMenuItem.Visibility = Visibility.Visible; +#endif + _activityWatcher.OnGameJoin += ActivityWatcher_OnGameJoin; _activityWatcher.OnGameLeave += ActivityWatcher_OnGameLeave; } @@ -112,16 +112,7 @@ namespace Bloxstrap.UI.Elements.ContextMenu private void LogTracerMenuItem_Click(object sender, RoutedEventArgs e) { - if (_logTracerWindow is null) - { - _logTracerWindow = new LogTracer(_activityWatcher!); - _logTracerWindow.Closed += (_, _) => _logTracerWindow = null;; - } - - if (!_logTracerWindow.IsVisible) - _logTracerWindow.Show(); - - _logTracerWindow.Activate(); + Utilities.ShellExecute(_activityWatcher?.LogLocation); } private void CloseRobloxMenuItem_Click(object sender, RoutedEventArgs e) diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml index 44f1f63..ea97ffd 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml +++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml @@ -1,4 +1,5 @@ - new RelayCommand(_window.Close); - public ICommand LocateLogFileCommand => new RelayCommand(LocateLogFile); - - public string LogFilename => Path.GetFileName(_activityWatcher.LogLocation); - public string LogContents { get; private set; } = ""; - - public LogTracerViewModel(Window window, ActivityWatcher activityWatcher) - { - _window = window; - _activityWatcher = activityWatcher; - - _activityWatcher.OnLogEntry += (_, message) => - { - LogContents += $"{_lineNumber}: {message}\r\n"; - OnPropertyChanged(nameof(LogContents)); - - _lineNumber += 1; - }; - } - - private void LocateLogFile() => Process.Start("explorer.exe", $"/select,\"{_activityWatcher.LogLocation}\""); - } -} diff --git a/Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs index fc75118..ee7b4c4 100644 --- a/Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs @@ -28,7 +28,11 @@ namespace Bloxstrap.UI.ViewModels.Menu public ICommand OpenFastFlagEditorCommand => new RelayCommand(OpenFastFlagEditor); - public Visibility ShowDebugFlags => App.Settings.Prop.PowerTools ? Visibility.Visible : Visibility.Collapsed; +#if DEBUG + public Visibility ShowDebugFlags => Visibility.Visible; +#else + public Visibility ShowDebugFlags => Visibility.Collapsed; +#endif public bool HttpRequestLogging {