Skip to content

Commit

Permalink
fix notes radar not working
Browse files Browse the repository at this point in the history
  • Loading branch information
GEEKiDoS committed Jul 27, 2024
1 parent b298c7e commit bcfaa6f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
18 changes: 7 additions & 11 deletions src/client/component/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace filesystem
auto _ = gsl::finally([=] {
utils::memory::free(buffer);
avs2::fs_close(file);
});
});

if (size >= 0)
{
Expand Down Expand Up @@ -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)
Expand All @@ -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<char*>("vf=1,posix=1"));
}
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/client/component/iidx/omnimix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace iidx::omnimix

std::vector<json> get_additional_mdatas()
{
auto dir = avs2::fs_opendir("./music_datas");
auto dir = avs2::fs_opendir("/laochan/music_datas");

std::vector<json> result;

Expand All @@ -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;

Expand Down
28 changes: 14 additions & 14 deletions src/client/component/iidx/overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit bcfaa6f

Please sign in to comment.