summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/create_dialog.cpp9
-rw-r--r--editor/doc_tools.cpp88
-rw-r--r--editor/editor_help.cpp94
-rw-r--r--editor/editor_help_search.cpp39
-rw-r--r--editor/editor_help_search.h2
-rw-r--r--editor/editor_node.cpp4
-rw-r--r--editor/editor_plugin.cpp4
-rw-r--r--editor/editor_plugin.h3
-rw-r--r--editor/editor_themes.cpp22
-rw-r--r--editor/icons/GuiResizerTopLeft.svg1
-rw-r--r--editor/icons/PreviewEnvironment.svg1
-rw-r--r--editor/icons/PreviewSun.svg1
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp4
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp36
-rw-r--r--editor/plugins/shader_editor_plugin.h4
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp10
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp6
-rw-r--r--editor/project_manager.cpp62
-rw-r--r--editor/project_manager.h3
21 files changed, 323 insertions, 74 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 4ac32d7317..3e72c6211d 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -296,6 +296,15 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, icon_fallback));
}
+ bool is_deprecated = EditorHelp::get_doc_data()->class_list[p_type].is_deprecated;
+ bool is_experimental = EditorHelp::get_doc_data()->class_list[p_type].is_experimental;
+
+ if (is_deprecated) {
+ r_item->add_button(0, get_theme_icon("StatusError", SNAME("EditorIcons")), 0, false, TTR("This class is marked as deprecated."));
+ } else if (is_experimental) {
+ r_item->add_button(0, get_theme_icon("NodeWarning", SNAME("EditorIcons")), 0, false, TTR("This class is marked as experimental."));
+ }
+
if (!search_box->get_text().is_empty()) {
r_item->set_collapsed(false);
} else {
diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp
index ec9a744e57..9f655ab00a 100644
--- a/editor/doc_tools.cpp
+++ b/editor/doc_tools.cpp
@@ -85,6 +85,9 @@ void DocTools::merge_from(const DocTools &p_data) {
const DocData::ClassDoc &cf = p_data.class_list[c.name];
+ c.is_deprecated = cf.is_deprecated;
+ c.is_experimental = cf.is_experimental;
+
c.description = cf.description;
c.brief_description = cf.brief_description;
c.tutorials = cf.tutorials;
@@ -133,6 +136,8 @@ void DocTools::merge_from(const DocTools &p_data) {
const DocData::MethodDoc &mf = cf.constructors[j];
m.description = mf.description;
+ m.is_deprecated = mf.is_deprecated;
+ m.is_experimental = mf.is_experimental;
break;
}
}
@@ -148,6 +153,8 @@ void DocTools::merge_from(const DocTools &p_data) {
const DocData::MethodDoc &mf = cf.methods[j];
m.description = mf.description;
+ m.is_deprecated = mf.is_deprecated;
+ m.is_experimental = mf.is_experimental;
break;
}
}
@@ -162,6 +169,8 @@ void DocTools::merge_from(const DocTools &p_data) {
const DocData::MethodDoc &mf = cf.signals[j];
m.description = mf.description;
+ m.is_deprecated = mf.is_deprecated;
+ m.is_experimental = mf.is_experimental;
break;
}
}
@@ -176,6 +185,8 @@ void DocTools::merge_from(const DocTools &p_data) {
const DocData::ConstantDoc &mf = cf.constants[j];
m.description = mf.description;
+ m.is_deprecated = mf.is_deprecated;
+ m.is_experimental = mf.is_experimental;
break;
}
}
@@ -190,6 +201,8 @@ void DocTools::merge_from(const DocTools &p_data) {
const DocData::MethodDoc &mf = cf.annotations[j];
m.description = mf.description;
+ m.is_deprecated = mf.is_deprecated;
+ m.is_experimental = mf.is_experimental;
break;
}
}
@@ -204,6 +217,8 @@ void DocTools::merge_from(const DocTools &p_data) {
const DocData::PropertyDoc &pf = cf.properties[j];
p.description = pf.description;
+ p.is_deprecated = pf.is_deprecated;
+ p.is_experimental = pf.is_experimental;
break;
}
}
@@ -266,6 +281,8 @@ void DocTools::merge_from(const DocTools &p_data) {
const DocData::MethodDoc &mf = cf.operators[j];
m.description = mf.description;
+ m.is_deprecated = mf.is_deprecated;
+ m.is_experimental = mf.is_experimental;
break;
}
}
@@ -1007,6 +1024,12 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> &
if (parser->has_attribute("qualifiers")) {
method.qualifiers = parser->get_attribute_value("qualifiers");
}
+ if (parser->has_attribute("is_deprecated")) {
+ method.is_deprecated = parser->get_attribute_value("is_deprecated").to_lower() == "true";
+ }
+ if (parser->has_attribute("is_experimental")) {
+ method.is_experimental = parser->get_attribute_value("is_experimental").to_lower() == "true";
+ }
while (parser->read() == OK) {
if (parser->get_node_type() == XMLParser::NODE_ELEMENT) {
@@ -1138,6 +1161,16 @@ Error DocTools::_load(Ref<XMLParser> parser) {
c.inherits = parser->get_attribute_value("inherits");
}
+ if (parser->has_attribute("is_deprecated")) {
+ String result = parser->get_attribute_value("is_deprecated");
+ c.is_deprecated = (result == "true" || result == "True" || result == "TRUE" || result == "1");
+ }
+
+ if (parser->has_attribute("is_experimental")) {
+ String result = parser->get_attribute_value("is_experimental");
+ c.is_experimental = (result == "true" || result == "True" || result == "TRUE" || result == "1");
+ }
+
while (parser->read() == OK) {
if (parser->get_node_type() == XMLParser::NODE_ELEMENT) {
String name2 = parser->get_node_name();
@@ -1211,6 +1244,12 @@ Error DocTools::_load(Ref<XMLParser> parser) {
if (parser->has_attribute("enum")) {
prop2.enumeration = parser->get_attribute_value("enum");
}
+ if (parser->has_attribute("is_deprecated")) {
+ prop2.is_deprecated = parser->get_attribute_value("is_deprecated").to_lower() == "true";
+ }
+ if (parser->has_attribute("is_experimental")) {
+ prop2.is_experimental = parser->get_attribute_value("is_experimental").to_lower() == "true";
+ }
if (!parser->is_empty()) {
parser->read();
if (parser->get_node_type() == XMLParser::NODE_TEXT) {
@@ -1275,6 +1314,14 @@ Error DocTools::_load(Ref<XMLParser> parser) {
if (parser->has_attribute("is_bitfield")) {
constant2.is_bitfield = parser->get_attribute_value("is_bitfield").to_lower() == "true";
}
+ if (parser->has_attribute("is_deprecated")) {
+ String result = parser->get_attribute_value("is_deprecated");
+ constant2.is_deprecated = (result == "true" || result == "True" || result == "TRUE" || result == "1");
+ }
+ if (parser->has_attribute("is_experimental")) {
+ String result = parser->get_attribute_value("is_experimental");
+ constant2.is_experimental = (result == "true" || result == "True" || result == "TRUE" || result == "1");
+ }
if (!parser->is_empty()) {
parser->read();
if (parser->get_node_type() == XMLParser::NODE_TEXT) {
@@ -1327,7 +1374,15 @@ static void _write_method_doc(Ref<FileAccess> f, const String &p_name, Vector<Do
qualifiers += " qualifiers=\"" + m.qualifiers.xml_escape() + "\"";
}
- _write_string(f, 2, "<" + p_name + " name=\"" + m.name.xml_escape() + "\"" + qualifiers + ">");
+ String additional_attributes;
+ if (m.is_deprecated) {
+ additional_attributes += " is_deprecated=\"True\"";
+ }
+ if (m.is_experimental) {
+ additional_attributes += " is_experimental=\"True\"";
+ }
+
+ _write_string(f, 2, "<" + p_name + " name=\"" + m.name.xml_escape() + "\"" + qualifiers + additional_attributes + ">");
if (!m.return_type.is_empty()) {
String enum_text;
@@ -1390,6 +1445,12 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
String header = "<class name=\"" + c.name + "\"";
if (!c.inherits.is_empty()) {
header += " inherits=\"" + c.inherits + "\"";
+ if (c.is_deprecated) {
+ header += " is_deprecated=\"True\"";
+ }
+ if (c.is_experimental) {
+ header += " is_experimental=\"True\"";
+ }
}
header += String(" version=\"") + VERSION_BRANCH + "\"";
// Reference the XML schema so editors can provide error checking.
@@ -1433,6 +1494,12 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
if (!c.properties[i].default_value.is_empty()) {
additional_attributes += " default=\"" + c.properties[i].default_value.xml_escape(true) + "\"";
}
+ if (c.properties[i].is_deprecated) {
+ additional_attributes += " is_deprecated=\"True\"";
+ }
+ if (c.properties[i].is_experimental) {
+ additional_attributes += " is_experimental=\"True\"";
+ }
const DocData::PropertyDoc &p = c.properties[i];
@@ -1453,21 +1520,30 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
_write_string(f, 1, "<constants>");
for (int i = 0; i < c.constants.size(); i++) {
const DocData::ConstantDoc &k = c.constants[i];
+
+ String additional_attributes;
+ if (c.constants[i].is_deprecated) {
+ additional_attributes += " is_deprecated=\"True\"";
+ }
+ if (c.constants[i].is_experimental) {
+ additional_attributes += " is_experimental=\"True\"";
+ }
+
if (k.is_value_valid) {
if (!k.enumeration.is_empty()) {
if (k.is_bitfield) {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\" is_bitfield=\"true\">");
+ _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\" is_bitfield=\"true\"" + additional_attributes + ">");
} else {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\">");
+ _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\"" + additional_attributes + ">");
}
} else {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\">");
+ _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\"" + additional_attributes + ">");
}
} else {
if (!k.enumeration.is_empty()) {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"platform-dependent\" enum=\"" + k.enumeration + "\">");
+ _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"platform-dependent\" enum=\"" + k.enumeration + "\"" + additional_attributes + ">");
} else {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"platform-dependent\">");
+ _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"platform-dependent\"" + additional_attributes + ">");
}
}
_write_string(f, 3, _translate_doc_string(k.description).strip_edges().xml_escape());
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index b8f115e82e..745dcdd04c 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -276,6 +276,23 @@ String EditorHelp::_fix_constant(const String &p_constant) const {
return p_constant;
}
+// Macros for assigning the deprecation/experimental information to class members
+#define DEPRECATED_DOC_TAG \
+ class_desc->push_color(get_theme_color(SNAME("error_color"), SNAME("Editor"))); \
+ Ref<Texture2D> error_icon = get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")); \
+ class_desc->add_text(" "); \
+ class_desc->add_image(error_icon, error_icon->get_width(), error_icon->get_height()); \
+ class_desc->add_text(" (" + TTR("Deprecated") + ")"); \
+ class_desc->pop();
+
+#define EXPERIMENTAL_DOC_TAG \
+ class_desc->push_color(get_theme_color(SNAME("warning_color"), SNAME("Editor"))); \
+ Ref<Texture2D> warning_icon = get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")); \
+ class_desc->add_text(" "); \
+ class_desc->add_image(warning_icon, warning_icon->get_width(), warning_icon->get_height()); \
+ class_desc->add_text(" (" + TTR("Experimental") + ")"); \
+ class_desc->pop();
+
void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview) {
method_line[p_method.name] = class_desc->get_paragraph_count() - 2; //gets overridden if description
@@ -356,6 +373,14 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
class_desc->pop();
}
+ if (p_method.is_deprecated) {
+ DEPRECATED_DOC_TAG;
+ }
+
+ if (p_method.is_experimental) {
+ EXPERIMENTAL_DOC_TAG;
+ }
+
if (p_overview) {
class_desc->pop(); //cell
}
@@ -565,6 +590,17 @@ void EditorHelp::_update_doc() {
class_desc->pop(); // color
class_desc->pop(); // font size
class_desc->pop(); // font
+
+ if (cd.is_deprecated) {
+ class_desc->add_text(" ");
+ Ref<Texture2D> error_icon = get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons"));
+ class_desc->add_image(error_icon, error_icon->get_width(), error_icon->get_height());
+ }
+ if (cd.is_experimental) {
+ class_desc->add_text(" ");
+ Ref<Texture2D> warning_icon = get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"));
+ class_desc->add_image(warning_icon, warning_icon->get_width(), warning_icon->get_height());
+ }
class_desc->add_newline();
const String non_breaking_space = String::chr(160);
@@ -627,6 +663,26 @@ void EditorHelp::_update_doc() {
}
}
+ // Note if deprecated.
+ if (cd.is_deprecated) {
+ Ref<Texture2D> error_icon = get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons"));
+ class_desc->push_color(get_theme_color(SNAME("error_color"), SNAME("Editor")));
+ class_desc->add_image(error_icon, error_icon->get_width(), error_icon->get_height());
+ class_desc->add_text(String(" ") + TTR("This class is marked as deprecated. It will be removed in future versions."));
+ class_desc->pop();
+ class_desc->add_newline();
+ }
+
+ // Note if experimental.
+ if (cd.is_experimental) {
+ Ref<Texture2D> warning_icon = get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"));
+ class_desc->push_color(get_theme_color(SNAME("warning_color"), SNAME("Editor")));
+ class_desc->add_image(warning_icon, warning_icon->get_width(), warning_icon->get_height());
+ class_desc->add_text(String(" ") + TTR("This class is marked as experimental. It is subject to likely change or possible removal in future versions. Use at your own discretion."));
+ class_desc->pop();
+ class_desc->add_newline();
+ }
+
class_desc->add_newline();
class_desc->add_newline();
@@ -817,6 +873,13 @@ void EditorHelp::_update_doc() {
class_desc->pop();
}
+ if (cd.properties[i].is_deprecated) {
+ DEPRECATED_DOC_TAG;
+ }
+ if (cd.properties[i].is_experimental) {
+ EXPERIMENTAL_DOC_TAG;
+ }
+
class_desc->pop();
class_desc->pop(); // cell
@@ -1066,6 +1129,14 @@ void EditorHelp::_update_doc() {
class_desc->push_color(symbol_color);
class_desc->add_text(")");
+
+ if (cd.signals[i].is_deprecated) {
+ DEPRECATED_DOC_TAG;
+ }
+ if (cd.signals[i].is_experimental) {
+ EXPERIMENTAL_DOC_TAG;
+ }
+
class_desc->pop();
class_desc->pop(); // end monofont
if (!cd.signals[i].description.strip_edges().is_empty()) {
@@ -1187,6 +1258,14 @@ void EditorHelp::_update_doc() {
class_desc->pop();
class_desc->pop();
+ if (enum_list[i].is_deprecated) {
+ DEPRECATED_DOC_TAG;
+ }
+
+ if (enum_list[i].is_experimental) {
+ EXPERIMENTAL_DOC_TAG;
+ }
+
class_desc->add_newline();
if (!enum_list[i].description.strip_edges().is_empty()) {
@@ -1258,6 +1337,14 @@ void EditorHelp::_update_doc() {
class_desc->pop();
+ if (constants[i].is_deprecated) {
+ DEPRECATED_DOC_TAG;
+ }
+
+ if (constants[i].is_experimental) {
+ EXPERIMENTAL_DOC_TAG;
+ }
+
class_desc->add_newline();
if (!constants[i].description.strip_edges().is_empty()) {
@@ -1438,6 +1525,13 @@ void EditorHelp::_update_doc() {
class_desc->pop(); // color
}
+ if (cd.properties[i].is_deprecated) {
+ DEPRECATED_DOC_TAG;
+ }
+ if (cd.properties[i].is_experimental) {
+ EXPERIMENTAL_DOC_TAG;
+ }
+
if (cd.is_script_doc && (!cd.properties[i].setter.is_empty() || !cd.properties[i].getter.is_empty())) {
class_desc->push_color(symbol_color);
class_desc->add_text(" [" + TTR("property:") + " ");
diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp
index af0cff9ad6..7e7d7ca418 100644
--- a/editor/editor_help_search.cpp
+++ b/editor/editor_help_search.cpp
@@ -326,6 +326,7 @@ bool EditorHelpSearch::Runner::_phase_match_classes_init() {
bool EditorHelpSearch::Runner::_phase_match_classes() {
DocData::ClassDoc &class_doc = iterator_doc->value;
if (class_doc.name.is_empty()) {
+ ++iterator_doc;
return false;
}
if (!_is_class_disabled_by_feature_profile(class_doc.name)) {
@@ -432,7 +433,7 @@ bool EditorHelpSearch::Runner::_phase_class_items_init() {
bool EditorHelpSearch::Runner::_phase_class_items() {
if (!iterator_match) {
- return false;
+ return true;
}
ClassMatch &match = iterator_match->value;
@@ -459,10 +460,8 @@ bool EditorHelpSearch::Runner::_phase_member_items_init() {
bool EditorHelpSearch::Runner::_phase_member_items() {
ClassMatch &match = iterator_match->value;
- if (!match.doc) {
- return false;
- }
- if (match.doc->name.is_empty()) {
+ if (!match.doc || match.doc->name.is_empty()) {
+ ++iterator_match;
return false;
}
@@ -599,6 +598,14 @@ TreeItem *EditorHelpSearch::Runner::_create_class_item(TreeItem *p_parent, const
item->set_custom_color(1, disabled_color);
}
+ if (p_doc->is_deprecated) {
+ Ref<Texture2D> error_icon = ui_service->get_theme_icon("StatusError", SNAME("EditorIcons"));
+ item->add_button(0, error_icon, 0, false, TTR("This class is marked as deprecated."));
+ } else if (p_doc->is_experimental) {
+ Ref<Texture2D> warning_icon = ui_service->get_theme_icon("NodeWarning", SNAME("EditorIcons"));
+ item->add_button(0, warning_icon, 0, false, TTR("This class is marked as experimental."));
+ }
+
_match_item(item, p_doc->name);
return item;
@@ -606,37 +613,37 @@ TreeItem *EditorHelpSearch::Runner::_create_class_item(TreeItem *p_parent, const
TreeItem *EditorHelpSearch::Runner::_create_method_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const String &p_text, const DocData::MethodDoc *p_doc) {
String tooltip = _build_method_tooltip(p_class_doc, p_doc);
- return _create_member_item(p_parent, p_class_doc->name, "MemberMethod", p_doc->name, p_text, TTRC("Method"), "method", tooltip);
+ return _create_member_item(p_parent, p_class_doc->name, "MemberMethod", p_doc->name, p_text, TTRC("Method"), "method", tooltip, p_doc->is_deprecated, p_doc->is_experimental);
}
TreeItem *EditorHelpSearch::Runner::_create_signal_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::MethodDoc *p_doc) {
String tooltip = _build_method_tooltip(p_class_doc, p_doc);
- return _create_member_item(p_parent, p_class_doc->name, "MemberSignal", p_doc->name, p_doc->name, TTRC("Signal"), "signal", tooltip);
+ return _create_member_item(p_parent, p_class_doc->name, "MemberSignal", p_doc->name, p_doc->name, TTRC("Signal"), "signal", tooltip, p_doc->is_deprecated, p_doc->is_experimental);
}
TreeItem *EditorHelpSearch::Runner::_create_annotation_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const String &p_text, const DocData::MethodDoc *p_doc) {
String tooltip = _build_method_tooltip(p_class_doc, p_doc);
- return _create_member_item(p_parent, p_class_doc->name, "MemberAnnotation", p_doc->name, p_text, TTRC("Annotation"), "annotation", tooltip);
+ return _create_member_item(p_parent, p_class_doc->name, "MemberAnnotation", p_doc->name, p_text, TTRC("Annotation"), "annotation", tooltip, p_doc->is_deprecated, p_doc->is_experimental);
}
TreeItem *EditorHelpSearch::Runner::_create_constant_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::ConstantDoc *p_doc) {
String tooltip = p_class_doc->name + "." + p_doc->name;
- return _create_member_item(p_parent, p_class_doc->name, "MemberConstant", p_doc->name, p_doc->name, TTRC("Constant"), "constant", tooltip);
+ return _create_member_item(p_parent, p_class_doc->name, "MemberConstant", p_doc->name, p_doc->name, TTRC("Constant"), "constant", tooltip, p_doc->is_deprecated, p_doc->is_experimental);
}
TreeItem *EditorHelpSearch::Runner::_create_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::PropertyDoc *p_doc) {
String tooltip = p_doc->type + " " + p_class_doc->name + "." + p_doc->name;
tooltip += "\n " + p_class_doc->name + "." + p_doc->setter + "(value) setter";
tooltip += "\n " + p_class_doc->name + "." + p_doc->getter + "() getter";
- return _create_member_item(p_parent, p_class_doc->name, "MemberProperty", p_doc->name, p_doc->name, TTRC("Property"), "property", tooltip);
+ return _create_member_item(p_parent, p_class_doc->name, "MemberProperty", p_doc->name, p_doc->name, TTRC("Property"), "property", tooltip, p_doc->is_deprecated, p_doc->is_experimental);
}
TreeItem *EditorHelpSearch::Runner::_create_theme_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::ThemeItemDoc *p_doc) {
String tooltip = p_doc->type + " " + p_class_doc->name + "." + p_doc->name;
- return _create_member_item(p_parent, p_class_doc->name, "MemberTheme", p_doc->name, p_doc->name, TTRC("Theme Property"), "theme_item", tooltip);
+ return _create_member_item(p_parent, p_class_doc->name, "MemberTheme", p_doc->name, p_doc->name, TTRC("Theme Property"), "theme_item", tooltip, false, false);
}
-TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, const String &p_class_name, const String &p_icon, const String &p_name, const String &p_text, const String &p_type, const String &p_metatype, const String &p_tooltip) {
+TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, const String &p_class_name, const String &p_icon, const String &p_name, const String &p_text, const String &p_type, const String &p_metatype, const String &p_tooltip, bool is_deprecated, bool is_experimental) {
Ref<Texture2D> icon;
String text;
if (search_flags & SEARCH_SHOW_HIERARCHY) {
@@ -655,6 +662,14 @@ TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, cons
item->set_tooltip_text(1, p_tooltip);
item->set_metadata(0, "class_" + p_metatype + ":" + p_class_name + ":" + p_name);
+ if (is_deprecated) {
+ Ref<Texture2D> error_icon = ui_service->get_theme_icon("StatusError", SNAME("EditorIcons"));
+ item->add_button(0, error_icon, 0, false, TTR("This member is marked as deprecated."));
+ } else if (is_experimental) {
+ Ref<Texture2D> warning_icon = ui_service->get_theme_icon("NodeWarning", SNAME("EditorIcons"));
+ item->add_button(0, warning_icon, 0, false, TTR("This member is marked as experimental."));
+ }
+
_match_item(item, p_name);
return item;
diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h
index 26abaec6e6..efd8645cd7 100644
--- a/editor/editor_help_search.h
+++ b/editor/editor_help_search.h
@@ -155,7 +155,7 @@ class EditorHelpSearch::Runner : public RefCounted {
TreeItem *_create_constant_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::ConstantDoc *p_doc);
TreeItem *_create_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::PropertyDoc *p_doc);
TreeItem *_create_theme_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::ThemeItemDoc *p_doc);
- TreeItem *_create_member_item(TreeItem *p_parent, const String &p_class_name, const String &p_icon, const String &p_name, const String &p_text, const String &p_type, const String &p_metatype, const String &p_tooltip);
+ TreeItem *_create_member_item(TreeItem *p_parent, const String &p_class_name, const String &p_icon, const String &p_name, const String &p_text, const String &p_type, const String &p_metatype, const String &p_tooltip, bool is_deprecated, bool is_experimental);
public:
bool work(uint64_t slot = 100000);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index b00127f5b1..9dc4c2c953 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -7601,8 +7601,8 @@ EditorPlugin::AfterGUIInput EditorPluginList::forward_spatial_gui_input(Camera3D
if (current_after == EditorPlugin::AFTER_GUI_INPUT_STOP) {
after = EditorPlugin::AFTER_GUI_INPUT_STOP;
}
- if (after != EditorPlugin::AFTER_GUI_INPUT_STOP && current_after == EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
- after = EditorPlugin::AFTER_GUI_INPUT_DESELECT;
+ if (after != EditorPlugin::AFTER_GUI_INPUT_STOP && current_after == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
+ after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
}
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index f3ac8f4ba0..981dad2d2a 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -972,6 +972,10 @@ void EditorPlugin::_bind_methods() {
BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_UR);
BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_BR);
BIND_ENUM_CONSTANT(DOCK_SLOT_MAX);
+
+ BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_PASS);
+ BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_STOP);
+ BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_CUSTOM);
}
Ref<EditorUndoRedoManager> EditorPlugin::get_undo_redo() {
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index fe01524bea..a048b174e4 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -204,7 +204,7 @@ public:
enum AfterGUIInput {
AFTER_GUI_INPUT_PASS,
AFTER_GUI_INPUT_STOP,
- AFTER_GUI_INPUT_DESELECT
+ AFTER_GUI_INPUT_CUSTOM
};
//TODO: send a resource for editing to the editor node?
@@ -312,6 +312,7 @@ public:
VARIANT_ENUM_CAST(EditorPlugin::CustomControlContainer);
VARIANT_ENUM_CAST(EditorPlugin::DockSlot);
+VARIANT_ENUM_CAST(EditorPlugin::AfterGUIInput);
typedef EditorPlugin *(*EditorPluginCreateFunc)();
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 64ddecc588..edbd2dd62f 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -191,25 +191,6 @@ static Ref<StyleBoxLine> make_line_stylebox(Color p_color, int p_thickness = 1,
return style;
}
-static Ref<Texture2D> flip_icon(Ref<Texture2D> p_texture, bool p_flip_y = false, bool p_flip_x = false) {
- if (!p_flip_y && !p_flip_x) {
- return p_texture;
- }
-
- Ref<Image> img = p_texture->get_image();
- ERR_FAIL_NULL_V(img, Ref<Texture2D>());
- img = img->duplicate();
-
- if (p_flip_y) {
- img->flip_y();
- }
- if (p_flip_x) {
- img->flip_x();
- }
-
- return ImageTexture::create_from_image(img);
-}
-
#ifdef MODULE_SVG_ENABLED
// See also `generate_icon()` in `scene/resources/default_theme.cpp`.
static Ref<ImageTexture> editor_generate_icon(int p_index, float p_scale, float p_saturation, const HashMap<Color, Color> &p_convert_colors = HashMap<Color, Color>()) {
@@ -1567,14 +1548,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("camera", "GraphEditMinimap", style_minimap_camera);
theme->set_stylebox("node", "GraphEditMinimap", style_minimap_node);
- Ref<Texture2D> minimap_resizer_icon = theme->get_icon(SNAME("GuiResizer"), SNAME("EditorIcons"));
Color minimap_resizer_color;
if (dark_theme) {
minimap_resizer_color = Color(1, 1, 1, 0.65);
} else {
minimap_resizer_color = Color(0, 0, 0, 0.65);
}
- theme->set_icon("resizer", "GraphEditMinimap", flip_icon(minimap_resizer_icon, true, true));
+ theme->set_icon("resizer", "GraphEditMinimap", theme->get_icon(SNAME("GuiResizerTopLeft"), SNAME("EditorIcons")));
theme->set_color("resizer_color", "GraphEditMinimap", minimap_resizer_color);
// GraphNode
diff --git a/editor/icons/GuiResizerTopLeft.svg b/editor/icons/GuiResizerTopLeft.svg
new file mode 100644
index 0000000000..a67c2c0722
--- /dev/null
+++ b/editor/icons/GuiResizerTopLeft.svg
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m4 12c.55228 0 1-.44772 1-1v-6h6c.55228 0 1-.44772 1-1s-.44772-1-1-1h-7c-.55226.000055-.99994.44774-1 1v7c0 .55228.44772 1 1 1z" fill="#fff" fill-opacity=".58824"/></svg>
diff --git a/editor/icons/PreviewEnvironment.svg b/editor/icons/PreviewEnvironment.svg
new file mode 100644
index 0000000000..e0b0257daf
--- /dev/null
+++ b/editor/icons/PreviewEnvironment.svg
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 1a7 7 0 0 0 -7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0 -7-7zm-1.7305 2.3125c-.83125 1.5372-1.2685 3.1037-1.2695 4.6816-.64057-.11251-1.3005-.27158-1.9766-.47266a5 5 0 0 1 3.2461-4.209zm3.4629.00391a5 5 0 0 1 3.2383 4.1875c-.65187.17448-1.3077.32867-1.9727.44922-.0084-1.5627-.44294-3.1141-1.2656-4.6367zm-1.7324.0078088c1.0126 1.593 1.5 3.1425 1.5 4.6758 0 .054042-.00662.10803-.00781.16211-.96392.096801-1.9566.1103-2.9844.027344-.00163-.063192-.00781-.12632-.00781-.18945 0-1.5333.48744-3.0828 1.5-4.6758zm4.8789 5.7578a5 5 0 0 1 -3.1484 3.6055002c.57106-1.0564.95277-2.1268 1.1367-3.2051002.68204-.10905 1.3556-.23789 2.0117-.40039zm-9.7461.033203c.68377.18153 1.3555.33345 2.0098.43164.18781 1.0551002.56647 2.1026002 1.125 3.1367002a5 5 0 0 1 -3.1348-3.5684002zm6.168.55469c-.22615.9886602-.65424 1.9884002-1.3008 3.0059002-.63811-1.0042-1.0645-1.9908-1.293-2.9668002.89027.054126 1.7517.029377 2.5938-.039062z"/><path d="m8 1v2.3242c1.0126 1.593 1.5 3.1425 1.5 4.6758 0 .054042-.00662.10803-.00781.16211-.4894.049148-.98713.077552-1.4922.082031v1.4922c.43915-.0076.87287-.031628 1.3008-.066406-.22615.98866-.65424 1.9884-1.3008 3.0059v2.3242a7 7 0 0 0 7.000001-7 7 7 0 0 0 -7.000001-7zm1.7324 2.3164a5 5 0 0 1 3.2383 4.1875c-.65187.17448-1.3077.32867-1.9727.44922-.00845-1.5627-.44294-3.1141-1.2656-4.6367zm3.1465 5.7656a5 5 0 0 1 -3.1484 3.6055c.57106-1.0564.95277-2.1268 1.1367-3.2051.68204-.10905 1.3556-.23789 2.0117-.40039z"/></g></svg>
diff --git a/editor/icons/PreviewSun.svg b/editor/icons/PreviewSun.svg
new file mode 100644
index 0000000000..a8c652be65
--- /dev/null
+++ b/editor/icons/PreviewSun.svg
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m7 1v3h2v-3zm-2.5352 2.0508-1.4141 1.4141 1.4141 1.4141 1.4141-1.4141zm7.0703 0-1.4141 1.4141 1.4141 1.4141 1.4141-1.4141zm-3.5352 1.9492c-1.6569 0-3 1.3432-3 3s1.3431 3 3 3 3-1.3432 3-3-1.3431-3-3-3zm-7 2v2h3v-2zm11 0v2h3v-2zm-7.5352 3.1211-1.4141 1.4141 1.4141 1.4141 1.4141-1.4141zm7.0703 0-1.4141 1.4141 1.4141 1.4141 1.4141-1.4141zm-4.5352 1.8789v3h2v-3z" fill="#e0e0e0"/></svg>
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index f1e6c70549..f4b8646e18 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -907,6 +907,10 @@ void AnimationNodeBlendTreeEditor::_bind_methods() {
AnimationNodeBlendTreeEditor *AnimationNodeBlendTreeEditor::singleton = nullptr;
void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<AnimationNode> p_node) {
+ if (blend_tree.is_null()) {
+ return;
+ }
+
String prev_name = blend_tree->get_node_name(p_node);
ERR_FAIL_COND(prev_name.is_empty());
GraphNode *gn = Object::cast_to<GraphNode>(graph->get_node(prev_name));
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 436113093f..3c9486cdaa 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -648,7 +648,7 @@ void EditorAssetLibrary::shortcut_input(const Ref<InputEvent> &p_event) {
const Ref<InputEventKey> key = p_event;
if (key.is_valid() && key->is_pressed()) {
- if (key->is_match(InputEventKey::create_reference(KeyModifierMask::CMD_OR_CTRL | Key::F))) {
+ if (key->is_match(InputEventKey::create_reference(KeyModifierMask::CMD_OR_CTRL | Key::F)) && is_visible_in_tree()) {
filter->grab_focus();
filter->select_all();
accept_event();
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 6c3ce20d7a..c8b49678d2 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1360,8 +1360,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
return;
}
- if (discard == EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
- after = EditorPlugin::AFTER_GUI_INPUT_DESELECT;
+ if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
+ after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
}
}
@@ -1373,8 +1373,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
return;
}
- if (discard == EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
- after = EditorPlugin::AFTER_GUI_INPUT_DESELECT;
+ if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
+ after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
}
}
@@ -1601,7 +1601,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
- if (after != EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
+ if (after != EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
//clicking is always deferred to either move or release
clicked = _select_ray(b->get_position());
selection_in_progress = true;
@@ -1622,7 +1622,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
- if (after != EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
+ if (after != EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
selection_in_progress = false;
if (clicked.is_valid()) {
@@ -5516,8 +5516,8 @@ Dictionary Node3DEditor::get_state() const {
pd["sun_color"] = sun_color->get_pick_color();
pd["sun_energy"] = sun_energy->get_value();
- pd["sun_disabled"] = sun_button->is_pressed();
- pd["environ_disabled"] = environ_button->is_pressed();
+ pd["sun_enabled"] = sun_button->is_pressed();
+ pd["environ_enabled"] = environ_button->is_pressed();
d["preview_sun_env"] = pd;
}
@@ -5648,8 +5648,8 @@ void Node3DEditor::set_state(const Dictionary &p_state) {
sun_color->set_pick_color(pd["sun_color"]);
sun_energy->set_value(pd["sun_energy"]);
- sun_button->set_pressed(pd["sun_disabled"]);
- environ_button->set_pressed(pd["environ_disabled"]);
+ sun_button->set_pressed(pd["sun_enabled"]);
+ environ_button->set_pressed(pd["environ_enabled"]);
sun_environ_updating = false;
@@ -5657,8 +5657,8 @@ void Node3DEditor::set_state(const Dictionary &p_state) {
_update_preview_environment();
} else {
_load_default_preview_settings();
- sun_button->set_pressed(false);
- environ_button->set_pressed(false);
+ sun_button->set_pressed(true);
+ environ_button->set_pressed(true);
_preview_settings_changed();
_update_preview_environment();
}
@@ -7159,8 +7159,8 @@ void Node3DEditor::_update_theme() {
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels3Alt"), SNAME("EditorIcons")));
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon(SNAME("Panels4"), SNAME("EditorIcons")));
- sun_button->set_icon(get_theme_icon(SNAME("DirectionalLight3D"), SNAME("EditorIcons")));
- environ_button->set_icon(get_theme_icon(SNAME("WorldEnvironment"), SNAME("EditorIcons")));
+ sun_button->set_icon(get_theme_icon(SNAME("PreviewSun"), SNAME("EditorIcons")));
+ environ_button->set_icon(get_theme_icon(SNAME("PreviewEnvironment"), SNAME("EditorIcons")));
sun_environ_settings->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
sun_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
@@ -7636,7 +7636,7 @@ void Node3DEditor::_load_default_preview_settings() {
}
void Node3DEditor::_update_preview_environment() {
- bool disable_light = directional_light_count > 0 || sun_button->is_pressed();
+ bool disable_light = directional_light_count > 0 || !sun_button->is_pressed();
sun_button->set_disabled(directional_light_count > 0);
@@ -7664,7 +7664,7 @@ void Node3DEditor::_update_preview_environment() {
sun_angle_altitude->set_value(-Math::rad_to_deg(sun_rotation.x));
sun_angle_azimuth->set_value(180.0 - Math::rad_to_deg(sun_rotation.y));
- bool disable_env = world_env_count > 0 || environ_button->is_pressed();
+ bool disable_env = world_env_count > 0 || !environ_button->is_pressed();
environ_button->set_disabled(world_env_count > 0);
@@ -7855,6 +7855,8 @@ Node3DEditor::Node3DEditor() {
sun_button->set_flat(true);
sun_button->connect("pressed", callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED);
sun_button->set_disabled(true);
+ // Preview is enabled by default - ensure this applies on editor startup when there is no state yet.
+ sun_button->set_pressed(true);
main_menu_hbox->add_child(sun_button);
@@ -7864,6 +7866,8 @@ Node3DEditor::Node3DEditor() {
environ_button->set_flat(true);
environ_button->connect("pressed", callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED);
environ_button->set_disabled(true);
+ // Preview is enabled by default - ensure this applies on editor startup when there is no state yet.
+ environ_button->set_pressed(true);
main_menu_hbox->add_child(environ_button);
diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h
index afd38ef71a..f48b2fc70e 100644
--- a/editor/plugins/shader_editor_plugin.h
+++ b/editor/plugins/shader_editor_plugin.h
@@ -115,8 +115,8 @@ public:
ShaderTextEditor();
};
-class ShaderEditor : public PanelContainer {
- GDCLASS(ShaderEditor, PanelContainer);
+class ShaderEditor : public MarginContainer {
+ GDCLASS(ShaderEditor, MarginContainer);
enum {
EDIT_UNDO,
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp
index 3c75ac6ca6..2478ac9514 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_3d_editor_plugin.cpp
@@ -1143,7 +1143,7 @@ EditorPlugin::AfterGUIInput Skeleton3DEditorPlugin::forward_spatial_gui_input(Ca
se->update_bone_original();
}
}
- return EditorPlugin::AFTER_GUI_INPUT_DESELECT;
+ return EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
return EditorPlugin::AFTER_GUI_INPUT_PASS;
}
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index 761140b2d5..336ce9e4c8 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -1124,6 +1124,8 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
set_up_password->connect(SNAME("text_changed"), callable_mp(this, &VersionControlEditorPlugin::_update_set_up_warning));
set_up_password_input->add_child(set_up_password);
+ const String home_dir = OS::get_singleton()->has_environment("HOME") ? OS::get_singleton()->get_environment("HOME") : OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS);
+
HBoxContainer *set_up_ssh_public_key_input = memnew(HBoxContainer);
set_up_ssh_public_key_input->set_h_size_flags(Control::SIZE_EXPAND_FILL);
set_up_settings_vbc->add_child(set_up_ssh_public_key_input);
@@ -1147,10 +1149,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
set_up_ssh_public_key_file_dialog->set_access(FileDialog::ACCESS_FILESYSTEM);
set_up_ssh_public_key_file_dialog->set_file_mode(FileDialog::FILE_MODE_OPEN_FILE);
set_up_ssh_public_key_file_dialog->set_show_hidden_files(true);
- // TODO: Make this start at the user's home folder
- Ref<DirAccess> d = DirAccess::open(OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS));
- d->change_dir("../");
- set_up_ssh_public_key_file_dialog->set_current_dir(d->get_current_dir());
+ set_up_ssh_public_key_file_dialog->set_current_dir(home_dir);
set_up_ssh_public_key_file_dialog->connect(SNAME("file_selected"), callable_mp(this, &VersionControlEditorPlugin::_ssh_public_key_selected));
set_up_ssh_public_key_input_hbc->add_child(set_up_ssh_public_key_file_dialog);
@@ -1183,8 +1182,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
set_up_ssh_private_key_file_dialog->set_access(FileDialog::ACCESS_FILESYSTEM);
set_up_ssh_private_key_file_dialog->set_file_mode(FileDialog::FILE_MODE_OPEN_FILE);
set_up_ssh_private_key_file_dialog->set_show_hidden_files(true);
- // TODO: Make this start at the user's home folder
- set_up_ssh_private_key_file_dialog->set_current_dir(d->get_current_dir());
+ set_up_ssh_private_key_file_dialog->set_current_dir(home_dir);
set_up_ssh_private_key_file_dialog->connect("file_selected", callable_mp(this, &VersionControlEditorPlugin::_ssh_private_key_selected));
set_up_ssh_private_key_input_hbc->add_child(set_up_ssh_private_key_file_dialog);
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 2af8da02a3..ee8148f00a 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -5198,9 +5198,9 @@ VisualShaderEditor::VisualShaderEditor() {
add_options.push_back(AddOption("Tangent", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "tangent", "TANGENT"), { "tangent" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
add_options.push_back(AddOption("Vertex", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "vertex", "VERTEX"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
add_options.push_back(AddOption("View", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "view", "VIEW"), { "view" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
- add_options.push_back(AddOption("ViewIndex", "Input/Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_index", "VIEW_INDEX"), { "view_index" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
- add_options.push_back(AddOption("ViewMonoLeft", "Input/Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_mono_left", "VIEW_MONO_LEFT"), { "view_mono_left" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
- add_options.push_back(AddOption("ViewRight", "Input/Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_right", "VIEW_RIGHT"), { "view_right" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
+ add_options.push_back(AddOption("ViewIndex", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_index", "VIEW_INDEX"), { "view_index" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
+ add_options.push_back(AddOption("ViewMonoLeft", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_mono_left", "VIEW_MONO_LEFT"), { "view_mono_left" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
+ add_options.push_back(AddOption("ViewRight", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_right", "VIEW_RIGHT"), { "view_right" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
add_options.push_back(AddOption("NodePositionWorld", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "node_position_world", "NODE_POSITION_WORLD"), { "node_position_world" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
add_options.push_back(AddOption("CameraPositionWorld", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "camera_position_world", "CAMERA_POSITION_WORLD"), { "camera_position_world" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
add_options.push_back(AddOption("CameraDirectionWorld", "Input/Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "camera_direction_world", "CAMERA_DIRECTION_WORLD"), { "camera_direction_world" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL));
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 270e04050e..f11874a994 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -59,6 +59,8 @@
#include "servers/navigation_server_3d.h"
#include "servers/physics_server_2d.h"
+constexpr int GODOT4_CONFIG_VERSION = 5;
+
class ProjectDialog : public ConfirmationDialog {
GDCLASS(ProjectDialog, ConfirmationDialog);
@@ -1065,6 +1067,7 @@ public:
int refresh_project(const String &dir_path);
void add_project(const String &dir_path, bool favorite);
void save_config();
+ void set_project_version(const String &p_project_path, int version);
private:
static void _bind_methods();
@@ -1673,6 +1676,15 @@ void ProjectList::save_config() {
_config.save(_config_path);
}
+void ProjectList::set_project_version(const String &p_project_path, int p_version) {
+ for (ProjectList::Item &E : _projects) {
+ if (E.path == p_project_path) {
+ E.version = p_version;
+ break;
+ }
+ }
+}
+
int ProjectList::get_project_count() const {
return _projects.size();
}
@@ -2170,6 +2182,9 @@ void ProjectManager::_open_selected_projects_ask() {
Label *ask_update_label = ask_update_settings->get_label();
ask_update_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT); // Reset in case of previous center align.
+ full_convert_button->hide();
+
+ ask_update_settings->get_ok_button()->set_text("OK");
// Check if the config_version property was empty or 0
if (config_version == 0) {
@@ -2179,7 +2194,11 @@ void ProjectManager::_open_selected_projects_ask() {
}
// Check if we need to convert project settings from an earlier engine version
if (config_version < ProjectSettings::CONFIG_VERSION) {
- ask_update_settings->set_text(vformat(TTR("The following project settings file was generated by an older engine version, and needs to be converted for this version:\n\n%s\n\nDo you want to convert it?\nWarning: You won't be able to open the project with previous versions of the engine anymore."), conf));
+ if (config_version == GODOT4_CONFIG_VERSION - 1 && ProjectSettings::CONFIG_VERSION == GODOT4_CONFIG_VERSION) { // Conversion from Godot 3 to 4.
+ full_convert_button->show();
+ }
+ ask_update_settings->set_text(vformat(TTR("The following project settings file was generated by an older engine version, and needs to be converted for this version:\n\n%s\n\nDo you want to convert it? You can also convert the entire project (recommended if you are upgrading).\nWarning: You won't be able to open the project with previous versions of the engine anymore."), conf));
+ ask_update_settings->get_ok_button()->set_text(TTR("Convert project.godot"));
ask_update_settings->popup_centered();
return;
}
@@ -2223,6 +2242,32 @@ void ProjectManager::_open_selected_projects_ask() {
_open_selected_projects();
}
+void ProjectManager::_perform_full_project_conversion() {
+ Vector<ProjectList::Item> selected_list = _project_list->get_selected_projects();
+ if (selected_list.is_empty()) {
+ return;
+ }
+
+ const String &path = selected_list[0].path;
+
+ print_line("Converting project: " + path);
+
+ Ref<ConfigFile> cf;
+ cf.instantiate();
+ cf->load(path.path_join("project.godot"));
+ cf->set_value("", "config_version", GODOT4_CONFIG_VERSION);
+ cf->save(path.path_join("project.godot"));
+ _project_list->set_project_version(path, GODOT4_CONFIG_VERSION);
+
+ List<String> args;
+ args.push_back("--path");
+ args.push_back(path);
+ args.push_back("--convert-3to4");
+
+ Error err = OS::get_singleton()->create_instance(args);
+ ERR_FAIL_COND(err);
+}
+
void ProjectManager::_run_project_confirm() {
Vector<ProjectList::Item> selected_list = _project_list->get_selected_projects();
@@ -2724,9 +2769,10 @@ ProjectManager::ProjectManager() {
settings_hb->add_child(h_spacer);
language_btn = memnew(OptionButton);
- language_btn->set_flat(true);
language_btn->set_icon(get_theme_icon(SNAME("Environment"), SNAME("EditorIcons")));
language_btn->set_focus_mode(Control::FOCUS_NONE);
+ language_btn->set_fit_to_longest_item(false);
+ language_btn->set_flat(true);
language_btn->connect("item_selected", callable_mp(this, &ProjectManager::_language_selected));
#ifdef ANDROID_ENABLED
// The language selection dropdown doesn't work on Android (as the setting isn't saved), see GH-60353.
@@ -2824,8 +2870,20 @@ ProjectManager::ProjectManager() {
ask_update_settings = memnew(ConfirmationDialog);
ask_update_settings->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_confirm_update_settings));
+ full_convert_button = ask_update_settings->add_button("Perform Full Project Conversion", false);
add_child(ask_update_settings);
+ ask_full_convert_dialog = memnew(ConfirmationDialog);
+ ask_full_convert_dialog->set_autowrap(true);
+ ask_full_convert_dialog->set_text(TTR(R"(This option will perform full project conversion, updating scenes and scripts from Godot 3.x to work in Godot 4.0. Note that this is a best-effort conversion, i.e. it makes upgrading the project easier, but it will not open out-of-the-box and will still require manual adjustments.
+
+IMPORTANT: Make sure to backup your project before converting, as this operation makes it impossible to open in older versions of Godot.)"));
+ ask_full_convert_dialog->connect("confirmed", callable_mp(this, &ProjectManager::_perform_full_project_conversion));
+ add_child(ask_full_convert_dialog);
+
+ full_convert_button->connect("pressed", callable_mp((Window *)ask_update_settings, &ConfirmationDialog::hide));
+ full_convert_button->connect("pressed", callable_mp((Window *)ask_full_convert_dialog, &ConfirmationDialog::popup_centered_ratio).bind(0.2));
+
npdialog = memnew(ProjectDialog);
npdialog->connect("projects_updated", callable_mp(this, &ProjectManager::_on_projects_updated));
npdialog->connect("project_created", callable_mp(this, &ProjectManager::_on_project_created));
diff --git a/editor/project_manager.h b/editor/project_manager.h
index 10bf25c048..0831a63e68 100644
--- a/editor/project_manager.h
+++ b/editor/project_manager.h
@@ -87,6 +87,7 @@ class ProjectManager : public Control {
ConfirmationDialog *multi_open_ask = nullptr;
ConfirmationDialog *multi_run_ask = nullptr;
ConfirmationDialog *multi_scan_ask = nullptr;
+ ConfirmationDialog *ask_full_convert_dialog = nullptr;
ConfirmationDialog *ask_update_settings = nullptr;
ConfirmationDialog *open_templates = nullptr;
EditorAbout *about = nullptr;
@@ -97,6 +98,7 @@ class ProjectManager : public Control {
AcceptDialog *dialog_error = nullptr;
ProjectDialog *npdialog = nullptr;
+ Button *full_convert_button = nullptr;
OptionButton *language_btn = nullptr;
LinkButton *version_btn = nullptr;
@@ -106,6 +108,7 @@ class ProjectManager : public Control {
void _run_project_confirm();
void _open_selected_projects();
void _open_selected_projects_ask();
+ void _perform_full_project_conversion();
void _import_project();
void _new_project();
void _rename_project();