Skip to content

Commit 3c5ecec

Browse files
committed
Show progress percentage for worlds
1 parent c0ba8e5 commit 3c5ecec

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/supertux/menu/world_preview_menu.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SuperTux
2-
// Copyright (C) 2022 Vankata453
2+
// Copyright (C) 2022-2023 Vankata453
33
//
44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by
@@ -74,7 +74,8 @@ WorldPreviewMenu::draw_preview_data(DrawingContext& context, const Rectf& previe
7474
const Savegame::Progress& progress = m_world_entries[index].progress;
7575
if (progress.progress > -1) // Progress should be drawn.
7676
context.color().draw_text(Resources::normal_font,
77-
std::to_string(progress.progress) + "/" + std::to_string(progress.total),
77+
std::to_string(progress.progress) + "/" + std::to_string(progress.total)
78+
+ " (" + std::to_string(progress.progress / progress.total * 100) + "%)",
7879
Vector(preview_rect.get_left() + s_preview_size.width / 2, preview_rect.get_bottom() * 1.05f),
7980
ALIGN_CENTER, LAYER_GUI, Color(1, 1, 1, alpha));
8081
}

src/supertux/menu/world_preview_menu.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SuperTux
2-
// Copyright (C) 2022 Vankata453
2+
// Copyright (C) 2022-2023 Vankata453
33
//
44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)