1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00
OpenMW/components/lua_ui/scriptsettings.cpp

35 lines
617 B
C++
Raw Normal View History

2022-01-25 20:53:00 +00:00
#include "scriptsettings.hpp"
#include <map>
#include "element.hpp"
namespace LuaUi
{
namespace
{
std::vector<ScriptSettings> allSettings;
}
const std::vector<ScriptSettings>& scriptSettings()
{
return allSettings;
}
void registerSettings(const ScriptSettings& script)
{
allSettings.push_back(script);
}
void clearSettings()
{
allSettings.clear();
}
void attachToWidget(size_t index, MyGUI::Widget* widget)
2022-01-25 20:53:00 +00:00
{
2022-01-28 20:45:13 +00:00
if (index < allSettings.size())
allSettings[index].mElement->attachToWidget(widget);
2022-01-25 20:53:00 +00:00
}
}