diff --git a/Bloxstrap/Models/State.cs b/Bloxstrap/Models/State.cs index 5c22be6..9273be6 100644 --- a/Bloxstrap/Models/State.cs +++ b/Bloxstrap/Models/State.cs @@ -3,6 +3,7 @@ public class State { public string LastEnrolledChannel { get; set; } = ""; + public bool ShowFFlagEditorWarning { get; set; } = true; [Obsolete("Use PlayerVersionGuid instead", true)] public string VersionGuid { set { PlayerVersionGuid = value; } } diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 549393e..e5e2ae9 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -468,6 +468,15 @@ namespace Bloxstrap.Resources { } } + /// + /// Looks up a localized string similar to Warning. + /// + public static string Common_Warning { + get { + return ResourceManager.GetString("Common.Warning", resourceCulture); + } + } + /// /// Looks up a localized string similar to Yes. /// @@ -1813,7 +1822,7 @@ namespace Bloxstrap.Resources { } /// - /// Looks up a localized string similar to Manage your own FastFlags. Double click a column to edit.. + /// Looks up a localized string similar to Manage your own FastFlags. Use with caution. Double click a column to edit.. /// public static string Menu_FastFlagEditor_Description { get { @@ -1866,6 +1875,44 @@ namespace Bloxstrap.Resources { } } + /// + /// Looks up a localized string similar to Go back. + /// + public static string Menu_FastFlagEditor_Warning_Back { + get { + return ResourceManager.GetString("Menu.FastFlagEditor.Warning.Back", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to I know what I'm doing. + /// + public static string Menu_FastFlagEditor_Warning_Continue { + get { + return ResourceManager.GetString("Menu.FastFlagEditor.Warning.Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Do you know what you are doing?. + /// + public static string Menu_FastFlagEditor_Warning_Header { + get { + return ResourceManager.GetString("Menu.FastFlagEditor.Warning.Header", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fast Flags are extremely powerful, being that they are intended to only be used by Roblox engineers. While they can be very useful, manually configuring them can cause serious issues with stability and functionality. Do NOT use the editor if you are unsure of what you are doing. + /// + ///Do NOT use this to import large "flag lists" made by other people that promise to improve performance or such. They are subject to the aforementioned issues, and they will cause problems for you since you will not be fully aware [rest of string was truncated]";. + /// + public static string Menu_FastFlagEditor_Warning_Text { + get { + return ResourceManager.GetString("Menu.FastFlagEditor.Warning.Text", resourceCulture); + } + } + /// /// Looks up a localized string similar to Control how specific Roblox engine parameters and features are configured.. /// @@ -1876,7 +1923,7 @@ namespace Bloxstrap.Resources { } /// - /// Looks up a localized string similar to Manage your own FastFlags.. + /// Looks up a localized string similar to Manage your own Fast Flags. Use with caution.. /// public static string Menu_FastFlags_Editor_Description { get { @@ -1885,7 +1932,7 @@ namespace Bloxstrap.Resources { } /// - /// Looks up a localized string similar to Learn more about FastFlags.. + /// Looks up a localized string similar to Learn more about Fast Flags, what these presets do, and how to use them.. /// public static string Menu_FastFlags_Help_Description { get { diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index 47c6b20..e5da224 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -257,6 +257,9 @@ Your ReShade configuration files will still be saved, and you can locate them by Value + + Warning + Yes @@ -708,7 +711,7 @@ Would you like to upgrade your currently installed version? Delete selected - Manage your own FastFlags. Double click a column to edit. + Manage your own FastFlags. Use with caution. Double click a column to edit. Export JSON @@ -725,15 +728,29 @@ Would you like to upgrade your currently installed version? Fast Flag Editor + + Go back + + + I know what I'm doing + + + Do you know what you are doing? + + + Fast Flags are extremely powerful, being that they are intended to only be used by Roblox engineers. While they can be very useful, manually configuring them can cause serious issues with stability and functionality. Do NOT use the editor if you are unsure of what you are doing. + +Do NOT use this to import large "flag lists" made by other people that promise to improve performance or such. They are subject to the aforementioned issues, and they will cause problems for you since you will not be fully aware of what they are changing. If you were about to do that, GO BACK. + Control how specific Roblox engine parameters and features are configured. - Manage your own FastFlags. + Manage your own Fast Flags. Use with caution. Title is Menu.FastFlagEditor.Title - Learn more about FastFlags. + Learn more about Fast Flags, what these presets do, and how to use them. Title is Common.Help diff --git a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml index cb3fd87..f809762 100644 --- a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml +++ b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml @@ -59,6 +59,7 @@ + diff --git a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs index 4f317fc..3643407 100644 --- a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs +++ b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs @@ -21,6 +21,7 @@ namespace Bloxstrap.UI.Elements.Menu #if DEBUG // easier access PreInstallNavItem.Visibility = System.Windows.Visibility.Visible; + EditorWarningNavItem.Visibility = System.Windows.Visibility.Visible; #endif if (showAlreadyRunningWarning) diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml index ea97ffd..44f1f63 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml +++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml @@ -1,5 +1,4 @@ - - + + + + + + + + + + + + \ No newline at end of file diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorWarningPage.xaml.cs b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorWarningPage.xaml.cs new file mode 100644 index 0000000..7576f34 --- /dev/null +++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorWarningPage.xaml.cs @@ -0,0 +1,32 @@ +using Bloxstrap.UI.ViewModels.Menu; +using System.Windows; + +namespace Bloxstrap.UI.Elements.Menu.Pages +{ + /// + /// Interaction logic for FastFlagEditorWarningPage.xaml + /// + public partial class FastFlagEditorWarningPage + { + private bool _initialLoad = false; + + public FastFlagEditorWarningPage() + { + DataContext = new FastFlagEditorWarningViewModel(this); + InitializeComponent(); + } + + private void Page_Loaded(object sender, RoutedEventArgs e) + { + // refresh datacontext on page load to reset timer + + if (!_initialLoad) + { + _initialLoad = true; + return; + } + + DataContext = new FastFlagEditorWarningViewModel(this); + } + } +} diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml index ca35943..ca9afd8 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml +++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml @@ -15,28 +15,14 @@ - - - - - + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml index e22c336..32d1ecc 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml +++ b/Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml @@ -57,8 +57,6 @@ - - diff --git a/Bloxstrap/UI/ViewModels/Menu/FastFlagEditorWarningViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/FastFlagEditorWarningViewModel.cs new file mode 100644 index 0000000..552c5c0 --- /dev/null +++ b/Bloxstrap/UI/ViewModels/Menu/FastFlagEditorWarningViewModel.cs @@ -0,0 +1,65 @@ +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; + +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Mvvm.Contracts; + +using Bloxstrap.UI.Elements.Menu.Pages; + +namespace Bloxstrap.UI.ViewModels.Menu +{ + internal class FastFlagEditorWarningViewModel : NotifyPropertyChangedViewModel + { + private Page _page; + + public string ContinueButtonText { get; set; } = ""; + + public bool CanContinue { get; set; } = false; + + public ICommand GoBackCommand => new RelayCommand(GoBack); + + public ICommand ContinueCommand => new RelayCommand(Continue); + + public FastFlagEditorWarningViewModel(Page page) + { + _page = page; + DoCountdown(); + } + + private async void DoCountdown() + { + for (int i = 10; i > 0; i--) + { + ContinueButtonText = $"({i}) {Resources.Strings.Menu_FastFlagEditor_Warning_Continue}"; + OnPropertyChanged(nameof(ContinueButtonText)); + + await Task.Delay(1000); + } + + ContinueButtonText = Resources.Strings.Menu_FastFlagEditor_Warning_Continue; + OnPropertyChanged(nameof(ContinueButtonText)); + + CanContinue = true; + OnPropertyChanged(nameof(CanContinue)); + + App.State.Prop.ShowFFlagEditorWarning = false; + App.State.Save(); + } + + private void Continue() + { + if (!CanContinue) + return; + + if (Window.GetWindow(_page) is INavigationWindow window) + window.Navigate(typeof(FastFlagEditorPage)); + } + + private void GoBack() + { + if (Window.GetWindow(_page) is INavigationWindow window) + window.Navigate(typeof(FastFlagsPage)); + } + } +} \ No newline at end of file diff --git a/Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs index ee7b4c4..325fd0e 100644 --- a/Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs @@ -23,7 +23,12 @@ namespace Bloxstrap.UI.ViewModels.Menu private void OpenFastFlagEditor() { if (Window.GetWindow(_page) is INavigationWindow window) - window.Navigate(typeof(FastFlagEditorPage)); + { + if (App.State.Prop.ShowFFlagEditorWarning) + window.Navigate(typeof(FastFlagEditorWarningPage)); + else + window.Navigate(typeof(FastFlagEditorPage)); + } } public ICommand OpenFastFlagEditorCommand => new RelayCommand(OpenFastFlagEditor);