diff options
Diffstat (limited to 'src/ui/imgui_extensions.cpp')
| -rw-r--r-- | src/ui/imgui_extensions.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ui/imgui_extensions.cpp b/src/ui/imgui_extensions.cpp index 0bfd5c8..797da9d 100644 --- a/src/ui/imgui_extensions.cpp +++ b/src/ui/imgui_extensions.cpp @@ -3,6 +3,7 @@ #include "memops.hpp" #include "config.hpp" #include "locales.hpp" +#include "countries.hpp" #include "administration.hpp" #include "tinyfiledialogs.h" @@ -51,7 +52,7 @@ namespace ImGui { const char *filterPatterns[] = { "*.pdf" }; const char *file = tinyfd_openFileDialog( - "Choose a file", // dialog title // @locale::get + "Choose a file", // dialog title // @localize NULL, // default path 1, // number of filter patterns filterPatterns, // filter patterns array @@ -74,7 +75,7 @@ namespace ImGui result = true; } ImGui::SameLine(); - ImGui::TextWrapped("Selected: %s", buffer); // @locale::get + ImGui::TextWrapped("Selected: %s", buffer); // @localize } @@ -88,16 +89,16 @@ namespace ImGui ImGui::SetNextItemWidth(widthAvailable*0.5f); const char* countries[30]; - for (int x = 0; x < config::country_count; x++) + for (int x = 0; x < country::get_count(); x++) { char locale_str[20]; - strops::format(locale_str, 20, "country.%s", config::country_codes[x]); + strops::format(locale_str, 20, "country.%s", country::get_code_by_index(x)); countries[x] = locale::get(locale_str); } - for (int i = 0; i < config::country_count; i++) + for (int i = 0; i < country::get_count(); i++) { - if (strcmp(config::country_codes[i], buffer) == 0) + if (strcmp(country::get_code_by_index(i), buffer) == 0) { selected_country = countries[i]; break; @@ -113,7 +114,7 @@ namespace ImGui if (ImGui::BeginCombo(locale::get("contact.form.country"), selected_country)) { - for (int n = 0; n < config::country_count; n++) + for (int n = 0; n < country::get_count(); n++) { bool is_selected = (selected_country == countries[n]); if (ImGui::Selectable(countries[n], is_selected)) { @@ -134,7 +135,7 @@ namespace ImGui } if (selected_country_index != -1) { - strops::copy(buffer, config::country_codes[selected_country_index], buf_size); + strops::copy(buffer, country::get_code_by_index(selected_country_index), buf_size); } } |
