From 89038bc31672c46622d9bdbb1112dd73a90cf22b Mon Sep 17 00:00:00 2001 From: shibbo Date: Wed, 8 Nov 2023 09:18:33 -0500 Subject: [PATCH] Add support for regenerating the parameter database --- Fushigi/param/ParamDB.cs | 9 +++++++++ Fushigi/ui/MainWindow.cs | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/Fushigi/param/ParamDB.cs b/Fushigi/param/ParamDB.cs index af9bfb57..015f49ca 100644 --- a/Fushigi/param/ParamDB.cs +++ b/Fushigi/param/ParamDB.cs @@ -183,6 +183,15 @@ public static void Load() sIsInit = true; } + public static void Reload() + { + sActors.Clear(); + sComponents.Clear(); + sRails.Clear(); + sRailParamList.Clear(); + Load(); + } + static Component ReadByml(Byml.Byml byml) { var root = (BymlHashTable)byml.Root; diff --git a/Fushigi/ui/MainWindow.cs b/Fushigi/ui/MainWindow.cs index 59f52125..e46a5fa4 100644 --- a/Fushigi/ui/MainWindow.cs +++ b/Fushigi/ui/MainWindow.cs @@ -10,6 +10,9 @@ using System.Numerics; using System.Collections.Generic; using System.Runtime.InteropServices; +using static System.Net.Mime.MediaTypeNames; +using System.Reflection; +using System.Diagnostics; namespace Fushigi.ui { @@ -179,6 +182,11 @@ void DrawMainMenu(GL gl) mIsChoosingPreferences = true; } + if (ImGui.MenuItem("Regenerate Parameter Database", ParamDB.sIsInit)) { + ParamDB.sIsInit = false; + ParamDB.Reload(); + } + /* end Edit menu */ ImGui.EndMenu(); }