Skip to content

Commit 43555d7

Browse files
committed
Merge branch 'version-2.2.0'
2 parents 61b2c4b + 89e76ef commit 43555d7

26 files changed

+610
-627
lines changed

Bloxstrap/App.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:local="clr-namespace:Bloxstrap"
55
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
6-
ShutdownMode="OnExplicitShutdown">
6+
ShutdownMode="OnExplicitShutdown"
7+
DispatcherUnhandledException="GlobalExceptionHandler">
78
<Application.Resources>
89
<ResourceDictionary>
910
<ResourceDictionary.MergedDictionaries>

Bloxstrap/App.xaml.cs

Lines changed: 140 additions & 136 deletions
Large diffs are not rendered by default.

Bloxstrap/Bloxstrap.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<UseWPF>true</UseWPF>
88
<UseWindowsForms>True</UseWindowsForms>
99
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
10-
<Version>2.1.1</Version>
11-
<FileVersion>2.1.1.0</FileVersion>
10+
<Version>2.2.0</Version>
11+
<FileVersion>2.2.0.0</FileVersion>
1212
<ApplicationManifest>app.manifest</ApplicationManifest>
1313
</PropertyGroup>
1414

Bloxstrap/Bootstrapper.cs

Lines changed: 171 additions & 178 deletions
Large diffs are not rendered by default.

Bloxstrap/Helpers/DeployManager.cs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,43 +76,25 @@ public string BaseUrl
7676
}
7777
}
7878

79-
// basically any channel that has had a deploy within the past month with a windowsplayer build
80-
public static readonly List<string> ChannelsAbstracted = new()
79+
// most commonly used/interesting channels
80+
public static readonly List<string> SelectableChannels = new()
8181
{
8282
"LIVE",
83+
"ZWinPlayer64",
84+
"ZFlag",
8385
"ZNext",
8486
"ZCanary",
85-
"ZIntegration"
86-
};
87-
88-
// why not?
89-
public static readonly List<string> ChannelsAll = new()
90-
{
91-
"LIVE",
92-
"ZAvatarTeam",
93-
"ZAvatarRelease",
94-
"ZCanary",
95-
"ZCanary1",
96-
"ZCanary2",
97-
"ZCanary3",
98-
"ZCanaryApps",
99-
"ZFlag",
10087
"ZIntegration",
101-
"ZIntegration1",
102-
"ZLive",
103-
"ZLive1",
104-
"ZNext",
105-
"ZSocialTeam",
106-
"ZStudioInt1",
107-
"ZStudioInt2"
88+
"ZAvatarTeam",
89+
"ZSocialTeam"
10890
};
10991
#endregion
11092

