mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix flag editor validation bugs
This commit is contained in:
parent
b05aced721
commit
b2f6fc753a
@ -234,6 +234,12 @@ namespace Bloxstrap.UI.Elements.Menu.Pages
|
||||
if (App.FastFlags.Prop.ContainsKey(pair.Key) && !overwriteConflicting)
|
||||
continue;
|
||||
|
||||
// TODO - error message, i just had to hastily add this in
|
||||
// as i'm currently testing 2.7.0 for release and all translations
|
||||
// are already done
|
||||
if (pair.Value is not string)
|
||||
continue;
|
||||
|
||||
if (!ValidateFlagEntry(pair.Key, (string)pair.Value))
|
||||
continue;
|
||||
|
||||
@ -252,10 +258,10 @@ namespace Bloxstrap.UI.Elements.Menu.Pages
|
||||
errorMessage = Bloxstrap.Resources.Strings.Menu_FastFlagEditor_InvalidPrefix;
|
||||
else if (!name.All(x => char.IsLetterOrDigit(x) || x == '_'))
|
||||
errorMessage = Bloxstrap.Resources.Strings.Menu_FastFlagEditor_InvalidCharacter;
|
||||
else if (name[..6].Contains("FFlag") && lowerValue != "true" && lowerValue != "false")
|
||||
errorMessage = Bloxstrap.Resources.Strings.Menu_FastFlagEditor_InvalidBoolValue;
|
||||
else if (name[..5].Contains("FInt") && !Int32.TryParse(value, out _))
|
||||
else if ((name.StartsWith("FInt") || name.StartsWith("DFInt")) && !Int32.TryParse(value, out _))
|
||||
errorMessage = Bloxstrap.Resources.Strings.Menu_FastFlagEditor_InvalidNumberValue;
|
||||
else if ((name.StartsWith("FFlag") || name.StartsWith("DFFlag")) && lowerValue != "true" && lowerValue != "false")
|
||||
errorMessage = Bloxstrap.Resources.Strings.Menu_FastFlagEditor_InvalidBoolValue;
|
||||
|
||||
if (!String.IsNullOrEmpty(errorMessage))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user