diff --git a/Bloxstrap/Models/State.cs b/Bloxstrap/Models/State.cs index 0e0a2e8..6f1d650 100644 --- a/Bloxstrap/Models/State.cs +++ b/Bloxstrap/Models/State.cs @@ -2,6 +2,7 @@ { public class State { + public string LastEnrolledChannel { get; set; } = ""; public string VersionGuid { get; set; } = ""; public List ModManifest { get; set; } = new(); } diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index 5d12b12..03c27f5 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -55,7 +55,7 @@ namespace Bloxstrap if (key == "channel" && !String.IsNullOrEmpty(val)) { channelArgPresent = true; - ChangeChannel(val); + EnrollChannel(val); // we'll set the arg when launching continue; @@ -65,7 +65,7 @@ namespace Bloxstrap } if (!channelArgPresent) - ChangeChannel(RobloxDeployment.DefaultChannel); + EnrollChannel(RobloxDeployment.DefaultChannel); return commandLine.ToString(); } @@ -80,9 +80,12 @@ namespace Bloxstrap if (App.Settings.Prop.ChannelChangeMode != ChannelChangeMode.Automatic) { + if (channel == App.State.Prop.LastEnrolledChannel) + return; + MessageBoxResult result = Controls.ShowMessageBox( $"Roblox is attempting to set your channel to {channel}, however your current preferred channel is {App.Settings.Prop.Channel}.\n\n" + - $"Would you like to switch channels from {App.Settings.Prop.Channel} to {channel}?", + $"Would you like to switch your preferred channel to {channel}?", MessageBoxImage.Question, MessageBoxButton.YesNo ); @@ -95,6 +98,13 @@ namespace Bloxstrap App.Settings.Prop.Channel = channel; } + public static void EnrollChannel(string channel) + { + ChangeChannel(channel); + App.State.Prop.LastEnrolledChannel = channel; + App.State.Save(); + } + public static void Register(string key, string name, string handler) { string handlerArgs = $"\"{handler}\" %1";