From 4a72a79582af0789c9c66816f09229d1651fd551 Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 3 Dec 2021 11:04:43 +0800 Subject: [PATCH] Fix #3849 --- src/replay/replay_play.hpp | 7 +++++++ src/states_screens/race_result_gui.cpp | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/replay/replay_play.hpp b/src/replay/replay_play.hpp index 9606fcaa7..2c6f57415 100644 --- a/src/replay/replay_play.hpp +++ b/src/replay/replay_play.hpp @@ -217,6 +217,13 @@ public: return m_replay_file_list.at(m_current_replay_file).m_filename; } // ------------------------------------------------------------------------ + unsigned int getCurrentReplayFileIndex() const + { return m_current_replay_file; } + // ------------------------------------------------------------------------ + unsigned int getSecondReplayFileIndex() const + { return m_second_replay_file; } + // ------------------------------------------------------------------------ + bool isSecondReplayEnabled() const { return m_second_replay_enabled; } }; // Replay #endif diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp index 9760cb33a..ace9f5601 100644 --- a/src/states_screens/race_result_gui.cpp +++ b/src/states_screens/race_result_gui.cpp @@ -1958,8 +1958,17 @@ void RaceResultGUI::unload() white_color, false, false, nullptr, true); } // display difficulty - const core::stringw& difficulty_name = + core::stringw difficulty_name = RaceManager::get()->getDifficultyName(RaceManager::get()->getDifficulty()); + core::stringw difficulty_two; + if (RaceManager::get()->hasGhostKarts() && ReplayPlay::get()->isSecondReplayEnabled()) + { + unsigned idx = ReplayPlay::get()->getSecondReplayFileIndex(); + const ReplayPlay::ReplayData& rd = ReplayPlay::get()->getReplayData(idx); + difficulty_two = RaceManager::get()->getDifficultyName((RaceManager::Difficulty)rd.m_difficulty); + if (difficulty_name != difficulty_two) + difficulty_name += core::stringw(L"/") + difficulty_two; + } core::stringw difficulty_string = _("Difficulty: %s", difficulty_name); current_y += int(m_distance_between_meta_rows * 0.8f); GUIEngine::getFont()->draw(difficulty_string,