mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 03:25:36 +00:00
FullscreenUI: Fix progress bar line at 0%
This commit is contained in:
parent
0f6e5bb1fe
commit
584ed4bb38
@ -2660,9 +2660,12 @@ void Achievements::DrawPauseMenuOverlays(float start_pos_y)
|
|||||||
const u32 progress_color = ImGui::GetColorU32(DarkerColor(UIStyle.SecondaryColor));
|
const u32 progress_color = ImGui::GetColorU32(DarkerColor(UIStyle.SecondaryColor));
|
||||||
dl->AddRectFilled(progress_bb.Min, progress_bb.Max, ImGui::GetColorU32(UIStyle.PrimaryDarkColor),
|
dl->AddRectFilled(progress_bb.Min, progress_bb.Max, ImGui::GetColorU32(UIStyle.PrimaryDarkColor),
|
||||||
progress_rounding);
|
progress_rounding);
|
||||||
dl->AddRectFilled(progress_bb.Min,
|
if (s_state.game_summary.num_unlocked_achievements > 0)
|
||||||
ImVec2(progress_bb.Min.x + unlocked_fraction * progress_bb.GetWidth(), progress_bb.Max.y),
|
{
|
||||||
progress_color, progress_rounding);
|
dl->AddRectFilled(progress_bb.Min,
|
||||||
|
ImVec2(progress_bb.Min.x + unlocked_fraction * progress_bb.GetWidth(), progress_bb.Max.y),
|
||||||
|
progress_color, progress_rounding);
|
||||||
|
}
|
||||||
|
|
||||||
buffer.format("{}/{}", s_state.game_summary.num_unlocked_achievements, s_state.game_summary.num_core_achievements);
|
buffer.format("{}/{}", s_state.game_summary.num_unlocked_achievements, s_state.game_summary.num_core_achievements);
|
||||||
text_size =
|
text_size =
|
||||||
@ -2872,9 +2875,12 @@ void Achievements::DrawAchievementsWindow()
|
|||||||
static_cast<float>(s_state.game_summary.num_core_achievements);
|
static_cast<float>(s_state.game_summary.num_core_achievements);
|
||||||
dl->AddRectFilled(progress_bb.Min, progress_bb.Max, ImGui::GetColorU32(UIStyle.PrimaryDarkColor),
|
dl->AddRectFilled(progress_bb.Min, progress_bb.Max, ImGui::GetColorU32(UIStyle.PrimaryDarkColor),
|
||||||
progress_rounding);
|
progress_rounding);
|
||||||
dl->AddRectFilled(progress_bb.Min,
|
if (s_state.game_summary.num_unlocked_achievements > 0)
|
||||||
ImVec2(progress_bb.Min.x + fraction * progress_bb.GetWidth(), progress_bb.Max.y),
|
{
|
||||||
ImGui::GetColorU32(UIStyle.SecondaryColor), progress_rounding);
|
dl->AddRectFilled(progress_bb.Min,
|
||||||
|
ImVec2(progress_bb.Min.x + fraction * progress_bb.GetWidth(), progress_bb.Max.y),
|
||||||
|
ImGui::GetColorU32(UIStyle.SecondaryColor), progress_rounding);
|
||||||
|
}
|
||||||
|
|
||||||
text.format("{}%", static_cast<int>(std::round(fraction * 100.0f)));
|
text.format("{}%", static_cast<int>(std::round(fraction * 100.0f)));
|
||||||
text_size =
|
text_size =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user