From bcfaa6f67986f02ba9437b054ebdcbd3e6f4859b Mon Sep 17 00:00:00 2001 From: GEEKiDoS Date: Sat, 27 Jul 2024 22:24:45 +0800 Subject: [PATCH] fix notes radar not working --- src/client/component/filesystem.cpp | 18 +++++++---------- src/client/component/iidx/omnimix.cpp | 4 ++-- src/client/component/iidx/overlay.cpp | 28 +++++++++++++-------------- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/src/client/component/filesystem.cpp b/src/client/component/filesystem.cpp index aaa813f..d69932f 100644 --- a/src/client/component/filesystem.cpp +++ b/src/client/component/filesystem.cpp @@ -33,7 +33,7 @@ namespace filesystem auto _ = gsl::finally([=] { utils::memory::free(buffer); avs2::fs_close(file); - }); + }); if (size >= 0) { @@ -73,15 +73,12 @@ namespace filesystem public: void post_avs_init() override { - if (utils::flags::has_flag("disable_ifs_hook")) - return; - utils::nt::library self{ }; auto g = game::environment::get_game(); std::filesystem::path data_dir = self.get_folder(); data_dir /= "assets"; - + if (g == launcher::game::iidx) data_dir /= "iidx"; else if (g == launcher::game::sdvx) @@ -92,13 +89,12 @@ namespace filesystem static auto abs_data_path = std::filesystem::absolute(data_dir).generic_string(); if (!std::filesystem::exists(data_dir)) - { printf("warning: data dir %s not exists\n", abs_data_path.data()); - init(nullptr); - return; - } - - init(abs_data_path.data()); + + if (utils::flags::has_flag("disable_ifs_hook")) + init(std::filesystem::exists(data_dir) ? nullptr : abs_data_path.data()); + + avs2::fs_mount("/laochan", abs_data_path.data(), "fs", const_cast("vf=1,posix=1")); } }; } diff --git a/src/client/component/iidx/omnimix.cpp b/src/client/component/iidx/omnimix.cpp index 1d23439..c996352 100644 --- a/src/client/component/iidx/omnimix.cpp +++ b/src/client/component/iidx/omnimix.cpp @@ -33,7 +33,7 @@ namespace iidx::omnimix std::vector get_additional_mdatas() { - auto dir = avs2::fs_opendir("./music_datas"); + auto dir = avs2::fs_opendir("/laochan/music_datas"); std::vector result; @@ -42,7 +42,7 @@ namespace iidx::omnimix for (auto file = avs2::fs_readdir(dir); file; file = avs2::fs_readdir(dir)) { - filesystem::file mdata_file { utils::string::va("./music_datas/%s", file) }; + filesystem::file mdata_file { utils::string::va("/laochan/music_datas/%s", file) }; if (!mdata_file.exists()) continue; diff --git a/src/client/component/iidx/overlay.cpp b/src/client/component/iidx/overlay.cpp index d359be4..1806faa 100644 --- a/src/client/component/iidx/overlay.cpp +++ b/src/client/component/iidx/overlay.cpp @@ -114,19 +114,19 @@ namespace iidx::overlay void init() { - textures::background = load_texture("/data/notes_radar/nradar_waku02.png"); - textures::star = load_texture("/data/notes_radar/radar_star.png"); - textures::labels[4] = load_texture("/data/notes_radar/nradar_notes.png"); - textures::labels[5] = load_texture("/data/notes_radar/nradar_peak.png"); - textures::labels[0] = load_texture("/data/notes_radar/nradar_scratch.png"); - textures::labels[1] = load_texture("/data/notes_radar/nradar_sof_lan.png"); - textures::labels[2] = load_texture("/data/notes_radar/nradar_charge.png"); - textures::labels[3] = load_texture("/data/notes_radar/nradar_chord.png"); - textures::no_data = load_texture("/data/notes_radar/nradar_nodata.png"); - - filesystem::file radar_file{ "/data/radar_data.json" }; + textures::background = load_texture("/laochan/notes_radar/nradar_waku02.png"); + textures::star = load_texture("/laochan/notes_radar/radar_star.png"); + textures::labels[4] = load_texture("/laochan/notes_radar/nradar_notes.png"); + textures::labels[5] = load_texture("/laochan/notes_radar/nradar_peak.png"); + textures::labels[0] = load_texture("/laochan/notes_radar/nradar_scratch.png"); + textures::labels[1] = load_texture("/laochan/notes_radar/nradar_sof_lan.png"); + textures::labels[2] = load_texture("/laochan/notes_radar/nradar_charge.png"); + textures::labels[3] = load_texture("/laochan/notes_radar/nradar_chord.png"); + textures::no_data = load_texture("/laochan/notes_radar/nradar_nodata.png"); + + filesystem::file radar_file{ "/laochan/radar_data.json" }; if (!radar_file.exists()) { - printf("E:overlay: can not load /data/radar_data.json\n"); + printf("E:overlay: can not load /laochan/radar_data.json\n"); return; } @@ -286,9 +286,9 @@ namespace iidx::overlay void init() { - filesystem::file diff_file{ "/data/difficulty_data.json" }; + filesystem::file diff_file{ "/laochan/difficulty_data.json" }; if (!diff_file.exists()) { - printf("E:overlay: can not load /data/difficulty_data.json\n"); + printf("E:overlay: can not load /laochan/difficulty_data.json\n"); return; }