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"
|
2022-01-29 22:40:31 +00:00
|
|
|
#include "container.hpp"
|
2022-04-04 21:10:03 +00:00
|
|
|
#include "flex.hpp"
|
2021-11-18 15:19:54 +00:00
|
|
|
#include "image.hpp"
|
|
|
|
#include "text.hpp"
|
|
|
|
#include "textedit.hpp"
|
|
|
|
#include "widget.hpp"
|
|
|
|
#include "window.hpp"
|
|
|
|
|
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");
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaTileRect>("BasisSkin");
|
2022-04-04 21:10:03 +00:00
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaContainer>("Widget");
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<LuaFlex>("Widget");
|
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-04-04 21:10:03 +00:00
|
|
|
{ "LuaFlex", "Flex" },
|
2022-05-14 10:27:30 +00:00
|
|
|
{ "LuaContainer", "Container" },
|
2021-11-18 15:19:54 +00:00
|
|
|
};
|
|
|
|
return types;
|
|
|
|
}
|
2022-01-18 08:12:56 +00:00
|
|
|
|
2024-01-07 22:29:20 +00:00
|
|
|
void clearGameInterface()
|
2022-01-18 08:12:56 +00:00
|
|
|
{
|
2024-01-07 22:29:20 +00:00
|
|
|
while (!Element::sGameElements.empty())
|
2024-01-12 23:47:08 +00:00
|
|
|
Element::erase(Element::sGameElements.begin()->second.get());
|
2024-01-07 22:29:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void clearMenuInterface()
|
|
|
|
{
|
|
|
|
while (!Element::sMenuElements.empty())
|
2024-01-12 23:47:08 +00:00
|
|
|
Element::erase(Element::sMenuElements.begin()->second.get());
|
2022-01-18 08:12:56 +00:00
|
|
|
}
|
2021-11-18 15:19:54 +00:00
|
|
|
}
|