diff options
author | Juan Linietsky <juan@godotengine.org> | 2020-02-17 18:06:54 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-18 10:10:36 +0100 |
commit | 3205a92ad872f918c8322cdcd1434c231a1fd251 (patch) | |
tree | db44242ca27432eb8ea849679752d0835d2ae41a /scene/gui | |
parent | fb8c93c10b4b73d5f18f1ed287497728800e22b5 (diff) |
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/color_picker.cpp | 14 | ||||
-rw-r--r-- | scene/gui/color_picker.h | 2 | ||||
-rw-r--r-- | scene/gui/file_dialog.cpp | 6 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 6 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 2e903b6867..6ed16a2b75 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -59,7 +59,7 @@ void ColorPicker::_notification(int p_what) { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { - PoolColorArray saved_presets = EditorSettings::get_singleton()->get_project_metadata("color_picker", "presets", PoolColorArray()); + PackedColorArray saved_presets = EditorSettings::get_singleton()->get_project_metadata("color_picker", "presets", PackedColorArray()); for (int i = 0; i < saved_presets.size(); i++) { add_preset(saved_presets[i]); @@ -295,7 +295,7 @@ void ColorPicker::add_preset(const Color &p_color) { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { - PoolColorArray arr_to_save = get_presets(); + PackedColorArray arr_to_save = get_presets(); EditorSettings::get_singleton()->set_project_metadata("color_picker", "presets", arr_to_save); } #endif @@ -309,16 +309,16 @@ void ColorPicker::erase_preset(const Color &p_color) { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { - PoolColorArray arr_to_save = get_presets(); + PackedColorArray arr_to_save = get_presets(); EditorSettings::get_singleton()->set_project_metadata("color_picker", "presets", arr_to_save); } #endif } } -PoolColorArray ColorPicker::get_presets() const { +PackedColorArray ColorPicker::get_presets() const { - PoolColorArray arr; + PackedColorArray arr; arr.resize(presets.size()); for (int i = 0; i < presets.size(); i++) { arr.set(i, presets[i]); @@ -593,10 +593,10 @@ void ColorPicker::_screen_input(const Ref<InputEvent> &p_event) { Ref<Image> img = r->get_texture()->get_data(); if (img.is_valid() && !img->empty()) { - img->lock(); + Vector2 ofs = mev->get_global_position() - r->get_visible_rect().get_position(); Color c = img->get_pixel(ofs.x, r->get_visible_rect().size.height - ofs.y); - img->unlock(); + set_pick_color(c); } } diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 49d36dfb3a..dde2f37135 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -116,7 +116,7 @@ public: void add_preset(const Color &p_color); void erase_preset(const Color &p_color); - PoolColorArray get_presets() const; + PackedColorArray get_presets() const; void set_hsv_mode(bool p_enabled); bool is_hsv_mode() const; diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 6e7491e7b4..931fb4f13e 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -193,7 +193,7 @@ void FileDialog::_action_pressed() { TreeItem *ti = tree->get_next_selected(NULL); String fbase = dir_access->get_current_dir(); - PoolVector<String> files; + Vector<String> files; while (ti) { files.push_back(fbase.plus_file(ti->get_text(0))); @@ -849,14 +849,14 @@ void FileDialog::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "mode_overrides_title"), "set_mode_overrides_title", "is_mode_overriding_title"); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Open File,Open Files,Open Folder,Open Any,Save"), "set_mode", "get_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"), "set_access", "get_access"); - ADD_PROPERTY(PropertyInfo(Variant::POOL_STRING_ARRAY, "filters"), "set_filters", "get_filters"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_STRING_ARRAY, "filters"), "set_filters", "get_filters"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_hidden_files"), "set_show_hidden_files", "is_showing_hidden_files"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_dir"), "set_current_dir", "get_current_dir"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_file"), "set_current_file", "get_current_file"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_path"), "set_current_path", "get_current_path"); ADD_SIGNAL(MethodInfo("file_selected", PropertyInfo(Variant::STRING, "path"))); - ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::POOL_STRING_ARRAY, "paths"))); + ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::PACKED_STRING_ARRAY, "paths"))); ADD_SIGNAL(MethodInfo("dir_selected", PropertyInfo(Variant::STRING, "dir"))); BIND_ENUM_CONSTANT(MODE_OPEN_FILE); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a5c316848e..ae169e3dcd 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5446,11 +5446,11 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc return col; } -PoolVector<int> TextEdit::_search_bind(const String &p_key, uint32_t p_search_flags, int p_from_line, int p_from_column) const { +Vector<int> TextEdit::_search_bind(const String &p_key, uint32_t p_search_flags, int p_from_line, int p_from_column) const { int col, line; if (search(p_key, p_search_flags, p_from_line, p_from_column, line, col)) { - PoolVector<int> result; + Vector<int> result; result.resize(2); result.set(SEARCH_RESULT_COLUMN, col); result.set(SEARCH_RESULT_LINE, line); @@ -5458,7 +5458,7 @@ PoolVector<int> TextEdit::_search_bind(const String &p_key, uint32_t p_search_fl } else { - return PoolVector<int>(); + return Vector<int>(); } } diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index a849f62bc5..9986b80fd5 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -513,7 +513,7 @@ private: int _get_column_pos_of_word(const String &p_key, const String &p_search, uint32_t p_search_flags, int p_from_column); - PoolVector<int> _search_bind(const String &p_key, uint32_t p_search_flags, int p_from_line, int p_from_column) const; + Vector<int> _search_bind(const String &p_key, uint32_t p_search_flags, int p_from_line, int p_from_column) const; PopupMenu *menu; |