migrate from std::filesystem::path to io::path (WIP)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user