From 872971ff7265aaf4898f7a285cb611ade53c1fa2 Mon Sep 17 00:00:00 2001 From: Rikhardur Bjarni Einarsson Date: Thu, 30 Nov 2023 08:58:23 +0000 Subject: [PATCH] Don't show trial reward --- projects/Core/api/game/trials.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/projects/Core/api/game/trials.cpp b/projects/Core/api/game/trials.cpp index f42e3b9b0a6..e8b65df04c4 100644 --- a/projects/Core/api/game/trials.cpp +++ b/projects/Core/api/game/trials.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,7 @@ namespace core::api::game::trials { std::string get_ghosts_directory_suffix() { std::string suffix; - for (const auto& item : ghosts_directory_suffixes) { + for (const auto& item: ghosts_directory_suffixes) { if (!suffix.empty()) { suffix += "_"; } @@ -50,11 +51,21 @@ namespace core::api::game::trials { return System::IO::Path::Combine_1(ghosts_path, race_id); } - IL2CPP_INTERCEPT(Moon::Race::LeaderBoardService, void, UploadReplay_1, (app::LeaderBoardService * this_ptr, app::String* race_id, float duration, app::String* replay_data, app::ITrialData* trial_data)) { + IL2CPP_INTERCEPT( + Moon::Race::LeaderBoardService, + void, + UploadReplay_1, + (app::LeaderBoardService * this_ptr, app::String* race_id, float duration, app::String* replay_data, app::ITrialData* trial_data) + ) { // NOOP } - IL2CPP_INTERCEPT(Moon::Race::LeaderBoardService, bool, UploadReplay_2, (app::LeaderBoardService * this_ptr, app::String* race_id, float duration, app::String* replay_data, app::ReplayValidatorData* data)) { + IL2CPP_INTERCEPT( + Moon::Race::LeaderBoardService, + bool, + UploadReplay_2, + (app::LeaderBoardService * this_ptr, app::String* race_id, float duration, app::String* replay_data, app::ReplayValidatorData* data) + ) { return false; // NOOP } @@ -69,9 +80,14 @@ namespace core::api::game::trials { IL2CPP_INTERCEPT(GhostManager, app::String*, GetOfflineRaceDirectory, (app::String * race_id)) { return get_suffixed_ghost_directory("offlineGhosts", race_id); } + + IL2CPP_INTERCEPT(RaceFinishIcon, void, SetRaceData, (app::RaceFinishIcon * this_ptr, float elapsed_time, bool show_trial_reward)) { + // TODO: Instead of not showing the reward change the text to show the correct reward instead and disable the spirit light icon + next::RaceFinishIcon::SetRaceData(this_ptr, elapsed_time, false); + } } // namespace void add_ghosts_directory_suffix(std::string suffix) { ghosts_directory_suffixes.insert(std::move(suffix)); } -} // namespace core::api::game::trials \ No newline at end of file +} // namespace core::api::game::trials