add compatibility with other files

This commit is contained in:
alexei-zebra
2024-08-06 15:51:55 +03:00
parent 62125b14b4
commit 91ad9cc64c
9 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ EngineController::EngineController(Engine* engine) : engine(engine) {
}
void EngineController::deleteWorld(const std::string& name) {
fs::path folder = engine->getPaths()->getWorldFolder(name);
fs::path folder = engine->getPaths()->getWorldFolderByName(name);
guiutil::confirm(
engine->getGUI(),
langs::get(L"delete-confirm", L"world") + L" (" +
@@ -189,7 +189,7 @@ void EngineController::createWorld(
if (!menus::call(engine, [this, paths, folder]() {
engine->loadContent();
paths->setWorldFolder(folder);
paths->setCurrentWorldFolder(folder);
})) {
return;
}
+1 -1
View File
@@ -17,7 +17,7 @@ using namespace scripting;
static int l_pack_get_folder(lua::State* L) {
std::string packName = lua::tostring(L, 1);
if (packName == "core") {
auto folder = engine->getPaths()->getResources().u8string() + "/";
auto folder = engine->getPaths()->getResourcesFolder().u8string() + "/";
return lua::pushstring(L, folder);
}
for (auto& pack : engine->getContentPacks()) {
+1 -1
View File
@@ -71,7 +71,7 @@ static int l_world_get_seed(lua::State* L) {
static int l_world_exists(lua::State* L) {
auto name = lua::require_string(L, 1);
auto worldsDir = engine->getPaths()->getWorldFolder(name);
auto worldsDir = engine->getPaths()->getWorldFolderByName(name);
return lua::pushboolean(L, fs::is_directory(worldsDir));
}
+1 -1
View File
@@ -38,7 +38,7 @@ LevelController* scripting::controller = nullptr;
static void load_script(const fs::path& name, bool throwable) {
auto paths = scripting::engine->getPaths();
fs::path file = paths->getResources() / fs::path("scripts") / name;
fs::path file = paths->getResourcesFolder() / fs::path("scripts") / name;
std::string src = files::read_string(file);
auto L = lua::get_main_thread();