mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2024-11-22 02:32:39 +01:00
parent
2162cac977
commit
3109a8ea75
@ -145,7 +145,7 @@ void high_score::RenderHighScoreDialog()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool unused_open = true;
|
bool unused_open = true, textBoxSubmit = false;
|
||||||
if (ImGui::BeginPopupModal(pb::get_rc_string(Msg::HIGHSCORES_Caption), &unused_open, ImGuiWindowFlags_AlwaysAutoResize))
|
if (ImGui::BeginPopupModal(pb::get_rc_string(Msg::HIGHSCORES_Caption), &unused_open, ImGuiWindowFlags_AlwaysAutoResize))
|
||||||
{
|
{
|
||||||
if (ImGui::BeginTable("table1", 3, ImGuiTableFlags_Borders))
|
if (ImGui::BeginTable("table1", 3, ImGuiTableFlags_Borders))
|
||||||
@ -171,7 +171,19 @@ void high_score::RenderHighScoreDialog()
|
|||||||
offset = -1;
|
offset = -1;
|
||||||
score = DlgData.Entry.Score;
|
score = DlgData.Entry.Score;
|
||||||
ImGui::PushItemWidth(200);
|
ImGui::PushItemWidth(200);
|
||||||
ImGui::InputText("", DlgData.Entry.Name, IM_ARRAYSIZE(DlgData.Entry.Name));
|
|
||||||
|
static bool doubleFocus = false;
|
||||||
|
if (ImGui::IsWindowAppearing() || doubleFocus)
|
||||||
|
{
|
||||||
|
// Hack - set focus only works on the second time.
|
||||||
|
ImGui::SetKeyboardFocusHere(0);
|
||||||
|
doubleFocus ^= true;
|
||||||
|
}
|
||||||
|
if (ImGui::InputText("", DlgData.Entry.Name, IM_ARRAYSIZE(DlgData.Entry.Name),
|
||||||
|
ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_AutoSelectAll))
|
||||||
|
{
|
||||||
|
textBoxSubmit = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -185,7 +197,7 @@ void high_score::RenderHighScoreDialog()
|
|||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button(pb::get_rc_string(Msg::HIGHSCORES_Ok)))
|
if (ImGui::Button(pb::get_rc_string(Msg::HIGHSCORES_Ok)) || textBoxSubmit)
|
||||||
{
|
{
|
||||||
if (dlg_enter_name)
|
if (dlg_enter_name)
|
||||||
{
|
{
|
||||||
|
@ -562,7 +562,7 @@ void pb::end_game()
|
|||||||
if (position >= 0)
|
if (position >= 0)
|
||||||
{
|
{
|
||||||
high_score_struct entry{ {0}, scores[i] };
|
high_score_struct entry{ {0}, scores[i] };
|
||||||
const char* playerName = "Player";
|
const char* playerName;
|
||||||
|
|
||||||
switch(scoreIndex[i])
|
switch(scoreIndex[i])
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user