Skip to content

Commit

Permalink
Show progress percentage for worlds
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankata453 committed Aug 2, 2023
1 parent c0ba8e5 commit 3c5ecec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/supertux/menu/world_preview_menu.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SuperTux
// Copyright (C) 2022 Vankata453
// Copyright (C) 2022-2023 Vankata453
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -74,7 +74,8 @@ WorldPreviewMenu::draw_preview_data(DrawingContext& context, const Rectf& previe
const Savegame::Progress& progress = m_world_entries[index].progress;
if (progress.progress > -1) // Progress should be drawn.
context.color().draw_text(Resources::normal_font,
std::to_string(progress.progress) + "/" + std::to_string(progress.total),
std::to_string(progress.progress) + "/" + std::to_string(progress.total)
+ " (" + std::to_string(progress.progress / progress.total * 100) + "%)",
Vector(preview_rect.get_left() + s_preview_size.width / 2, preview_rect.get_bottom() * 1.05f),
ALIGN_CENTER, LAYER_GUI, Color(1, 1, 1, alpha));
}
Expand Down
2 changes: 1 addition & 1 deletion src/supertux/menu/world_preview_menu.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SuperTux
// Copyright (C) 2022 Vankata453
// Copyright (C) 2022-2023 Vankata453
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down

0 comments on commit 3c5ecec

Please sign in to comment.