mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
migrate from std::filesystem::path to io::path (WIP)
This commit is contained in:
parent
1e22882284
commit
e0314803c0
72 changed files with 1189 additions and 791 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue