diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/doc_data.h | 18 | ||||
-rw-r--r-- | editor/editor_export.cpp | 56 | ||||
-rw-r--r-- | editor/editor_export.h | 5 | ||||
-rw-r--r-- | editor/editor_node.cpp | 5 | ||||
-rw-r--r-- | editor/icons/RootMotionView.svg | 1 | ||||
-rw-r--r-- | editor/icons/ShaderGlobalsOverride.svg | 1 | ||||
-rw-r--r-- | editor/import_dock.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/project_export.cpp | 7 | ||||
-rw-r--r-- | editor/project_export.h | 1 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 15 |
11 files changed, 102 insertions, 13 deletions
diff --git a/editor/doc_data.h b/editor/doc_data.h index 06d0889af6..8c93bfa597 100644 --- a/editor/doc_data.h +++ b/editor/doc_data.h @@ -42,6 +42,9 @@ public: String type; String enumeration; String default_value; + bool operator<(const ArgumentDoc &p_arg) const { + return name < p_arg.name; + } }; struct MethodDoc { @@ -51,8 +54,8 @@ public: String qualifiers; String description; Vector<ArgumentDoc> arguments; - bool operator<(const MethodDoc &p_md) const { - return name < p_md.name; + bool operator<(const MethodDoc &p_method) const { + return name < p_method.name; } }; @@ -61,6 +64,9 @@ public: String value; String enumeration; String description; + bool operator<(const ConstantDoc &p_const) const { + return name < p_const.name; + } }; struct PropertyDoc { @@ -70,13 +76,10 @@ public: String description; String setter, getter; String default_value; - bool overridden; + bool overridden = false; bool operator<(const PropertyDoc &p_prop) const { return name < p_prop.name; } - PropertyDoc() { - overridden = false; - } }; struct ClassDoc { @@ -91,6 +94,9 @@ public: Vector<ConstantDoc> constants; Vector<PropertyDoc> properties; Vector<PropertyDoc> theme_properties; + bool operator<(const ClassDoc &p_class) const { + return name < p_class.name; + } }; String version; diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 87ca499413..716ead9afc 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1162,6 +1162,7 @@ void EditorExport::save_presets() { } void EditorExport::_bind_methods() { + ADD_SIGNAL(MethodInfo("export_presets_updated")); } void EditorExport::add_export_platform(const Ref<EditorExportPlatform> &p_platform) { @@ -1229,8 +1230,13 @@ Vector<Ref<EditorExportPlugin>> EditorExport::get_export_plugins() { } void EditorExport::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - load_config(); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { + load_config(); + } break; + case NOTIFICATION_PROCESS: { + update_export_presets(); + } break; } } @@ -1332,6 +1338,49 @@ void EditorExport::load_config() { block_save = false; } +void EditorExport::update_export_presets() { + Map<StringName, List<EditorExportPlatform::ExportOption>> platform_options; + + for (int i = 0; i < export_platforms.size(); i++) { + Ref<EditorExportPlatform> platform = export_platforms[i]; + + if (platform->should_update_export_options()) { + List<EditorExportPlatform::ExportOption> options; + platform->get_export_options(&options); + + platform_options[platform->get_name()] = options; + } + } + + bool export_presets_updated = false; + for (int i = 0; i < export_presets.size(); i++) { + Ref<EditorExportPreset> preset = export_presets[i]; + if (platform_options.has(preset->get_platform()->get_name())) { + export_presets_updated = true; + + List<EditorExportPlatform::ExportOption> options = platform_options[preset->get_platform()->get_name()]; + + // Copy the previous preset values + Map<StringName, Variant> previous_values = preset->values; + + // Clear the preset properties and values prior to reloading + preset->properties.clear(); + preset->values.clear(); + + for (List<EditorExportPlatform::ExportOption>::Element *E = options.front(); E; E = E->next()) { + preset->properties.push_back(E->get().option); + + StringName option_name = E->get().option.name; + preset->values[option_name] = previous_values.has(option_name) ? previous_values[option_name] : E->get().default_value; + } + } + } + + if (export_presets_updated) { + emit_signal(_export_presets_updated); + } +} + bool EditorExport::poll_export_platforms() { bool changed = false; for (int i = 0; i < export_platforms.size(); i++) { @@ -1351,7 +1400,10 @@ EditorExport::EditorExport() { save_timer->connect("timeout", callable_mp(this, &EditorExport::_save)); block_save = false; + _export_presets_updated = "export_presets_updated"; + singleton = this; + set_process(true); } EditorExport::~EditorExport() { diff --git a/editor/editor_export.h b/editor/editor_export.h index 797649855f..4978b39248 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -227,6 +227,7 @@ public: virtual Ref<EditorExportPreset> create_preset(); virtual void get_export_options(List<ExportOption> *r_options) = 0; + virtual bool should_update_export_options() { return false; } virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { return true; } virtual String get_os_name() const = 0; @@ -350,6 +351,8 @@ class EditorExport : public Node { Vector<Ref<EditorExportPreset>> export_presets; Vector<Ref<EditorExportPlugin>> export_plugins; + StringName _export_presets_updated; + Timer *save_timer; bool block_save; @@ -381,7 +384,7 @@ public: Vector<Ref<EditorExportPlugin>> get_export_plugins(); void load_config(); - + void update_export_presets(); bool poll_export_platforms(); EditorExport(); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index ca0e486259..8b7014fabe 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6014,8 +6014,11 @@ EditorNode::EditorNode() { left_menu_hb->add_child(settings_menu); p = settings_menu->get_popup(); - +#ifdef OSX_ENABLED + p->add_shortcut(ED_SHORTCUT("editor/editor_settings", TTR("Editor Settings..."), KEY_MASK_CMD + KEY_COMMA), SETTINGS_PREFERENCES); +#else p->add_shortcut(ED_SHORTCUT("editor/editor_settings", TTR("Editor Settings...")), SETTINGS_PREFERENCES); +#endif p->add_separator(); editor_layouts = memnew(PopupMenu); diff --git a/editor/icons/RootMotionView.svg b/editor/icons/RootMotionView.svg new file mode 100644 index 0000000000..4d33420383 --- /dev/null +++ b/editor/icons/RootMotionView.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><radialGradient id="a" cx="8" cy="8" gradientTransform="matrix(.85714281 -.00000007 .00000004 .85714284 1.142858 1.142858)" gradientUnits="userSpaceOnUse" r="7"><stop offset="0" stop-color="#fc9c9c"/><stop offset=".83333331" stop-color="#fc9c9c" stop-opacity=".701961"/><stop offset="1" stop-color="#fc9c9c" stop-opacity="0"/></radialGradient><path d="m5 2v3h-3v2h3v2h-3v2h3v3h2v-3h2v3h2v-3h3v-2h-3v-2h3v-2h-3v-3h-2v3h-2v-3zm2 5h2v2h-2z" fill="url(#a)"/></svg>
\ No newline at end of file diff --git a/editor/icons/ShaderGlobalsOverride.svg b/editor/icons/ShaderGlobalsOverride.svg new file mode 100644 index 0000000000..2fe76ed777 --- /dev/null +++ b/editor/icons/ShaderGlobalsOverride.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m2 1c-.55226.0001-.99994.4477-1 1v12c.0000552.5523.44774.9999 1 1h12c.55226-.0001.99994-.4477 1-1v-8l-5-5zm1 2h6v3c0 .554.44599 1 1 1h3v6h-10zm1 1v1h3v-1zm0 2v1h2v-1zm3 0v1h1v-1zm-2 3 3 3 3-3z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 1128b72c5a..8ab2e0aef1 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -441,7 +441,9 @@ void ImportDock::_reimport() { } else { //override entirely config->set_value("remap", "importer", importer_name); - config->erase_section("params"); + if (config->has_section("params")) { + config->erase_section("params"); + } for (List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) { config->set_value("params", E->get().name, params->values[E->get().name]); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 744c7907af..8f88612ffa 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2240,7 +2240,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { return true; } - if (k.is_valid() && !k->is_pressed() && drag_type == DRAG_KEY_MOVE && tool == TOOL_SELECT && + if (k.is_valid() && !k->is_pressed() && drag_type == DRAG_KEY_MOVE && (tool == TOOL_SELECT || tool == TOOL_MOVE) && (k->get_keycode() == KEY_UP || k->get_keycode() == KEY_DOWN || k->get_keycode() == KEY_LEFT || k->get_keycode() == KEY_RIGHT)) { // Confirm canvas items move by arrow keys if ((!Input::get_singleton()->is_key_pressed(KEY_UP)) && diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 32a1cf2fa1..e5372a5d47 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -133,6 +133,12 @@ void ProjectExportDialog::_add_preset(int p_platform) { _edit_preset(EditorExport::get_singleton()->get_export_preset_count() - 1); } +void ProjectExportDialog::_force_update_current_preset_parameters() { + // Force the parameters section to refresh its UI. + parameters->edit(nullptr); + _update_current_preset(); +} + void ProjectExportDialog::_update_current_preset() { _edit_preset(presets->get_current()); } @@ -1101,6 +1107,7 @@ ProjectExportDialog::ProjectExportDialog() { parameters->set_name(TTR("Options")); parameters->set_v_size_flags(Control::SIZE_EXPAND_FILL); parameters->connect("property_edited", callable_mp(this, &ProjectExportDialog::_update_parameters)); + EditorExport::get_singleton()->connect("export_presets_updated", callable_mp(this, &ProjectExportDialog::_force_update_current_preset_parameters)); // Resources export parameters. diff --git a/editor/project_export.h b/editor/project_export.h index 2e311eb3b3..cfa00773d8 100644 --- a/editor/project_export.h +++ b/editor/project_export.h @@ -123,6 +123,7 @@ private: void _delete_preset_confirm(); void _update_export_all(); + void _force_update_current_preset_parameters(); void _update_current_preset(); void _update_presets(); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index e73c52047b..a81a2ff4e9 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -579,7 +579,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { dup->set_name(parent->validate_child_name(dup)); - editor_data->get_undo_redo().add_do_method(parent, "add_child_below_node", add_below_node, dup); + editor_data->get_undo_redo().add_do_method(add_below_node, "add_sibling", dup); + for (List<Node *>::Element *F = owned.front(); F; F = F->next()) { if (!duplimap.has(F->get())) { continue; @@ -2063,9 +2064,21 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) { continue; } + if (E->get().name == "__meta__") { + if (Object::cast_to<CanvasItem>(newnode)) { + Dictionary metadata = n->get(E->get().name); + if (metadata.has("_edit_group_") && metadata["_edit_group_"]) { + newnode->set_meta("_edit_group_", true); + } + if (metadata.has("_edit_lock_") && metadata["_edit_lock_"]) { + newnode->set_meta("_edit_lock_", true); + } + } + continue; } + if (default_oldnode->get(E->get().name) != n->get(E->get().name)) { newnode->set(E->get().name, n->get(E->get().name)); } |