openmw/components/lua_ui/scriptsettings.cpp

35 lines
616 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<ScriptSettingsPage> allPages;
2022-01-25 21:53:00 +01:00
}
const std::vector<ScriptSettingsPage>& scriptSettingsPages()
2022-01-25 21:53:00 +01:00
{
return allPages;
2022-01-25 21:53:00 +01:00
}
void registerSettingsPage(const ScriptSettingsPage& page)
2022-01-25 21:53:00 +01:00
{
allPages.push_back(page);
2022-01-25 21:53:00 +01:00
}
void clearSettings()
{
allPages.clear();
2022-01-25 21:53:00 +01:00
}
void attachToWidget(size_t index, MyGUI::Widget* widget)
2022-01-25 21:53:00 +01:00
{
if (index < allPages.size())
allPages[index].mElement->attachToWidget(widget);
2022-01-25 21:53:00 +01:00
}
}