diff --git a/Bloxstrap/Models/FastFlag.cs b/Bloxstrap/Models/FastFlag.cs
new file mode 100644
index 00000000..1f5888a9
--- /dev/null
+++ b/Bloxstrap/Models/FastFlag.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Bloxstrap.Models
+{
+ public class FastFlag
+ {
+ public bool Enabled { get; set; }
+ public string Name { get; set; } = null!;
+ public string Value { get; set; } = null!;
+ }
+}
diff --git a/Bloxstrap/UI/Elements/Dialogs/AddFastFlagDialog.xaml b/Bloxstrap/UI/Elements/Dialogs/AddFastFlagDialog.xaml
new file mode 100644
index 00000000..06e7cc08
--- /dev/null
+++ b/Bloxstrap/UI/Elements/Dialogs/AddFastFlagDialog.xaml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Bloxstrap/UI/Elements/Dialogs/AddFastFlagDialog.xaml.cs b/Bloxstrap/UI/Elements/Dialogs/AddFastFlagDialog.xaml.cs
new file mode 100644
index 00000000..efff5e48
--- /dev/null
+++ b/Bloxstrap/UI/Elements/Dialogs/AddFastFlagDialog.xaml.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace Bloxstrap.UI.Elements.Dialogs
+{
+ ///
+ /// Interaction logic for AddFlagDialog.xaml
+ ///
+ public partial class AddFastFlagDialog
+ {
+ public MessageBoxResult Result = MessageBoxResult.Cancel;
+
+ public AddFastFlagDialog()
+ {
+ InitializeComponent();
+ }
+
+ private void OKButton_Click(object sender, RoutedEventArgs e)
+ {
+ Result = MessageBoxResult.OK;
+ Close();
+ }
+ }
+}
diff --git a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml
index d932dcbc..013d1eef 100644
--- a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml
+++ b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml
@@ -45,6 +45,7 @@
+
diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml
new file mode 100644
index 00000000..99f4c589
--- /dev/null
+++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml.cs b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml.cs
new file mode 100644
index 00000000..5186b939
--- /dev/null
+++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml.cs
@@ -0,0 +1,142 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+using Bloxstrap.UI.Elements.Dialogs;
+
+namespace Bloxstrap.UI.Elements.Menu.Pages
+{
+ ///
+ /// Interaction logic for FastFlagEditorPage.xaml
+ ///
+ public partial class FastFlagEditorPage
+ {
+ // believe me when i say there is absolutely zero point to using mvvm for this
+ // using a datagrid is a codebehind thing only and thats it theres literally no way around it
+
+ private readonly ObservableCollection _fastFlagList = new();
+
+ public FastFlagEditorPage()
+ {
+ InitializeComponent();
+ }
+
+ private void Page_Loaded(object sender, RoutedEventArgs e)
+ {
+ _fastFlagList.Clear();
+
+ foreach (string flagName in App.FastFlags.Prop.Keys)
+ {
+ string? flagValue = App.FastFlags.GetValue(flagName);
+
+ if (flagValue is null)
+ continue;
+
+ var entry = new FastFlag
+ {
+ Enabled = true,
+ Name = flagName,
+ Value = flagValue
+ };
+
+ if (entry.Name.StartsWith("Disable"))
+ {
+ entry.Enabled = false;
+ entry.Name = entry.Name[7..];
+ }
+
+ _fastFlagList.Add(entry);
+ }
+
+ DataGrid.ItemsSource = _fastFlagList;
+ }
+
+ private void DataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
+ {
+ int index = e.Row.GetIndex();
+ FastFlag entry = _fastFlagList[index];
+
+ switch (e.Column.Header)
+ {
+ case "Enabled":
+ bool enabled = (bool)((CheckBox)e.EditingElement).IsChecked!;
+
+ if (enabled)
+ {
+ App.FastFlags.SetValue(entry.Name, entry.Value);
+ App.FastFlags.SetValue($"Disable{entry.Name}", null);
+ }
+ else
+ {
+ App.FastFlags.SetValue(entry.Name, null);
+ App.FastFlags.SetValue($"Disable{entry.Name}", entry.Value);
+ }
+
+ break;
+
+ case "Name":
+ string newName = ((TextBox)e.EditingElement).Text;
+
+ App.FastFlags.SetValue(entry.Name, null);
+ App.FastFlags.SetValue(newName, entry.Value);
+
+ break;
+
+ case "Value":
+ string newValue = ((TextBox)e.EditingElement).Text;
+
+ App.FastFlags.SetValue(entry.Name, newValue);
+
+ break;
+ }
+ }
+
+ private void AddButton_Click(object sender, RoutedEventArgs e)
+ {
+ var dialog = new AddFastFlagDialog();
+ dialog.ShowDialog();
+
+ if (dialog.Result != MessageBoxResult.OK)
+ return;
+
+ var entry = new FastFlag
+ {
+ Enabled = true,
+ Name = dialog.FlagNameTextBox.Text,
+ Value = dialog.FlagValueTextBox.Text
+ };
+
+ _fastFlagList.Add(entry);
+
+ App.FastFlags.SetValue(entry.Name, entry.Value);
+ }
+
+ private void DeleteButton_Click(object sender, RoutedEventArgs e)
+ {
+ var tempList = new List();
+
+ foreach (FastFlag entry in DataGrid.SelectedItems)
+ tempList.Add(entry);
+
+ foreach (FastFlag entry in tempList)
+ {
+ _fastFlagList.Remove(entry);
+ App.FastFlags.SetValue(entry.Name, null);
+ }
+ }
+ }
+}
diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml
index 26fba4e1..72000c90 100644
--- a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml
+++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml
@@ -8,7 +8,8 @@
mc:Ignorable="d"
d:DesignHeight="1000" d:DesignWidth="800"
Title="FastFlagsPage"
- Scrollable="True">
+ Scrollable="True"
+ Loaded="Page_Loaded">
diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs
index 6fa9deaa..863202b4 100644
--- a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs
+++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs
@@ -1,4 +1,5 @@
-using System.Windows.Input;
+using System.Windows;
+using System.Windows.Input;
using Bloxstrap.UI.ViewModels.Menu;
@@ -11,10 +12,14 @@ public partial class FastFlagsPage
{
public FastFlagsPage()
{
- DataContext = new FastFlagsViewModel();
InitializeComponent();
}
+ private void Page_Loaded(object sender, RoutedEventArgs e)
+ {
+ DataContext = new FastFlagsViewModel();
+ }
+
private void ValidateInt32(object sender, TextCompositionEventArgs e) => e.Handled = !Int32.TryParse(e.Text, out int _);
}
}