diff options
author | hop311 <hop3114@gmail.com> | 2024-08-01 00:17:32 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-08-02 22:54:08 +0200 |
commit | 06b76612b28183f0a047dac3a4127120d2af1b39 (patch) | |
tree | 9e7af8634eafc8461bd02697dd48ae36ca924858 /extension/src/openvic-extension/classes/GFXPieChartTexture.cpp | |
parent | 8431914a6971cbacfb20bba13a4113d9ac4d5153 (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/classes/GFXPieChartTexture.cpp')
-rw-r--r-- | extension/src/openvic-extension/classes/GFXPieChartTexture.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extension/src/openvic-extension/classes/GFXPieChartTexture.cpp b/extension/src/openvic-extension/classes/GFXPieChartTexture.cpp index 47e32a2..417566d 100644 --- a/extension/src/openvic-extension/classes/GFXPieChartTexture.cpp +++ b/extension/src/openvic-extension/classes/GFXPieChartTexture.cpp @@ -8,8 +8,6 @@ using namespace godot; using namespace OpenVic; -using OpenVic::Utilities::std_view_to_godot_string; - StringName const& GFXPieChartTexture::_slice_identifier_key() { static const StringName slice_identifier_key = "identifier"; return slice_identifier_key; @@ -109,7 +107,8 @@ Error GFXPieChartTexture::set_slices_array(godot_pie_chart_data_t const& new_sli for (int32_t i = 0; i < new_slices.size(); ++i) { Dictionary const& slice_dict = new_slices[i]; ERR_CONTINUE_MSG( - !slice_dict.has(_slice_colour_key()) || !slice_dict.has(_slice_weight_key()), vformat("Invalid slice keys at index %d", i) + !slice_dict.has(_slice_colour_key()) || !slice_dict.has(_slice_weight_key()), + vformat("Invalid slice keys at index %d", i) ); const slice_t slice = std::make_pair(slice_dict[_slice_colour_key()], slice_dict[_slice_weight_key()]); if (slice.second > 0.0f) { @@ -171,12 +170,13 @@ Error GFXPieChartTexture::set_gfx_pie_chart_name(String const& gfx_pie_chart_nam ERR_FAIL_NULL_V_MSG( new_pie_chart, FAILED, vformat( "Invalid type for GFX sprite %s: %s (expected %s)", gfx_pie_chart_name, - std_view_to_godot_string(sprite->get_type()), std_view_to_godot_string(GFX::PieChart::get_type_static()) + Utilities::std_to_godot_string(sprite->get_type()), + Utilities::std_to_godot_string(GFX::PieChart::get_type_static()) ) ); return set_gfx_pie_chart(new_pie_chart); } String GFXPieChartTexture::get_gfx_pie_chart_name() const { - return gfx_pie_chart != nullptr ? std_view_to_godot_string(gfx_pie_chart->get_name()) : String {}; + return gfx_pie_chart != nullptr ? Utilities::std_to_godot_string(gfx_pie_chart->get_name()) : String {}; } |