1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2025-09-06 16:30:14 +02:00

translations: rename enums and avoid macros

This commit is contained in:
Alexis Murzeau 2022-08-27 22:22:09 +02:00
parent ead8ac2c18
commit ea4e143405
13 changed files with 7576 additions and 7534 deletions

View file

@ -121,7 +121,7 @@ void high_score::RenderHighScoreDialog()
if (ShowDialog == true)
{
ShowDialog = false;
if (!ImGui::IsPopupOpen(pinball::get_rc_string(translation_id_e::HIGHSCORES_Caption)))
if (!ImGui::IsPopupOpen(pinball::get_rc_string(Msg::HIGHSCORES_Caption)))
{
dlg_enter_name = false;
while (!ScoreQueue.empty())
@ -140,19 +140,19 @@ void high_score::RenderHighScoreDialog()
}
}
ImGui::OpenPopup(pinball::get_rc_string(translation_id_e::HIGHSCORES_Caption));
ImGui::OpenPopup(pinball::get_rc_string(Msg::HIGHSCORES_Caption));
}
}
bool unused_open = true;
if (ImGui::BeginPopupModal(pinball::get_rc_string(translation_id_e::HIGHSCORES_Caption), &unused_open, ImGuiWindowFlags_AlwaysAutoResize))
if (ImGui::BeginPopupModal(pinball::get_rc_string(Msg::HIGHSCORES_Caption), &unused_open, ImGuiWindowFlags_AlwaysAutoResize))
{
if (ImGui::BeginTable("table1", 3, ImGuiTableFlags_Borders))
{
char buf[36];
ImGui::TableSetupColumn(pinball::get_rc_string(translation_id_e::HIGHSCORES_Rank));
ImGui::TableSetupColumn(pinball::get_rc_string(translation_id_e::HIGHSCORES_Name));
ImGui::TableSetupColumn(pinball::get_rc_string(translation_id_e::HIGHSCORES_Score));
ImGui::TableSetupColumn(pinball::get_rc_string(Msg::HIGHSCORES_Rank));
ImGui::TableSetupColumn(pinball::get_rc_string(Msg::HIGHSCORES_Name));
ImGui::TableSetupColumn(pinball::get_rc_string(Msg::HIGHSCORES_Score));
ImGui::TableHeadersRow();
for (int offset = 0, row = 0; row < 5; row++)
@ -184,7 +184,7 @@ void high_score::RenderHighScoreDialog()
ImGui::EndTable();
}
if (ImGui::Button(pinball::get_rc_string(translation_id_e::HIGHSCORES_Ok)))
if (ImGui::Button(pinball::get_rc_string(Msg::HIGHSCORES_Ok)))
{
if (dlg_enter_name)
{
@ -194,23 +194,23 @@ void high_score::RenderHighScoreDialog()
}
ImGui::SameLine();
if (ImGui::Button(pinball::get_rc_string(translation_id_e::HIGHSCORES_Cancel)))
if (ImGui::Button(pinball::get_rc_string(Msg::HIGHSCORES_Cancel)))
ImGui::CloseCurrentPopup();
ImGui::SameLine();
if (ImGui::Button(pinball::get_rc_string(translation_id_e::HIGHSCORES_Clear)))
if (ImGui::Button(pinball::get_rc_string(Msg::HIGHSCORES_Clear)))
ImGui::OpenPopup("Confirm");
if (ImGui::BeginPopupModal("Confirm", nullptr, ImGuiWindowFlags_MenuBar))
{
ImGui::TextUnformatted(pinball::get_rc_string(translation_id_e::STRING141));
if (ImGui::Button(pinball::get_rc_string(translation_id_e::HIGHSCORES_Ok), ImVec2(120, 0)))
ImGui::TextUnformatted(pinball::get_rc_string(Msg::STRING141));
if (ImGui::Button(pinball::get_rc_string(Msg::HIGHSCORES_Ok), ImVec2(120, 0)))
{
clear_table();
ImGui::CloseCurrentPopup();
}
ImGui::SetItemDefaultFocus();
ImGui::SameLine();
if (ImGui::Button(pinball::get_rc_string(translation_id_e::HIGHSCORES_Cancel), ImVec2(120, 0)))
if (ImGui::Button(pinball::get_rc_string(Msg::HIGHSCORES_Cancel), ImVec2(120, 0)))
{
ImGui::CloseCurrentPopup();
}
@ -220,7 +220,7 @@ void high_score::RenderHighScoreDialog()
ImGui::EndPopup();
// Reenter dialog for the next score in the queue
if (!ImGui::IsPopupOpen(pinball::get_rc_string(translation_id_e::HIGHSCORES_Caption)) && !ScoreQueue.empty())
if (!ImGui::IsPopupOpen(pinball::get_rc_string(Msg::HIGHSCORES_Caption)) && !ScoreQueue.empty())
{
ShowDialog = true;
}