add compatibility with other files
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user