Default to LIVE if no launch channel set

also fixed a bug with the font mod
This commit is contained in:
pizzaboxer 2023-07-15 12:59:18 +01:00
parent 63ef907246
commit 78869e5e7e
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
3 changed files with 36 additions and 21 deletions

View File

@ -1069,7 +1069,7 @@ namespace Bloxstrap
App.Logger.WriteLine("[Bootstrapper::ApplyModifications] End font check");
}
else
else if (Directory.Exists(modFontFamiliesFolder))
{
Directory.Delete(modFontFamiliesFolder, true);
}

View File

@ -32,6 +32,8 @@ namespace Bloxstrap
string[] keyvalPair;
string key;
string val;
bool channelArgPresent = false;
StringBuilder commandLine = new();
foreach (var parameter in protocol.Split('+'))
@ -56,25 +58,10 @@ namespace Bloxstrap
if (key == "launchtime")
val = "LAUNCHTIMEPLACEHOLDER";
if (key == "channel")
if (key == "channel" && !String.IsNullOrEmpty(val))
{
if (val.ToLowerInvariant() != App.Settings.Prop.Channel.ToLowerInvariant() && App.Settings.Prop.ChannelChangeMode != ChannelChangeMode.Ignore)
{
MessageBoxResult result = App.Settings.Prop.ChannelChangeMode == ChannelChangeMode.Automatic
? MessageBoxResult.Yes
: Controls.ShowMessageBox(
$"Roblox is attempting to set your channel to {val}, however your current preferred channel is {App.Settings.Prop.Channel}.\n\n" +
$"Would you like to switch channels from {App.Settings.Prop.Channel} to {val}?",
MessageBoxImage.Question,
MessageBoxButton.YesNo
);
if (result == MessageBoxResult.Yes)
{
App.Logger.WriteLine($"[Protocol::ParseUri] Changed Roblox build channel from {App.Settings.Prop.Channel} to {val}");
App.Settings.Prop.Channel = val;
}
}
channelArgPresent = true;
ChangeChannel(val);
// we'll set the arg when launching
continue;
@ -83,9 +70,37 @@ namespace Bloxstrap
commandLine.Append(UriKeyArgMap[key] + val + " ");
}
if (!channelArgPresent)
ChangeChannel(RobloxDeployment.DefaultChannel);
return commandLine.ToString();
}
public static void ChangeChannel(string channel)
{
if (channel.ToLowerInvariant() == App.Settings.Prop.Channel.ToLowerInvariant())
return;
if (App.Settings.Prop.ChannelChangeMode == ChannelChangeMode.Ignore)
return;
if (App.Settings.Prop.ChannelChangeMode != ChannelChangeMode.Automatic)
{
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}?",
MessageBoxImage.Question,
MessageBoxButton.YesNo
);
if (result != MessageBoxResult.Yes)
return;
}
App.Logger.WriteLine($"[Protocol::ParseUri] Changed Roblox build channel from {App.Settings.Prop.Channel} to {channel}");
App.Settings.Prop.Channel = channel;
}
public static void Register(string key, string name, string handler)
{
string handlerArgs = $"\"{handler}\" %1";

View File

@ -39,8 +39,8 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock FontSize="14" Text="Deployment channel" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Choose which release channel Roblox should be downloaded from." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
<TextBlock FontSize="14" Text="Channel" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Choose which deployment channel Roblox should be downloaded from." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel>
<ComboBox Grid.Column="1" Margin="8,0,8,0" Padding="10,5,10,5" Width="200" IsEditable="True" ItemsSource="{Binding Channels, Mode=OneWay}" Text="{Binding SelectedChannel, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" KeyUp="ComboBox_KeyEnterUpdate" />
</Grid>