mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-18 16:41:36 -07:00
Only prompt channel change once during enrollment
This commit is contained in:
parent
8a4adaec3a
commit
7caa59ead3
@ -2,6 +2,7 @@
|
||||
{
|
||||
public class State
|
||||
{
|
||||
public string LastEnrolledChannel { get; set; } = "";
|
||||
public string VersionGuid { get; set; } = "";
|
||||
public List<string> ModManifest { get; set; } = new();
|
||||
}
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user