migrate from std::filesystem::path to io::path (WIP)

This commit is contained in:
MihailRis
2025-01-30 22:23:13 +03:00
parent 1e22882284
commit e0314803c0
72 changed files with 1189 additions and 791 deletions
+5 -5
View File
@@ -19,11 +19,11 @@ Hud* scripting::hud = nullptr;
WorldRenderer* scripting::renderer = nullptr;
static void load_script(const std::string& name) {
auto file = engine->getPaths().getResourcesFolder() / "scripts" / name;
auto file = io::path("res:scripts") / name;
std::string src = io::read_string(file);
logger.info() << "loading script " << file.u8string();
logger.info() << "loading script " << file.string();
lua::execute(lua::get_main_state(), 0, src, file.u8string());
lua::execute(lua::get_main_state(), 0, src, file.string());
}
void scripting::on_frontend_init(Hud* hud, WorldRenderer* renderer) {
@@ -80,12 +80,12 @@ void scripting::on_frontend_close() {
void scripting::load_hud_script(
const scriptenv& senv,
const std::string& packid,
const fs::path& file,
const io::path& file,
const std::string& fileName
) {
int env = *senv;
std::string src = io::read_string(file);
logger.info() << "loading script " << file.u8string();
logger.info() << "loading script " << file.string();
lua::execute(lua::get_main_state(), env, src, fileName);