Skip to content

Ghost race info #5201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/gui/dialogs/ghost_replay_info_dialog.stkgui
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</div>
<bubble id="info" width="100%" proportion="1" word_wrap="true"/>
</div>

<spacer width="10" height="5%"/>
<div width="95%" height="40%" align="center">
<buttonbar id="actions" x="0" y="0" height="100%" width="100%" align="center">
<icon-button id="back" width="128" height="128"
Expand All @@ -53,7 +53,7 @@
I18N="Ghost replay info screen action" text="Start Race" word_wrap="true" />
</buttonbar>
</div>
<spacer width="10" height="10%"/>
<spacer width="10" height="5%"/>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions data/replay/benchmark_black_forest.replay
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ reverse: 0
difficulty: 3
mode: time-trial
track: black_forest
info: Sped up 2x for benchmarking purpose.
laps: 1
min_time: 73.286743
replay_uid: 564944495606616311
Expand Down
7 changes: 5 additions & 2 deletions src/replay/replay_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ bool ReplayPlay::addReplayFile(const std::string& fn, bool custom_replay, int ca
if (s[last - 1] == '\n')
s[last - 1] = '\0';

rd.m_info = s + 6;
rd.m_info = s + 6;
if (rd.m_info.empty())
rd.m_info = L" ";

fgets(s, 1023, fd);
}
if (sscanf(s, "laps: %u", &rd.m_laps) != 1)
Expand Down Expand Up @@ -368,7 +371,7 @@ void ReplayPlay::loadFile(bool second_replay)
ReplayData &rd = m_replay_file_list[replay_index];
unsigned int num_kart = (unsigned int)m_replay_file_list.at(replay_index)
.m_kart_list.size();
unsigned int lines_to_skip = (rd.m_replay_version == 3) ? 7 : 10;
unsigned int lines_to_skip = (rd.m_replay_version == 3) ? 7 : 10 + !rd.m_info.empty();
lines_to_skip += (rd.m_replay_version == 3) ? num_kart : 2*num_kart;

for (unsigned int i = 0; i < lines_to_skip; i++)
Expand Down
Loading