openmw/components/lua_ui/scriptsettings.cpp

38 lines
700 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(const ScriptSettings& script, MyGUI::Widget* widget)
{
WidgetExtension* root = script.mElement->mRoot;
if (!root)
return;
root->widget()->attachToWidget(widget);
root->updateCoord();
}
}