mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Script settings tab
This commit is contained in:
parent
03f1b1a082
commit
fba82eb1a7
8 changed files with 183 additions and 8 deletions
37
components/lua_ui/scriptsettings.cpp
Normal file
37
components/lua_ui/scriptsettings.cpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue