diff options
Diffstat (limited to 'editor/property_editor.cpp')
-rw-r--r-- | editor/property_editor.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 061f4d218a..481ff1a781 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -482,7 +482,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: Vector<String> flags = hint_text.split(","); for (int i = 0; i < flags.size(); i++) { String flag = flags[i]; - if (flag == "") { + if (flag.is_empty()) { continue; } menu->add_check_item(flag, i); @@ -552,7 +552,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: add_child(create_dialog); } - if (hint_text != String()) { + if (!hint_text.is_empty()) { create_dialog->set_base_type(hint_text); } else { create_dialog->set_base_type("Object"); @@ -810,7 +810,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: //late init for performance color_picker = memnew(ColorPicker); color_picker->set_deferred_mode(true); - add_child(color_picker); + value_vbox->add_child(color_picker); color_picker->hide(); color_picker->connect("color_changed", callable_mp(this, &CustomPropertyEditor::_color_changed)); @@ -853,7 +853,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: if (p_name == "script" && hint_text == "Script" && Object::cast_to<Node>(owner)) { menu->add_item(TTR("New Script"), OBJ_MENU_NEW_SCRIPT); menu->add_separator(); - } else if (hint_text != "") { + } else if (!hint_text.is_empty()) { int idx = 0; Vector<EditorData::CustomType> custom_resources; @@ -933,7 +933,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: RES cb = EditorSettings::get_singleton()->get_resource_clipboard(); bool paste_valid = false; if (cb.is_valid()) { - if (hint_text == "") { + if (hint_text.is_empty()) { paste_valid = true; } else { for (int i = 0; i < hint_text.get_slice_count(","); i++) { @@ -1108,7 +1108,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) { return; } - if (hint == PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE && hint_text != String()) { + if (hint == PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE && !hint_text.is_empty()) { Node *node = get_node(hint_text); if (node) { Node *tonode = node->get_node(p_path); @@ -1191,7 +1191,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { file->clear_filters(); - if (hint_text != "") { + if (!hint_text.is_empty()) { Vector<String> extensions = hint_text.split(","); for (int i = 0; i < extensions.size(); i++) { String filter = extensions[i]; @@ -1410,7 +1410,7 @@ void CustomPropertyEditor::_draw_easing() { prev = h; } - f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), String::num(exp, 2), HALIGN_LEFT, -1, font_size, color); + f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), String::num(exp, 2), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color); } void CustomPropertyEditor::_text_edit_changed() { @@ -1864,7 +1864,7 @@ CustomPropertyEditor::CustomPropertyEditor() { slider->connect("value_changed", callable_mp(this, &CustomPropertyEditor::_range_modified)); action_hboxes = memnew(HBoxContainer); - action_hboxes->set_alignment(BoxContainer::ALIGN_CENTER); + action_hboxes->set_alignment(BoxContainer::ALIGNMENT_CENTER); value_vbox->add_child(action_hboxes); for (int i = 0; i < MAX_ACTION_BUTTONS; i++) { action_buttons[i] = memnew(Button); |