mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2023-12-30 21:52:56 +00:00
parent
fd973f049c
commit
f302687c7f
@ -162,32 +162,31 @@ void high_score::RenderHighScoreDialog()
|
|||||||
ImGui::TableSetupColumn("Score");
|
ImGui::TableSetupColumn("Score");
|
||||||
ImGui::TableHeadersRow();
|
ImGui::TableHeadersRow();
|
||||||
|
|
||||||
high_score_struct* tablePtr = dlg_hst;
|
for (int offset = 0, row = 0; row < 5; row++)
|
||||||
for (int row = 0; row < 5; row++)
|
|
||||||
{
|
{
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
snprintf(buf, sizeof buf, "%d", row);
|
snprintf(buf, sizeof buf, "%d", row);
|
||||||
ImGui::TextUnformatted(buf);
|
ImGui::TextUnformatted(buf);
|
||||||
|
|
||||||
auto score = tablePtr->Score;
|
auto currentRow = &dlg_hst[row + offset];
|
||||||
|
auto score = currentRow->Score;
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
if (dlg_enter_name == 1 && dlg_position == row)
|
if (dlg_enter_name == 1 && dlg_position == row)
|
||||||
{
|
{
|
||||||
|
offset = -1;
|
||||||
score = dlg_score;
|
score = dlg_score;
|
||||||
ImGui::PushItemWidth(200);
|
ImGui::PushItemWidth(200);
|
||||||
ImGui::InputText("", default_name, IM_ARRAYSIZE(default_name));
|
ImGui::InputText("", default_name, IM_ARRAYSIZE(default_name));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui::TextUnformatted(tablePtr->Name);
|
ImGui::TextUnformatted(currentRow->Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
score::string_format(score, buf);
|
score::string_format(score, buf);
|
||||||
ImGui::TextUnformatted(buf);
|
ImGui::TextUnformatted(buf);
|
||||||
|
|
||||||
tablePtr++;
|
|
||||||
}
|
}
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user