Skip to content

Commit

Permalink
remove test mode warning after 1st use, save last opened page
Browse files Browse the repository at this point in the history
  • Loading branch information
returnrqt committed Dec 30, 2024
2 parents 962fec9 + 4da4641 commit d51fd81
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 36 deletions.
6 changes: 3 additions & 3 deletions Bloxstrap/Bloxstrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<UseWPF>true</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
<Version>2.8.4.6</Version>
<FileVersion>2.8.4.6</FileVersion>
<Version>2.8.5.6</Version>
<FileVersion>2.8.5.6</FileVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
Expand Down Expand Up @@ -137,4 +137,4 @@
</None>
</ItemGroup>

</Project>
</Project>
11 changes: 10 additions & 1 deletion Bloxstrap/Installer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ namespace Bloxstrap
{
internal class Installer
{
/// <summary>
/// Should this version automatically open the release notes page?
/// Recommended for major updates only.
/// </summary>
private const bool OpenReleaseNotes = false;

private static string DesktopShortcut => Path.Combine(Paths.Desktop, $"{App.ProjectName}.lnk");

private static string StartMenuShortcut => Path.Combine(Paths.WindowsStartMenu, $"{App.ProjectName}.lnk");
Expand Down Expand Up @@ -601,7 +607,10 @@ public static void HandleUpgrade()

if (isAutoUpgrade)
{
Utilities.ShellExecute($"https://github.com/{App.ProjectRepository}/wiki/Release-notes-for-Bloxstrap-v{currentVer}");
#pragma warning disable CS0162 // Unreachable code detected
if (OpenReleaseNotes)
Utilities.ShellExecute($"https://github.com/{App.ProjectRepository}/wiki/Release-notes-for-Bloxstrap-v{currentVer}");
#pragma warning restore CS0162 // Unreachable code detected
}
else
{
Expand Down
5 changes: 5 additions & 0 deletions Bloxstrap/Models/Persistable/State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
{
public class State
{
public bool TestModeWarningShown { get; set; } = false;

public bool IgnoreOutdatedChannel { get; set; } = false;

public bool WatcherRunning { get; set; } = false;

public bool PromptWebView2Install { get; set; } = true;

public int LastPage { get; set; } = 0;

public AppState Player { get; set; } = new();

public AppState Studio { get; set; } = new();
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/Resources/Strings.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1264,9 +1264,9 @@ Voulez-vous activer le mode test ?</value>
<value>Version {0}</value>
</data>
<data name="Bootstrapper.FilesInUse" xml:space="preserve">
<value>Bloxstrap a tenté de mettre Roblox à jour mais a échoué car des fichiers de Roblox sont ouverts.
<value>Bloxstrap a tenté de mettre Roblox à jour mais a échoué car des fichiers de Roblox sont utilisés.

Veuillez fermer toute application pouvant utiliser des fichiers de Roblox, et relancez.</value>
Veuillez fermer toute application pouvant utiliser les fichiers de Roblox, et relancez.</value>
<comment>This is *not* for when Roblox is still running when trying to upgrade. This applies to files being open (i.e. image assets)</comment>
</data>
<data name="FileTypes.ZipArchive" xml:space="preserve">
Expand Down
35 changes: 11 additions & 24 deletions Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@
</Grid.ColumnDefinitions>

<StackPanel Grid.Column="0">
<!--<TextBlock Text="Bahasa Indonesia" FontSize="16" FontWeight="Medium">
<TextBlock.Foreground>
<SolidColorBrush Color="{DynamicResource SystemAccentColorSecondary}" />
</TextBlock.Foreground>
</TextBlock>
<TextBlock Text="AriaP" />
<TextBlock Text="e7leopard" />
<TextBlock Text="hfzrk" />
<TextBlock Text="nabbyowo" />
<TextBlock Text="Nayottamaa" />
<TextBlock Text="niluhfitriani4" />
<TextBlock Text="SenZore" />
<TextBlock Text="soudblox" />-->

<!--<TextBlock Text="Bokmål" FontSize="16" FontWeight="Medium" Margin="0,16,0,0">
<TextBlock.Foreground>
<SolidColorBrush Color="{DynamicResource SystemAccentColorSecondary}" />
Expand Down Expand Up @@ -230,16 +216,6 @@
<TextBlock Text="Elotomka" />
<TextBlock Text="xM4rk1" />

<!--<TextBlock Text="Nederlands" FontSize="16" FontWeight="Medium" Margin="0,16,0,0">
<TextBlock.Foreground>
<SolidColorBrush Color="{DynamicResource SystemAccentColorSecondary}" />
</TextBlock.Foreground>
</TextBlock>
<TextBlock Text="Cosmix" />
<TextBlock Text="Miwwzy" />
<TextBlock Text="Quickvision1" />
<TextBlock Text="ydboss" />-->

<TextBlock Text="Polski" FontSize="16" FontWeight="Medium" Margin="0,16,0,0">
<TextBlock.Foreground>
<SolidColorBrush Color="{DynamicResource SystemAccentColorSecondary}" />
Expand Down Expand Up @@ -601,6 +577,17 @@
<TextBlock Text="yuzegh" />
<TextBlock Text="Ardaniho" />
<TextBlock Text="LeventGameing" />

<TextBlock Text="Malay" FontSize="16" FontWeight="Medium" Margin="0,16,0,0">
<TextBlock.Foreground>
<SolidColorBrush Color="{DynamicResource SystemAccentColorSecondary}" />
</TextBlock.Foreground>
</TextBlock>
<TextBlock Text="so1ehee" />
<TextBlock Text="Suchan96" />
<TextBlock Text="ShdyDayz" />
<TextBlock Text="cyanpyxl" />
<TextBlock Text="CormacZ" />
</StackPanel>
</Grid>
</StackPanel>
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/UI/Elements/Settings/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
Title="{x:Static resources:Strings.Menu_AlreadyRunning_Title}"
Message="{x:Static resources:Strings.Menu_AlreadyRunning_Caption}"
Icon="Info20" Timeout="10000" Margin="200,0,200,20" Grid.RowSpan="10" Panel.ZIndex="10" />

<ui:Snackbar
x:Name="SettingsSavedSnackbar"
Title="{x:Static resources:Strings.Menu_SettingsSaved_Title}"
Expand Down Expand Up @@ -115,4 +115,4 @@
</StatusBarItem>
</StatusBar>
</Grid>
</base:WpfUiWindow>
</base:WpfUiWindow>
18 changes: 15 additions & 3 deletions Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Wpf.Ui.Mvvm.Contracts;

using Bloxstrap.UI.ViewModels.Settings;
using Wpf.Ui.Common;

namespace Bloxstrap.UI.Elements.Settings
{
Expand All @@ -24,7 +25,7 @@ public MainWindow(bool showAlreadyRunningWarning)
viewModel.RequestCloseWindowEvent += (_, _) => Close();

DataContext = viewModel;

InitializeComponent();

App.Logger.WriteLine("MainWindow", "Initializing settings window");
Expand All @@ -33,6 +34,17 @@ public MainWindow(bool showAlreadyRunningWarning)
ShowAlreadyRunningSnackbar();

LoadState();

int LastPage = App.State.Prop.LastPage;

RootNavigation.SelectedPageIndex = LastPage;

RootNavigation.Navigated += SaveNavigation;

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

Check warning on line 42 in Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)' doesn't match the target delegate 'RoutedNavigationEvent' (possibly because of nullability attributes).

void SaveNavigation(INavigation? sender, RoutedNavigationEventArgs? e)
{
App.State.Prop.LastPage = RootNavigation.SelectedPageIndex;
}
}

public void LoadState()
Expand Down Expand Up @@ -88,7 +100,7 @@ private void WpfUiWindow_Closing(object sender, CancelEventArgs e)
if (result != MessageBoxResult.Yes)
e.Cancel = true;
}

_state.Width = this.Width;
_state.Height = this.Height;

Expand All @@ -106,4 +118,4 @@ private void WpfUiWindow_Closed(object sender, EventArgs e)
App.SoftTerminate();
}
}
}
}
4 changes: 3 additions & 1 deletion Bloxstrap/UI/ViewModels/Settings/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ public bool TestModeEnabled
get => App.LaunchSettings.TestModeFlag.Active;
set
{
if (value)
if (value && !App.State.Prop.TestModeWarningShown)
{
var result = Frontend.ShowMessageBox(Strings.Menu_TestMode_Prompt, MessageBoxImage.Information, MessageBoxButton.YesNo);

if (result != MessageBoxResult.Yes)
return;

App.State.Prop.TestModeWarningShown = true;
}

App.LaunchSettings.TestModeFlag.Active = value;
Expand Down

0 comments on commit d51fd81

Please sign in to comment.