summaryrefslogtreecommitdiff
path: root/editor/property_selector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/property_selector.cpp')
-rw-r--r--editor/property_selector.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index ede7b860d6..1960ecc604 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -96,7 +96,7 @@ void PropertySelector::_update_search() {
} else if (type != Variant::NIL) {
Variant v;
Callable::CallError ce;
- v = Variant::construct(type, NULL, 0, ce);
+ v = Variant::construct(type, nullptr, 0, ce);
v.get_property_list(&props);
} else {
@@ -116,43 +116,43 @@ void PropertySelector::_update_search() {
}
}
- TreeItem *category = NULL;
+ TreeItem *category = nullptr;
bool found = false;
Ref<Texture2D> type_icons[Variant::VARIANT_MAX] = {
- Control::get_icon("Variant", "EditorIcons"),
- Control::get_icon("bool", "EditorIcons"),
- Control::get_icon("int", "EditorIcons"),
- Control::get_icon("float", "EditorIcons"),
- Control::get_icon("String", "EditorIcons"),
- Control::get_icon("Vector2", "EditorIcons"),
- Control::get_icon("Rect2", "EditorIcons"),
- Control::get_icon("Vector3", "EditorIcons"),
- Control::get_icon("Transform2D", "EditorIcons"),
- Control::get_icon("Plane", "EditorIcons"),
- Control::get_icon("Quat", "EditorIcons"),
- Control::get_icon("AABB", "EditorIcons"),
- Control::get_icon("Basis", "EditorIcons"),
- Control::get_icon("Transform", "EditorIcons"),
- Control::get_icon("Color", "EditorIcons"),
- Control::get_icon("Path", "EditorIcons"),
- Control::get_icon("RID", "EditorIcons"),
- Control::get_icon("Object", "EditorIcons"),
- Control::get_icon("Dictionary", "EditorIcons"),
- Control::get_icon("Array", "EditorIcons"),
- Control::get_icon("PackedByteArray", "EditorIcons"),
- Control::get_icon("PackedInt32Array", "EditorIcons"),
- Control::get_icon("PackedFloat32Array", "EditorIcons"),
- Control::get_icon("PackedStringArray", "EditorIcons"),
- Control::get_icon("PackedVector2Array", "EditorIcons"),
- Control::get_icon("PackedVector3Array", "EditorIcons"),
- Control::get_icon("PackedColorArray", "EditorIcons")
+ search_options->get_theme_icon("Variant", "EditorIcons"),
+ search_options->get_theme_icon("bool", "EditorIcons"),
+ search_options->get_theme_icon("int", "EditorIcons"),
+ search_options->get_theme_icon("float", "EditorIcons"),
+ search_options->get_theme_icon("String", "EditorIcons"),
+ search_options->get_theme_icon("Vector2", "EditorIcons"),
+ search_options->get_theme_icon("Rect2", "EditorIcons"),
+ search_options->get_theme_icon("Vector3", "EditorIcons"),
+ search_options->get_theme_icon("Transform2D", "EditorIcons"),
+ search_options->get_theme_icon("Plane", "EditorIcons"),
+ search_options->get_theme_icon("Quat", "EditorIcons"),
+ search_options->get_theme_icon("AABB", "EditorIcons"),
+ search_options->get_theme_icon("Basis", "EditorIcons"),
+ search_options->get_theme_icon("Transform", "EditorIcons"),
+ search_options->get_theme_icon("Color", "EditorIcons"),
+ search_options->get_theme_icon("Path", "EditorIcons"),
+ search_options->get_theme_icon("RID", "EditorIcons"),
+ search_options->get_theme_icon("Object", "EditorIcons"),
+ search_options->get_theme_icon("Dictionary", "EditorIcons"),
+ search_options->get_theme_icon("Array", "EditorIcons"),
+ search_options->get_theme_icon("PackedByteArray", "EditorIcons"),
+ search_options->get_theme_icon("PackedInt32Array", "EditorIcons"),
+ search_options->get_theme_icon("PackedFloat32Array", "EditorIcons"),
+ search_options->get_theme_icon("PackedStringArray", "EditorIcons"),
+ search_options->get_theme_icon("PackedVector2Array", "EditorIcons"),
+ search_options->get_theme_icon("PackedVector3Array", "EditorIcons"),
+ search_options->get_theme_icon("PackedColorArray", "EditorIcons")
};
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
if (E->get().usage == PROPERTY_USAGE_CATEGORY) {
- if (category && category->get_children() == NULL) {
+ if (category && category->get_children() == nullptr) {
memdelete(category); //old category was unused
}
category = search_options->create_item(root);
@@ -161,7 +161,7 @@ void PropertySelector::_update_search() {
Ref<Texture2D> icon;
if (E->get().name == "Script Variables") {
- icon = get_icon("Script", "EditorIcons");
+ icon = search_options->get_theme_icon("Script", "EditorIcons");
} else {
icon = EditorNode::get_singleton()->get_class_icon(E->get().name);
}
@@ -191,7 +191,7 @@ void PropertySelector::_update_search() {
item->set_selectable(0, true);
}
- if (category && category->get_children() == NULL) {
+ if (category && category->get_children() == nullptr) {
memdelete(category); //old category was unused
}
} else {
@@ -201,7 +201,7 @@ void PropertySelector::_update_search() {
if (type != Variant::NIL) {
Variant v;
Callable::CallError ce;
- v = Variant::construct(type, NULL, 0, ce);
+ v = Variant::construct(type, nullptr, 0, ce);
v.get_method_list(&methods);
} else {
@@ -220,14 +220,14 @@ void PropertySelector::_update_search() {
}
}
- TreeItem *category = NULL;
+ TreeItem *category = nullptr;
bool found = false;
bool script_methods = false;
for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) {
if (E->get().name.begins_with("*")) {
- if (category && category->get_children() == NULL) {
+ if (category && category->get_children() == nullptr) {
memdelete(category); //old category was unused
}
category = search_options->create_item(root);
@@ -238,7 +238,7 @@ void PropertySelector::_update_search() {
script_methods = false;
String rep = E->get().name.replace("*", "");
if (E->get().name == "*Script Methods") {
- icon = get_icon("Script", "EditorIcons");
+ icon = search_options->get_theme_icon("Script", "EditorIcons");
script_methods = true;
} else {
icon = EditorNode::get_singleton()->get_class_icon(rep);
@@ -310,12 +310,12 @@ void PropertySelector::_update_search() {
}
}
- if (category && category->get_children() == NULL) {
+ if (category && category->get_children() == nullptr) {
memdelete(category); //old category was unused
}
}
- get_ok()->set_disabled(root->get_children() == NULL);
+ get_ok()->set_disabled(root->get_children() == nullptr);
}
void PropertySelector::_confirmed() {
@@ -390,7 +390,7 @@ void PropertySelector::_item_selected() {
}
void PropertySelector::_hide_requested() {
- _closed(); // From WindowDialog.
+ _cancel_pressed(); // From AcceptDialog.
}
void PropertySelector::_notification(int p_what) {
@@ -410,7 +410,7 @@ void PropertySelector::select_method_from_base_type(const String &p_base, const
type = Variant::NIL;
script = ObjectID();
properties = false;
- instance = NULL;
+ instance = nullptr;
virtuals_only = p_virtuals_only;
popup_centered_ratio(0.6);
@@ -427,7 +427,7 @@ void PropertySelector::select_method_from_script(const Ref<Script> &p_script, co
type = Variant::NIL;
script = p_script->get_instance_id();
properties = false;
- instance = NULL;
+ instance = nullptr;
virtuals_only = false;
popup_centered_ratio(0.6);
@@ -443,7 +443,7 @@ void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const
type = p_type;
script = ObjectID();
properties = false;
- instance = NULL;
+ instance = nullptr;
virtuals_only = false;
popup_centered_ratio(0.6);
@@ -464,7 +464,7 @@ void PropertySelector::select_method_from_instance(Object *p_instance, const Str
script = scr->get_instance_id();
}
properties = false;
- instance = NULL;
+ instance = nullptr;
virtuals_only = false;
popup_centered_ratio(0.6);
@@ -480,7 +480,7 @@ void PropertySelector::select_property_from_base_type(const String &p_base, cons
type = Variant::NIL;
script = ObjectID();
properties = true;
- instance = NULL;
+ instance = nullptr;
virtuals_only = false;
popup_centered_ratio(0.6);
@@ -498,7 +498,7 @@ void PropertySelector::select_property_from_script(const Ref<Script> &p_script,
type = Variant::NIL;
script = p_script->get_instance_id();
properties = true;
- instance = NULL;
+ instance = nullptr;
virtuals_only = false;
popup_centered_ratio(0.6);
@@ -515,7 +515,7 @@ void PropertySelector::select_property_from_basic_type(Variant::Type p_type, con
type = p_type;
script = ObjectID();
properties = true;
- instance = NULL;
+ instance = nullptr;
virtuals_only = false;
popup_centered_ratio(0.6);