mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator
synced 2025-07-05 11:39:06 +08:00
Prevent overlay crash if no achievements are defd.
Disable the "show achievements" button too.
This commit is contained in:
parent
f3ac8485ed
commit
8726d331f9
@ -2424,14 +2424,24 @@ void Steam_Overlay::OverlayProc()
|
|||||||
|
|
||||||
ImGui::LabelText("##label", "Renderer: %s", (_renderer == nullptr ? "Unknown" : _renderer->GetLibraryName().c_str()));
|
ImGui::LabelText("##label", "Renderer: %s", (_renderer == nullptr ? "Unknown" : _renderer->GetLibraryName().c_str()));
|
||||||
|
|
||||||
ImGui::Text("Achievements earned: %d / %d", earned_achievement_count, total_achievement_count);
|
if (total_achievement_count > 0) {
|
||||||
ImGui::SameLine();
|
ImGui::Text("Achievements earned: %d / %d", earned_achievement_count, total_achievement_count);
|
||||||
ImGui::ProgressBar((earned_achievement_count / total_achievement_count), ImVec2((io.DisplaySize.x * 0.20f),0));
|
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();
|
ImGui::Spacing();
|
||||||
|
if (total_achievement_count <= 0) {
|
||||||
|
ImGui::BeginDisabled();
|
||||||
|
}
|
||||||
if (ImGui::Button("Show Achievements")) {
|
if (ImGui::Button("Show Achievements")) {
|
||||||
show_achievements = true;
|
show_achievements = true;
|
||||||
}
|
}
|
||||||
|
if (total_achievement_count <= 0) {
|
||||||
|
ImGui::EndDisabled();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user