Console works again | UI crash fixes

This commit is contained in:
2024-12-22 00:49:35 +01:00
parent 664626c838
commit f8b540f583
7 changed files with 119 additions and 9 deletions

View File

@@ -71,9 +71,25 @@ load_scene :: (name: string) -> *Scene {
engine.procs.on_scene_loaded(scene, engine.mode);
}
if engine.mode == .EDITING {
save_last_opened_scene_file(name);
}
return scene;
}
get_last_opened_scene_file :: () -> string {
if file_exists("../.config") {
return read_entire_file("../.config");
}
return .{};
}
save_last_opened_scene_file :: (name: string) {
write_entire_file("../.config", name);
}
save_scene :: (scene: *Scene) {
path := "../assets/scenes/";
save_scene(scene, path);