mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-04-15 15:57:47 +02:00
Prevent overlay crash if no achievements are defd.
Disable the "show achievements" button too.
This commit is contained in:
parent
f3ac8485ed
commit
8726d331f9
1 changed files with 13 additions and 3 deletions
|
@ -2424,14 +2424,24 @@ void Steam_Overlay::OverlayProc()
|
|||
|
||||
ImGui::LabelText("##label", "Renderer: %s", (_renderer == nullptr ? "Unknown" : _renderer->GetLibraryName().c_str()));
|
||||
|
||||
ImGui::Text("Achievements earned: %d / %d", earned_achievement_count, total_achievement_count);
|
||||
ImGui::SameLine();
|
||||
ImGui::ProgressBar((earned_achievement_count / total_achievement_count), ImVec2((io.DisplaySize.x * 0.20f),0));
|
||||
if (total_achievement_count > 0) {
|
||||
ImGui::Text("Achievements earned: %d / %d", earned_achievement_count, total_achievement_count);
|
||||
ImGui::SameLine();
|
||||
ImGui::ProgressBar((earned_achievement_count / total_achievement_count), ImVec2((io.DisplaySize.x * 0.20f),0));
|
||||
} else {
|
||||
ImGui::Text("Achievements not loaded. Unable to display statistics.");
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
if (total_achievement_count <= 0) {
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
if (ImGui::Button("Show Achievements")) {
|
||||
show_achievements = true;
|
||||
}
|
||||
if (total_achievement_count <= 0) {
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
|
|
Loading…
Reference in a new issue