mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-05-14 04:04:42 -07:00
Save all FastFlag values as strings
turns out that the json deserializer does not, in fact, automatically typecast to string
This commit is contained in:
parent
df422cceb5
commit
62a44f1c2c
@ -3,7 +3,7 @@ using System.Windows.Media.Animation;
|
|||||||
|
|
||||||
namespace Bloxstrap
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
public class FastFlagManager : JsonManager<Dictionary<string, string>>
|
public class FastFlagManager : JsonManager<Dictionary<string, object>>
|
||||||
{
|
{
|
||||||
public override string FileLocation => Path.Combine(Directories.Modifications, "ClientSettings\\ClientAppSettings.json");
|
public override string FileLocation => Path.Combine(Directories.Modifications, "ClientSettings\\ClientAppSettings.json");
|
||||||
|
|
||||||
@ -124,8 +124,8 @@ namespace Bloxstrap
|
|||||||
public string? GetValue(string key)
|
public string? GetValue(string key)
|
||||||
{
|
{
|
||||||
// check if we have an updated change for it pushed first
|
// check if we have an updated change for it pushed first
|
||||||
if (Prop.TryGetValue(key, out string? value) && value is not null)
|
if (Prop.TryGetValue(key, out object? value) && value is not null)
|
||||||
return value;
|
return value.ToString();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -169,6 +169,16 @@ namespace Bloxstrap
|
|||||||
return mapping.First().Key;
|
return mapping.First().Key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Save()
|
||||||
|
{
|
||||||
|
// convert all flag values to strings before saving
|
||||||
|
|
||||||
|
foreach (var pair in Prop)
|
||||||
|
Prop[pair.Key] = pair.Value.ToString()!;
|
||||||
|
|
||||||
|
base.Save();
|
||||||
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
@ -42,7 +42,7 @@ namespace Bloxstrap.UI.Elements.Menu.Pages
|
|||||||
{
|
{
|
||||||
// Enabled = true,
|
// Enabled = true,
|
||||||
Name = pair.Key,
|
Name = pair.Key,
|
||||||
Value = pair.Value
|
Value = pair.Value.ToString()!
|
||||||
};
|
};
|
||||||
|
|
||||||
/* if (entry.Name.StartsWith("Disable"))
|
/* if (entry.Name.StartsWith("Disable"))
|
||||||
|
Loading…
Reference in New Issue
Block a user