From 3205a92ad872f918c8322cdcd1434c231a1fd251 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 17 Feb 2020 18:06:54 -0300 Subject: PoolVector is gone, replaced by Vector Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector`. --- core/translation.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'core/translation.cpp') diff --git a/core/translation.cpp b/core/translation.cpp index cf76de1c9e..17c23b86cd 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -794,9 +794,9 @@ static const char *locale_renames[][2] = { /////////////////////////////////////////////// -PoolVector Translation::_get_messages() const { +Vector Translation::_get_messages() const { - PoolVector msgs; + Vector msgs; msgs.resize(translation_map.size() * 2); int idx = 0; for (const Map::Element *E = translation_map.front(); E; E = E->next()) { @@ -809,9 +809,9 @@ PoolVector Translation::_get_messages() const { return msgs; } -PoolVector Translation::_get_message_list() const { +Vector Translation::_get_message_list() const { - PoolVector msgs; + Vector msgs; msgs.resize(translation_map.size()); int idx = 0; for (const Map::Element *E = translation_map.front(); E; E = E->next()) { @@ -823,12 +823,12 @@ PoolVector Translation::_get_message_list() const { return msgs; } -void Translation::_set_messages(const PoolVector &p_messages) { +void Translation::_set_messages(const Vector &p_messages) { int msg_count = p_messages.size(); ERR_FAIL_COND(msg_count % 2); - PoolVector::Read r = p_messages.read(); + const String *r = p_messages.ptr(); for (int i = 0; i < msg_count; i += 2) { @@ -898,7 +898,7 @@ void Translation::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_messages"), &Translation::_set_messages); ClassDB::bind_method(D_METHOD("_get_messages"), &Translation::_get_messages); - ADD_PROPERTY(PropertyInfo(Variant::POOL_STRING_ARRAY, "messages", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_messages", "_get_messages"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_STRING_ARRAY, "messages", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_messages", "_get_messages"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "locale"), "set_locale", "get_locale"); } @@ -1146,12 +1146,12 @@ TranslationServer *TranslationServer::singleton = NULL; bool TranslationServer::_load_translations(const String &p_from) { if (ProjectSettings::get_singleton()->has_setting(p_from)) { - PoolVector translations = ProjectSettings::get_singleton()->get(p_from); + Vector translations = ProjectSettings::get_singleton()->get(p_from); int tcount = translations.size(); if (tcount) { - PoolVector::Read r = translations.read(); + const String *r = translations.ptr(); for (int i = 0; i < tcount; i++) { -- cgit v1.2.3