aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/PopulationMenu.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-08-01 00:17:32 +0200
committer hop311 <hop3114@gmail.com>2024-08-02 22:54:08 +0200
commit06b76612b28183f0a047dac3a4127120d2af1b39 (patch)
tree9e7af8634eafc8461bd02697dd48ae36ca924858 /extension/src/openvic-extension/singletons/PopulationMenu.cpp
parent8431914a6971cbacfb20bba13a4113d9ac4d5153 (diff)
Use UTF8 encoding and simplify godot string conversionutf8-fix
Fixes #180: Province names do not convert non-ascii characters to Unicode
Diffstat (limited to 'extension/src/openvic-extension/singletons/PopulationMenu.cpp')
-rw-r--r--extension/src/openvic-extension/singletons/PopulationMenu.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/extension/src/openvic-extension/singletons/PopulationMenu.cpp b/extension/src/openvic-extension/singletons/PopulationMenu.cpp
index 65987ad..271068b 100644
--- a/extension/src/openvic-extension/singletons/PopulationMenu.cpp
+++ b/extension/src/openvic-extension/singletons/PopulationMenu.cpp
@@ -13,8 +13,6 @@
using namespace godot;
using namespace OpenVic;
-using OpenVic::Utilities::std_view_to_godot_string;
-
/* POPULATION MENU */
Error MenuSingleton::_population_menu_update_provinces() {
@@ -152,7 +150,7 @@ TypedArray<Dictionary> MenuSingleton::get_population_menu_province_list_rows(int
province_dict[type_key] = population_menu_t::LIST_ENTRY_PROVINCE;
province_dict[index_key] = index;
- province_dict[name_key] = std_view_to_godot_string(province_entry.province.get_identifier());
+ province_dict[name_key] = Utilities::std_to_godot_string(province_entry.province.get_identifier());
province_dict[size_key] = province_entry.province.get_total_population();
province_dict[change_key] = 0;
province_dict[selected_key] = province_entry.selected;
@@ -541,7 +539,7 @@ Error MenuSingleton::population_menu_update_locale_sort_cache() {
sorted_items.resize(items.size());
for (size_t idx = 0; idx < items.size(); ++idx) {
- String identifier = std_view_to_godot_string(items[idx].get_identifier());
+ String identifier = Utilities::std_to_godot_string(items[idx].get_identifier());
if constexpr (std::is_same_v<T, ProvinceInstance>) {
identifier = GUINode::format_province_name(identifier);
}
@@ -676,10 +674,10 @@ TypedArray<Dictionary> MenuSingleton::get_population_menu_pop_rows(int32_t start
pop_dict[pop_size_key] = pop->get_size();
pop_dict[pop_type_icon_key] = pop->get_type().get_sprite();
- pop_dict[pop_culture_key] = std_view_to_godot_string(pop->get_culture().get_identifier());
+ pop_dict[pop_culture_key] = Utilities::std_to_godot_string(pop->get_culture().get_identifier());
pop_dict[pop_religion_icon_key] = pop->get_religion().get_icon();
if (pop->get_location() != nullptr) {
- pop_dict[pop_location_key] = std_view_to_godot_string(pop->get_location()->get_identifier());
+ pop_dict[pop_location_key] = Utilities::std_to_godot_string(pop->get_location()->get_identifier());
}
pop_dict[pop_militancy_key] = pop->get_militancy().to_float();
pop_dict[pop_consciousness_key] = pop->get_consciousness().to_float();