From 95a8f4287f4576069303459ed195638a3616e419 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 26 Jan 2026 16:37:50 -0600 Subject: [PATCH] feat(ui): add SystemUnregisterFunctions --- src/ui/ScriptFunctionsSystem.cpp | 6 ++++++ src/ui/ScriptFunctionsSystem.hpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/ui/ScriptFunctionsSystem.cpp b/src/ui/ScriptFunctionsSystem.cpp index a1f04e4..72c13dd 100644 --- a/src/ui/ScriptFunctionsSystem.cpp +++ b/src/ui/ScriptFunctionsSystem.cpp @@ -42,3 +42,9 @@ void SystemRegisterFunctions() { FrameScript_RegisterFunction(func.name, func.method); } } + +void SystemUnregisterFunctions() { + for (auto& func : s_SystemFunctions) { + FrameScript_UnregisterFunction(func.name); + } +} diff --git a/src/ui/ScriptFunctionsSystem.hpp b/src/ui/ScriptFunctionsSystem.hpp index 15fd17d..67581e6 100644 --- a/src/ui/ScriptFunctionsSystem.hpp +++ b/src/ui/ScriptFunctionsSystem.hpp @@ -3,4 +3,6 @@ void SystemRegisterFunctions(); +void SystemUnregisterFunctions(); + #endif