2022-01-18 08:12:56 +00:00
|
|
|
#include "util.hpp"
|
2021-11-18 15:19:54 +00:00
|
|
|
|
|
|
|
#include <MyGUI_FactoryManager.h>
|
|
|
|
|
2022-01-29 22:06:43 +00:00
|
|
|
#include "adapter.hpp"
|
2021-11-18 15:19:54 +00:00
|
|
|
#include "widget.hpp"
|
|
|
|
#include "text.hpp"
|
|
|
|
#include "textedit.hpp"
|
|
|
|
#include "window.hpp"
|
2022-01-28 09:31:45 +00:00
|
|
|
#include "image.hpp"
|
2022-01-29 22:40:31 +00:00
|
|
|
#include "container.hpp"
|
2021-11-18 15:19:54 +00:00
|
|
|
|
2022-01-18 08:12:56 +00:00
|
|
|
#include "element.hpp"
|
2022-01-29 22:43:08 +00:00
|
|
|
#include "registerscriptsettings.hpp"
|
2022-01-18 08:12:56 +00:00
|
|
|
|
2021-11-18 15:19:54 +00:00
|
|
|
namespace LuaUi
|
|
|
|
{
|
|
|
|
|
|
|
|
void registerAllWidgets()
|
|
|
|
{
|
2022-01-29 22:06:43 +00:00
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaAdapter>("Widget");
|
2021-11-18 15:19:54 +00:00
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaWidget>("Widget");
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaText>("Widget");
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaTextEdit>("Widget");
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaWindow>("Widget");
|
2022-01-28 09:31:45 +00:00
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaImage>("Widget");
|
2022-01-29 22:40:31 +00:00
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaContainer>("Widget");
|
2022-01-28 09:31:45 +00:00
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaTileRect>("BasisSkin");
|
2021-11-18 15:19:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const std::unordered_map<std::string, std::string>& widgetTypeToName()
|
|
|
|
{
|
|
|
|
static std::unordered_map<std::string, std::string> types{
|
|
|
|
{ "LuaWidget", "Widget" },
|
|
|
|
{ "LuaText", "Text" },
|
|
|
|
{ "LuaTextEdit", "TextEdit" },
|
|
|
|
{ "LuaWindow", "Window" },
|
2022-01-28 09:31:45 +00:00
|
|
|
{ "LuaImage", "Image" },
|
2022-01-29 22:40:31 +00:00
|
|
|
{ "LuaContainer", "Container" },
|
2021-11-18 15:19:54 +00:00
|
|
|
};
|
|
|
|
return types;
|
|
|
|
}
|
2022-01-18 08:12:56 +00:00
|
|
|
|
|
|
|
void clearUserInterface()
|
|
|
|
{
|
2022-01-25 20:53:00 +00:00
|
|
|
clearSettings();
|
2022-01-18 08:12:56 +00:00
|
|
|
while (!Element::sAllElements.empty())
|
|
|
|
Element::sAllElements.begin()->second->destroy();
|
|
|
|
}
|
2021-11-18 15:19:54 +00:00
|
|
|
}
|