openmw/components/lua_ui/scriptsettings.cpp

35 lines
617 B
C++
Raw Normal View History

2022-01-25 21:53:00 +01: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 21:53:00 +01:00
{
2022-01-28 21:45:13 +01:00
if (index < allSettings.size())
allSettings[index].mElement->attachToWidget(widget);
2022-01-25 21:53:00 +01:00
}
}