diff options
Diffstat (limited to 'editor/inspector_dock.cpp')
-rw-r--r-- | editor/inspector_dock.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 2729d9ecb5..3715547bdc 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -112,7 +112,7 @@ void InspectorDock::_menu_option(int p_option) { editor_data->get_undo_redo().clear_history(); - editor->get_editor_plugins_over()->edit(NULL); + editor->get_editor_plugins_over()->edit(nullptr); editor->get_editor_plugins_over()->edit(current); } break; @@ -140,7 +140,7 @@ void InspectorDock::_new_resource() { } void InspectorDock::_load_resource(const String &p_type) { - load_resource_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); + load_resource_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); List<String> extensions; ResourceLoader::get_recognized_extensions_for_type(p_type, &extensions); @@ -166,7 +166,7 @@ void InspectorDock::_resource_file_selected(String p_file) { void InspectorDock::_save_resource(bool save_as) const { ObjectID current = EditorNode::get_singleton()->get_editor_history()->get_current(); - Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : NULL; + Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : nullptr; ERR_FAIL_COND(!Object::cast_to<Resource>(current_obj)); @@ -180,7 +180,7 @@ void InspectorDock::_save_resource(bool save_as) const { void InspectorDock::_unref_resource() const { ObjectID current = EditorNode::get_singleton()->get_editor_history()->get_current(); - Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : NULL; + Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : nullptr; ERR_FAIL_COND(!Object::cast_to<Resource>(current_obj)); @@ -191,7 +191,7 @@ void InspectorDock::_unref_resource() const { void InspectorDock::_copy_resource() const { ObjectID current = EditorNode::get_singleton()->get_editor_history()->get_current(); - Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : NULL; + Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : nullptr; ERR_FAIL_COND(!Object::cast_to<Resource>(current_obj)); @@ -214,7 +214,7 @@ void InspectorDock::_prepare_history() { history_menu->get_popup()->clear(); - Ref<Texture2D> base_icon = get_icon("Object", "EditorIcons"); + Ref<Texture2D> base_icon = get_theme_icon("Object", "EditorIcons"); Set<ObjectID> already; for (int i = editor_history->get_history_len() - 1; i >= history_to; i--) { @@ -310,14 +310,14 @@ void InspectorDock::_property_keyed(const String &p_keyed, const Variant &p_valu } void InspectorDock::_transform_keyed(Object *sp, const String &p_sub, const Transform &p_key) { - Spatial *s = Object::cast_to<Spatial>(sp); + Node3D *s = Object::cast_to<Node3D>(sp); if (!s) return; AnimationPlayerEditor::singleton->get_track_editor()->insert_transform_key(s, p_sub, p_key); } void InspectorDock::_warning_pressed() { - warning_dialog->popup_centered_minsize(); + warning_dialog->popup_centered(); } Container *InspectorDock::get_addon_area() { @@ -328,15 +328,15 @@ void InspectorDock::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { set_theme(editor->get_gui_base()->get_theme()); - resource_new_button->set_icon(get_icon("New", "EditorIcons")); - resource_load_button->set_icon(get_icon("Load", "EditorIcons")); - resource_save_button->set_icon(get_icon("Save", "EditorIcons")); - backward_button->set_icon(get_icon("Back", "EditorIcons")); - forward_button->set_icon(get_icon("Forward", "EditorIcons")); - history_menu->set_icon(get_icon("History", "EditorIcons")); - object_menu->set_icon(get_icon("Tools", "EditorIcons")); - warning->set_icon(get_icon("NodeWarning", "EditorIcons")); - warning->add_color_override("font_color", get_color("warning_color", "Editor")); + resource_new_button->set_icon(get_theme_icon("New", "EditorIcons")); + resource_load_button->set_icon(get_theme_icon("Load", "EditorIcons")); + resource_save_button->set_icon(get_theme_icon("Save", "EditorIcons")); + backward_button->set_icon(get_theme_icon("Back", "EditorIcons")); + forward_button->set_icon(get_theme_icon("Forward", "EditorIcons")); + history_menu->set_icon(get_theme_icon("History", "EditorIcons")); + object_menu->set_icon(get_theme_icon("Tools", "EditorIcons")); + warning->set_icon(get_theme_icon("NodeWarning", "EditorIcons")); + warning->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")); } break; } } @@ -397,7 +397,7 @@ void InspectorDock::update(Object *p_object) { editor_path->set_disabled(true); editor_path->set_text(""); editor_path->set_tooltip(""); - editor_path->set_icon(NULL); + editor_path->set_icon(nullptr); return; } @@ -435,7 +435,7 @@ void InspectorDock::update(Object *p_object) { p->add_separator(); p->add_shortcut(ED_SHORTCUT("property_editor/make_subresources_unique", TTR("Make Sub-Resources Unique")), OBJECT_UNIQUE_RESOURCES); p->add_separator(); - p->add_icon_shortcut(get_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("property_editor/open_help", TTR("Open in Help")), OBJECT_REQUEST_HELP); + p->add_icon_shortcut(get_theme_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("property_editor/open_help", TTR("Open in Help")), OBJECT_REQUEST_HELP); } List<MethodInfo> methods; @@ -496,21 +496,21 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { resource_new_button = memnew(ToolButton); resource_new_button->set_tooltip(TTR("Create a new resource in memory and edit it.")); - resource_new_button->set_icon(get_icon("New", "EditorIcons")); + resource_new_button->set_icon(get_theme_icon("New", "EditorIcons")); general_options_hb->add_child(resource_new_button); resource_new_button->connect("pressed", callable_mp(this, &InspectorDock::_new_resource)); resource_new_button->set_focus_mode(Control::FOCUS_NONE); resource_load_button = memnew(ToolButton); resource_load_button->set_tooltip(TTR("Load an existing resource from disk and edit it.")); - resource_load_button->set_icon(get_icon("Load", "EditorIcons")); + resource_load_button->set_icon(get_theme_icon("Load", "EditorIcons")); general_options_hb->add_child(resource_load_button); resource_load_button->connect("pressed", callable_mp(this, &InspectorDock::_open_resource_selector)); resource_load_button->set_focus_mode(Control::FOCUS_NONE); resource_save_button = memnew(MenuButton); resource_save_button->set_tooltip(TTR("Save the currently edited resource.")); - resource_save_button->set_icon(get_icon("Save", "EditorIcons")); + resource_save_button->set_icon(get_theme_icon("Save", "EditorIcons")); general_options_hb->add_child(resource_save_button); resource_save_button->get_popup()->add_item(TTR("Save"), RESOURCE_SAVE); resource_save_button->get_popup()->add_item(TTR("Save As..."), RESOURCE_SAVE_AS); @@ -522,7 +522,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { backward_button = memnew(ToolButton); general_options_hb->add_child(backward_button); - backward_button->set_icon(get_icon("Back", "EditorIcons")); + backward_button->set_icon(get_theme_icon("Back", "EditorIcons")); backward_button->set_flat(true); backward_button->set_tooltip(TTR("Go to the previous edited object in history.")); backward_button->set_disabled(true); @@ -530,7 +530,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { forward_button = memnew(ToolButton); general_options_hb->add_child(forward_button); - forward_button->set_icon(get_icon("Forward", "EditorIcons")); + forward_button->set_icon(get_theme_icon("Forward", "EditorIcons")); forward_button->set_flat(true); forward_button->set_tooltip(TTR("Go to the next edited object in history.")); forward_button->set_disabled(true); @@ -538,9 +538,9 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { history_menu = memnew(MenuButton); history_menu->set_tooltip(TTR("History of recently edited objects.")); - history_menu->set_icon(get_icon("History", "EditorIcons")); + history_menu->set_icon(get_theme_icon("History", "EditorIcons")); general_options_hb->add_child(history_menu); - history_menu->connect("about_to_show", callable_mp(this, &InspectorDock::_prepare_history)); + history_menu->connect("about_to_popup", callable_mp(this, &InspectorDock::_prepare_history)); history_menu->get_popup()->connect("id_pressed", callable_mp(this, &InspectorDock::_select_history)); HBoxContainer *node_info_hb = memnew(HBoxContainer); @@ -551,7 +551,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { node_info_hb->add_child(editor_path); object_menu = memnew(MenuButton); - object_menu->set_icon(get_icon("Tools", "EditorIcons")); + object_menu->set_icon(get_theme_icon("Tools", "EditorIcons")); node_info_hb->add_child(object_menu); object_menu->set_tooltip(TTR("Object properties.")); object_menu->get_popup()->connect("id_pressed", callable_mp(this, &InspectorDock::_menu_option)); @@ -564,15 +564,15 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { search = memnew(LineEdit); search->set_h_size_flags(Control::SIZE_EXPAND_FILL); search->set_placeholder(TTR("Filter properties")); - search->set_right_icon(get_icon("Search", "EditorIcons")); + search->set_right_icon(get_theme_icon("Search", "EditorIcons")); search->set_clear_button_enabled(true); add_child(search); warning = memnew(Button); add_child(warning); warning->set_text(TTR("Changes may be lost!")); - warning->set_icon(get_icon("NodeWarning", "EditorIcons")); - warning->add_color_override("font_color", get_color("warning_color", "Editor")); + warning->set_icon(get_theme_icon("NodeWarning", "EditorIcons")); + warning->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")); warning->set_clip_text(true); warning->hide(); warning->connect("pressed", callable_mp(this, &InspectorDock::_warning_pressed)); |