diff --git a/src/frontend/menu.cpp b/src/frontend/menu.cpp index ce1ab9cc..1fd76916 100644 --- a/src/frontend/menu.cpp +++ b/src/frontend/menu.cpp @@ -19,6 +19,7 @@ #include "../files/WorldConverter.h" #include "../files/WorldFiles.h" #include "../world/World.h" +#include "../world/WorldTypes.h" #include "../world/Level.h" #include "../window/Events.h" #include "../window/Window.h" @@ -38,6 +39,10 @@ using glm::vec4; namespace fs = std::filesystem; using namespace gui; +namespace menus { + std::string worldType; +} + inline uint64_t randU64() { srand(time(NULL)); return rand() ^ (rand() << 8) ^ @@ -168,6 +173,28 @@ void create_languages_panel(Engine* engine) { panel->add(guiutil::backButton(menu)); } +void create_world_types_panel(Engine* engine) { + auto menu = engine->getGUI()->getMenu(); + auto panel = create_page(engine, "world_types", 400, 0.5f, 1); + panel->setScrollable(true); + + std::vector worldTypes = WorldTypes::getWorldTypes(); + std::sort(worldTypes.begin(), worldTypes.end()); + for (std::string& type : worldTypes) { + std::string& fullName = util::wstr2str_utf8(langs::get(util::str2wstr_utf8(type), L"world.types")); + auto button = std::make_shared