mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add FFlag mod preset for menu versions
This commit is contained in:
parent
3927d58290
commit
eafce44bad
@ -16,7 +16,7 @@ namespace Bloxstrap.Helpers
|
|||||||
public Dictionary<string, object?> Changes = new();
|
public Dictionary<string, object?> Changes = new();
|
||||||
|
|
||||||
// only one missing here is Metal because lol
|
// only one missing here is Metal because lol
|
||||||
public static IReadOnlyDictionary<string, string> RenderingModes { get; set; } = new Dictionary<string, string>()
|
public static IReadOnlyDictionary<string, string> RenderingModes => new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "Automatic", "" },
|
{ "Automatic", "" },
|
||||||
{ "Direct3D 11", "FFlagDebugGraphicsPreferD3D11" },
|
{ "Direct3D 11", "FFlagDebugGraphicsPreferD3D11" },
|
||||||
@ -24,11 +24,51 @@ namespace Bloxstrap.Helpers
|
|||||||
{ "Vulkan", "FFlagDebugGraphicsPreferVulkan" }
|
{ "Vulkan", "FFlagDebugGraphicsPreferVulkan" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// this is one hell of a variable definition lmao
|
||||||
|
public static IReadOnlyDictionary<string, Dictionary<string, string?>> IGMenuVersions => new Dictionary<string, Dictionary<string, string?>>
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"Default",
|
||||||
|
new Dictionary<string, string?>
|
||||||
|
{
|
||||||
|
{ "FFlagDisableNewIGMinDUA", null },
|
||||||
|
{ "FFlagEnableInGameMenuV3", null }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"Version 1 (2015)",
|
||||||
|
new Dictionary<string, string?>
|
||||||
|
{
|
||||||
|
{ "FFlagDisableNewIGMinDUA", "True" },
|
||||||
|
{ "FFlagEnableInGameMenuV3", "False" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"Version 2 (2020)",
|
||||||
|
new Dictionary<string, string?>
|
||||||
|
{
|
||||||
|
{ "FFlagDisableNewIGMinDUA", "False" },
|
||||||
|
{ "FFlagEnableInGameMenuV3", "False" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"Version 3 (2021)",
|
||||||
|
new Dictionary<string, string?>
|
||||||
|
{
|
||||||
|
{ "FFlagDisableNewIGMinDUA", "False" },
|
||||||
|
{ "FFlagEnableInGameMenuV3", "True" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// all fflags are stored as strings
|
// all fflags are stored as strings
|
||||||
// to delete a flag, set the value as null
|
// to delete a flag, set the value as null
|
||||||
public void SetValue(string key, object? value)
|
public void SetValue(string key, object? value)
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value is null)
|
||||||
{
|
{
|
||||||
Changes[key] = null;
|
Changes[key] = null;
|
||||||
App.Logger.WriteLine($"[FastFlagManager::SetValue] Deletion of '{key}' is pending");
|
App.Logger.WriteLine($"[FastFlagManager::SetValue] Deletion of '{key}' is pending");
|
||||||
|
@ -35,14 +35,14 @@ namespace Bloxstrap.ViewModels
|
|||||||
set => App.Settings.Prop.UseDisableAppPatch = value;
|
set => App.Settings.Prop.UseDisableAppPatch = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IReadOnlyDictionary<string, string> RenderingModes => FastFlagManager.RenderingModes;
|
|
||||||
|
|
||||||
public int FramerateLimit
|
public int FramerateLimit
|
||||||
{
|
{
|
||||||
get => Int32.TryParse(App.FastFlags.GetValue("DFIntTaskSchedulerTargetFps"), out int x) ? x : 60;
|
get => Int32.TryParse(App.FastFlags.GetValue("DFIntTaskSchedulerTargetFps"), out int x) ? x : 60;
|
||||||
set => App.FastFlags.SetValue("DFIntTaskSchedulerTargetFps", value);
|
set => App.FastFlags.SetValue("DFIntTaskSchedulerTargetFps", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IReadOnlyDictionary<string, string> RenderingModes => FastFlagManager.RenderingModes;
|
||||||
|
|
||||||
public string SelectedRenderingMode
|
public string SelectedRenderingMode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -75,6 +75,39 @@ namespace Bloxstrap.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IReadOnlyDictionary<string, Dictionary<string, string?>> IGMenuVersions => FastFlagManager.IGMenuVersions;
|
||||||
|
|
||||||
|
public string SelectedIGMenuVersion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
// yeah this kinda sucks
|
||||||
|
foreach (var version in IGMenuVersions)
|
||||||
|
{
|
||||||
|
bool flagsMatch = true;
|
||||||
|
|
||||||
|
foreach (var flag in version.Value)
|
||||||
|
{
|
||||||
|
if (App.FastFlags.GetValue(flag.Key) != flag.Value)
|
||||||
|
flagsMatch = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flagsMatch)
|
||||||
|
return version.Key;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Default";
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
foreach (var flag in IGMenuVersions[value])
|
||||||
|
{
|
||||||
|
App.FastFlags.SetValue(flag.Key, flag.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool AlternateGraphicsSelectorEnabled
|
public bool AlternateGraphicsSelectorEnabled
|
||||||
{
|
{
|
||||||
get => App.FastFlags.GetValue("FFlagFixGraphicsQuality") == "True";
|
get => App.FastFlags.GetValue("FFlagFixGraphicsQuality") == "True";
|
||||||
|
@ -101,6 +101,7 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ui:CardControl Grid.Row="0" Margin="0,8,0,0" Padding="16,13,16,12">
|
<ui:CardControl Grid.Row="0" Margin="0,8,0,0" Padding="16,13,16,12">
|
||||||
@ -139,6 +140,15 @@
|
|||||||
</ui:CardControl.Header>
|
</ui:CardControl.Header>
|
||||||
<ui:ToggleSwitch IsChecked="{Binding AlternateGraphicsSelectorEnabled, Mode=TwoWay}" />
|
<ui:ToggleSwitch IsChecked="{Binding AlternateGraphicsSelectorEnabled, Mode=TwoWay}" />
|
||||||
</ui:CardControl>
|
</ui:CardControl>
|
||||||
|
<ui:CardControl Grid.Row="4" Margin="0,8,0,0" Padding="16,13,16,12">
|
||||||
|
<ui:CardControl.Header>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock FontSize="14" Text="In-game menu version" />
|
||||||
|
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Choose which version of the in-game menu to use. Current default is v1." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||||
|
</StackPanel>
|
||||||
|
</ui:CardControl.Header>
|
||||||
|
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding IGMenuVersions.Keys, Mode=OneTime}" Text="{Binding SelectedIGMenuVersion, Mode=TwoWay}" />
|
||||||
|
</ui:CardControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<StackPanel x:Name="MiscellaneousOptions">
|
<StackPanel x:Name="MiscellaneousOptions">
|
||||||
|
Loading…
Reference in New Issue
Block a user