11193
public async Task<ClientVersion> GetLastDeploy(bool timestamp = false)
11294
{
11395
App.Logger.WriteLine($"[DeployManager::GetLastDeploy] Getting deploy info for channel {Channel} (timestamp={timestamp})");
11496

115-
HttpResponseMessage deployInfoResponse = await App.HttpClient.GetAsync($"https://clientsettings.roblox.com/v2/client-version/WindowsPlayer/channel/{Channel}");
97+
HttpResponseMessage deployInfoResponse = await App.HttpClient.GetAsync($"https://clientsettings.roblox.com/v2/client-version/WindowsPlayer/channel/{Channel}").ConfigureAwait(false);
11698

11799
string rawResponse = await deployInfoResponse.Content.ReadAsStringAsync();
118100

Bloxstrap/Helpers/FastFlagManager.cs

Lines changed: 77 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Newtonsoft.Json.Linq;
2+
using System;
23
using System.Collections.Generic;
34
using System.IO;
45
using System.Text.Json;
@@ -15,18 +16,71 @@ public class FastFlagManager : JsonManager<Dictionary<string, object>>
1516
public Dictionary<string, object?> Changes = new();
1617

1718
// only one missing here is Metal because lol
18-
public static IReadOnlyDictionary<string, string> RenderingModes { get; set; } = new Dictionary<string, string>()
19+
public static IReadOnlyDictionary<string, string> RenderingModes => new Dictionary<string, string>
1920
{
2021
{ "Automatic", "" },
2122
{ "Direct3D 11", "FFlagDebugGraphicsPreferD3D11" },
2223
{ "OpenGL", "FFlagDebugGraphicsPreferOpenGL" },
2324
{ "Vulkan", "FFlagDebugGraphicsPreferVulkan" }
2425
};
2526

27+
// this is one hell of a variable definition lmao
28+
public static IReadOnlyDictionary<string, Dictionary<string, string?>> IGMenuVersions => new Dictionary<string, Dictionary<string, string?>>
29+
{
30+
{
31+
"Default",
32+
new Dictionary<string, string?>
33+
{
34+
{ "FFlagDisableNewIGMinDUA", null },
35+
{ "FFlagEnableInGameMenuV3", null }
36+
}
37+
},
38+
39+
{
40+
"Version 1 (2015)",
41+
new Dictionary<string, string?>
42+
{
43+
{ "FFlagDisableNewIGMinDUA", "True" },
44+
{ "FFlagEnableInGameMenuV3", "False" }
45+
}
46+
},
47+
48+
{
49+
"Version 2 (2020)",
50+
new Dictionary<string, string?>
51+
{
52+
{ "FFlagDisableNewIGMinDUA", "False" },
53+
{ "FFlagEnableInGameMenuV3", "False" }
54+
}
55+
},
56+
57+
{
58+
"Version 3 (2021)",
59+
new Dictionary<string, string?>
60+
{
61+
{ "FFlagDisableNewIGMinDUA", "False" },
62+
{ "FFlagEnableInGameMenuV3", "True" }
63+
}
64+
}
65+
};
66+
67+
// all fflags are stored as strings
68+
// to delete a flag, set the value as null
69+
public void SetValue(string key, object? value)
70+
{
71+
if (value is null)
72+
{
73+
Changes[key] = null;
74+
App.Logger.WriteLine($"[FastFlagManager::SetValue] Deletion of '{key}' is pending");
75+
}
76+
else
77+
{
78+
Changes[key] = value.ToString();
79+
App.Logger.WriteLine($"[FastFlagManager::SetValue] Value change for '{key}' to '{value}' is pending");
80+
}
81+
}
82+
2683
// this returns null if the fflag doesn't exist
27-
// this also returns as a string because deserializing an object doesn't
28-
// deserialize back into the original object type, it instead deserializes
29-
// as a "JsonElement" which is annoying
3084
public string? GetValue(string key)
3185
{
3286
// check if we have an updated change for it pushed first
@@ -44,26 +98,39 @@ public void SetRenderingMode(string value)
4498
foreach (var mode in RenderingModes)
4599
{
46100
if (mode.Key != "Automatic")
47-
App.FastFlags.Changes[mode.Value] = null;
101+
SetValue(mode.Value, null);
48102
}
49103

50104
if (value != "Automatic")
51-
App.FastFlags.Changes[RenderingModes[value]] = true;
105+
SetValue(RenderingModes[value], "True");
106+
}
107+
108+
public override void Load()
109+
{
110+
base.Load();
111+
112+
// set to 9999 by default if it doesnt already exist
113+
if (GetValue("DFIntTaskSchedulerTargetFps") is null)
114+
SetValue("DFIntTaskSchedulerTargetFps", 9999);
115+
116+
// reshade / exclusive fullscreen requires direct3d 11 to work
117+
if (GetValue(RenderingModes["Direct3D 11"]) != "True" && (App.Settings.Prop.UseReShade || App.FastFlags.GetValue("FFlagHandleAltEnterFullscreenManually") == "False"))
118+
SetRenderingMode("Direct3D 11");
52119
}
53120

54121
public override void Save()
55122
{
56123
App.Logger.WriteLine($"[FastFlagManager::Save] Attempting to save JSON to {FileLocation}...");
57124

125+
// reload for any changes made while the menu was open
126+
Load();
127+
58128
if (Changes.Count == 0)
59129
{
60130
App.Logger.WriteLine($"[FastFlagManager::Save] No changes to apply, aborting.");
61131
return;
62132
}
63133

64-
// reload for any changes made while the menu was open
65-
Load();
66-
67134
foreach (var change in Changes)
68135
{
69136
if (change.Value is null)
@@ -73,7 +140,7 @@ public override void Save()
73140
continue;
74141
}
75142

76-
App.Logger.WriteLine($"[FastFlagManager::Save] Setting '{change.Key}' to {change.Value}");
143+
App.Logger.WriteLine($"[FastFlagManager::Save] Setting '{change.Key}' to '{change.Value}'");
77144
Prop[change.Key] = change.Value;
78145
}
79146

Bloxstrap/Helpers/JsonManager.cs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
using Bloxstrap.Models;
2-
using Bloxstrap.Properties;
3-
using Newtonsoft.Json.Linq;
4-
using System;
5-
using System.Collections.Generic;
6-
using System.Diagnostics;
1+
using System;
72
using System.IO;
8-
using System.Linq;
9-
using System.Text;
10-
using System.Threading.Tasks;
113
using System.Text.Json;
12-
using System.Threading;
134

145
namespace Bloxstrap.Helpers
156
{
167
public class JsonManager<T> where T : new()
178
{
189
public T Prop { get; set; } = new();
19-
public virtual string FileLocation => AltFileLocation ?? Path.Combine(Directories.Base, $"{typeof(T).Name}.json");
20-
public string? AltFileLocation { get; set; }
10+
public virtual string FileLocation => Path.Combine(Directories.Base, $"{typeof(T).Name}.json");
2111

22-
public void Load()
12+
public virtual void Load()
2313
{
2414
App.Logger.WriteLine($"[JsonManager<{typeof(T).Name}>::Load] Loading JSON from {FileLocation}...");
2515

2616
try
2717
{
2818
T? settings = JsonSerializer.Deserialize<T>(File.ReadAllText(FileLocation));
29-
Prop = settings ?? throw new ArgumentNullException("Deserialization returned null");
19+
20+
if (settings is null)
21+
throw new ArgumentNullException("Deserialization returned null");
22+
23+
Prop = settings;
24+
3025
App.Logger.WriteLine($"[JsonManager<{typeof(T).Name}>::Load] JSON loaded successfully!");
3126
}
3227
catch (Exception ex)

Bloxstrap/Helpers/Protocol.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class Protocol
1818
{ "launchmode", "--" },
1919
{ "gameinfo", "-t " },
2020
{ "placelauncherurl", "-j "},
21-
// { "launchtime", "--launchtime=" }, we'll set this when launching the game client
21+
{ "launchtime", "--launchtime=" },
2222
{ "browsertrackerid", "-b " },
2323
{ "robloxLocale", "--rloc " },
2424
{ "gameLocale", "--gloc " },
@@ -50,6 +50,10 @@ public static string ParseUri(string protocol)
5050
if (key == "placelauncherurl")
5151
val = HttpUtility.UrlDecode(val);
5252

53+
// we'll set this before launching because for some reason roblox just refuses to launch if its like a few minutes old so ???
54+
if (key == "launchtime")
55+
val = "LAUNCHTIMEPLACEHOLDER";
56+
5357
if (key == "channel")
5458
{
5559
if (val.ToLower() != App.Settings.Prop.Channel.ToLower())

Bloxstrap/Helpers/Updater.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@ public static void CheckInstalledVersion()
7878

7979
Bootstrapper.Register();
8080

81-
// update check: if we're upgrading to v2.1.0 and have reshade enabled,
82-
// we need to set our renderer to direct3d 11
83-
if (App.Settings.Prop.UseReShade && App.FastFlags.GetValue(FastFlagManager.RenderingModes["Direct3D 11"]) is null)
84-
{
85-
App.FastFlags.SetRenderingMode("Direct3D 11");
86-
App.FastFlags.Save();
87-
}
88-
8981
if (isAutoUpgrade)
9082
{
9183
NotifyIcon notification = new()

0 commit comments

Comments
 (0)