Packs management update WIP

This commit is contained in:
MihailRis
2023-12-18 13:58:43 +03:00
parent 98021f533a
commit 826a743ab9
4 changed files with 69 additions and 36 deletions
+15
View File
@@ -158,6 +158,13 @@ Panel* create_main_menu_panel(Engine* engine, PagesControl* menu) {
vec4(10.0f, 8.0f, 10.0f, 8.0f));
button->color(vec4(1.0f, 1.0f, 1.0f, 0.1f));
button->listenAction([=](GUI* gui) {
// TODO: complete and move somewhere
auto resdir = engine->getPaths()->getResources();
auto& packs = engine->getContentPacks();
packs.clear();
packs.push_back(ContentPack::read(resdir/path("content/base")));
engine->loadContent();
auto* content = engine->getContent();
auto& settings = engine->getSettings();
auto folder = paths->getWorldsFolder()/u8path(name);
@@ -269,6 +276,14 @@ Panel* create_new_world_panel(Engine* engine, PagesControl* menu) {
auto folder = paths->getWorldsFolder()/u8path(nameutf8);
std::filesystem::create_directories(folder);
// TODO: complete and move somewhere
auto resdir = engine->getPaths()->getResources();
auto packs = engine->getContentPacks();
packs.clear();
packs.push_back(ContentPack::read(resdir/path("content/base")));
engine->loadContent();
Level* level = World::create(nameutf8,
folder,
seed,