diff --git a/components/lua_ui/element.hpp b/components/lua_ui/element.hpp index 4ac9cd97b5..b276bf9bcc 100644 --- a/components/lua_ui/element.hpp +++ b/components/lua_ui/element.hpp @@ -1,6 +1,8 @@ #ifndef OPENMW_LUAUI_ELEMENT #define OPENMW_LUAUI_ELEMENT +#include +#include #include #include "widget.hpp" @@ -20,6 +22,14 @@ namespace LuaUi callback(element.get()); } + template + static void forEachShared(bool menu, Callback callback) + { + auto& container = menu ? sMenuElements : sGameElements; + for (auto& [_, element] : container) + callback(element); + } + static const std::vector& allLayoutProperties(); WidgetExtension* mRoot;