diff options
-rw-r--r-- | core/io/resource_loader.cpp | 5 | ||||
-rw-r--r-- | editor/create_dialog.cpp | 3 | ||||
-rw-r--r-- | editor/editor_node.cpp | 8 | ||||
-rw-r--r-- | editor/editor_node.h | 3 | ||||
-rw-r--r-- | editor/project_export.cpp | 27 | ||||
-rw-r--r-- | main/SCsub | 4 | ||||
-rw-r--r-- | main/main.cpp | 29 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 1 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 8 |
9 files changed, 65 insertions, 23 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 5d85634895..7471ab4241 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -277,6 +277,11 @@ RES ResourceLoader::_load(const String &p_path, const String &p_original_path, c ERR_FAIL_COND_V_MSG(found, RES(), "Failed loading resource: " + p_path + "."); +#ifdef TOOLS_ENABLED + FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES); + ERR_FAIL_COND_V_MSG(!file_check->file_exists(p_path), RES(), "Resource file not found: " + p_path + "."); +#endif + ERR_FAIL_V_MSG(RES(), "No loader found for resource: " + p_path + "."); } diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 7788d6349a..df423bfa0e 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -59,7 +59,8 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St String l = f->get_line().strip_edges(); String name = l.split(" ")[0]; - if (ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) { + if ((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) && !_is_class_disabled_by_feature_profile(name)) { + TreeItem *ti = recent->create_item(root); ti->set_text(0, l); ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type)); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d7bc959729..0be0ea90a3 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -585,10 +585,7 @@ void EditorNode::_fs_changed() { export_error = vformat("Export preset '%s' doesn't have a matching platform.", preset_name); } else { Error err = OK; - // FIXME: This way to export only resources .pck or .zip is pretty hacky - // and undocumented, and might be problematic for platforms where .zip is - // a valid project export format (e.g. macOS). - if (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip")) { + if (export_defer.pack_only) { // Only export .pck or .zip data pack. if (export_defer.path.ends_with(".zip")) { err = platform->export_zip(preset, export_defer.debug, export_defer.path); } else if (export_defer.path.ends_with(".pck")) { @@ -3942,11 +3939,12 @@ void EditorNode::_editor_file_dialog_unregister(EditorFileDialog *p_dialog) { Vector<EditorNodeInitCallback> EditorNode::_init_callbacks; -Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug) { +Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only) { export_defer.preset = p_preset; export_defer.path = p_path; export_defer.debug = p_debug; + export_defer.pack_only = p_pack_only; disable_progress_dialog = true; return OK; } diff --git a/editor/editor_node.h b/editor/editor_node.h index 469ba76872..7f53f77c76 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -558,6 +558,7 @@ private: String preset; String path; bool debug; + bool pack_only; } export_defer; bool disable_progress_dialog; @@ -779,7 +780,7 @@ public: void _copy_warning(const String &p_str); - Error export_preset(const String &p_preset, const String &p_path, bool p_debug); + Error export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only); static void register_editor_types(); static void unregister_editor_types(); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 73564191e1..8245264e0d 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -1072,6 +1072,8 @@ ProjectExportDialog::ProjectExportDialog() { main_vb->add_child(hbox); hbox->set_v_size_flags(SIZE_EXPAND_FILL); + // Presets list. + VBoxContainer *preset_vb = memnew(VBoxContainer); preset_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbox->add_child(preset_vb); @@ -1099,6 +1101,8 @@ ProjectExportDialog::ProjectExportDialog() { preset_hb->add_child(delete_preset); delete_preset->connect("pressed", this, "_delete_preset"); + // Preset settings. + VBoxContainer *settings_vb = memnew(VBoxContainer); settings_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbox->add_child(settings_vb); @@ -1119,18 +1123,24 @@ ProjectExportDialog::ProjectExportDialog() { export_path->set_save_mode(); export_path->connect("property_changed", this, "_export_path_changed"); + // Subsections. + sections = memnew(TabContainer); sections->set_tab_align(TabContainer::ALIGN_LEFT); sections->set_use_hidden_tabs_for_min_size(true); settings_vb->add_child(sections); sections->set_v_size_flags(SIZE_EXPAND_FILL); + // Main preset parameters. + parameters = memnew(EditorInspector); sections->add_child(parameters); parameters->set_name(TTR("Options")); parameters->set_v_size_flags(SIZE_EXPAND_FILL); parameters->connect("property_edited", this, "_update_parameters"); + // Resources export parameters. + VBoxContainer *resources_vb = memnew(VBoxContainer); sections->add_child(resources_vb); resources_vb->set_name(TTR("Resources")); @@ -1165,10 +1175,17 @@ ProjectExportDialog::ProjectExportDialog() { exclude_filters); exclude_filters->connect("text_changed", this, "_filter_changed"); + // Patch packages. + VBoxContainer *patch_vb = memnew(VBoxContainer); sections->add_child(patch_vb); patch_vb->set_name(TTR("Patches")); + // FIXME: Patching support doesn't seem properly implemented yet, so we hide it. + // The rest of the code is still kept for now, in the hope that it will be made + // functional and reactivated. + patch_vb->hide(); + patches = memnew(Tree); patch_vb->add_child(patches); patches->set_v_size_flags(SIZE_EXPAND_FILL); @@ -1197,6 +1214,8 @@ ProjectExportDialog::ProjectExportDialog() { patch_erase->connect("confirmed", this, "_patch_deleted"); add_child(patch_erase); + // Feature tags. + VBoxContainer *feature_vb = memnew(VBoxContainer); feature_vb->set_name(TTR("Features")); custom_features = memnew(LineEdit); @@ -1210,6 +1229,8 @@ ProjectExportDialog::ProjectExportDialog() { feature_vb->add_margin_child(TTR("Feature List:"), features_panel, true); sections->add_child(feature_vb); + // Script export parameters. + updating_script_key = false; VBoxContainer *script_vb = memnew(VBoxContainer); @@ -1231,7 +1252,7 @@ ProjectExportDialog::ProjectExportDialog() { sections->connect("tab_changed", this, "_tab_changed"); - //disable by default + // Disable by default. name->set_editable(false); export_path->hide(); runnable->set_disabled(true); @@ -1241,11 +1262,15 @@ ProjectExportDialog::ProjectExportDialog() { sections->hide(); parameters->edit(NULL); + // Deletion dialog. + delete_confirm = memnew(ConfirmationDialog); add_child(delete_confirm); delete_confirm->get_ok()->set_text(TTR("Delete")); delete_confirm->connect("confirmed", this, "_delete_preset_confirm"); + // Export buttons, dialogs and errors. + updating = false; get_cancel()->set_text(TTR("Close")); diff --git a/main/SCsub b/main/SCsub index 73cec1d250..e1efc7e6ed 100644 --- a/main/SCsub +++ b/main/SCsub @@ -9,8 +9,8 @@ env.main_sources = [] env.add_source_files(env.main_sources, "*.cpp") -# order matters here. higher index controller database files write on top of lower index database files -controller_databases = ["#main/gamecontrollerdb.txt", "#main/gamecontrollerdb_205.txt", "#main/gamecontrollerdb_204.txt", "#main/godotcontrollerdb.txt"] +# Order matters here. Higher index controller database files write on top of lower index database files. +controller_databases = ["#main/gamecontrollerdb_204.txt", "#main/gamecontrollerdb_205.txt", "#main/gamecontrollerdb.txt", "#main/godotcontrollerdb.txt"] env.Depends("#main/default_controller_mappings.gen.cpp", controller_databases) env.CommandNoCache("#main/default_controller_mappings.gen.cpp", controller_databases, run_in_subprocess(main_builders.make_default_controller_mappings)) diff --git a/main/main.cpp b/main/main.cpp index 308c53de13..c29a5a0aa6 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -287,9 +287,9 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --check-only Only parse for errors and quit (use with --script).\n"); #ifdef TOOLS_ENABLED OS::get_singleton()->print(" --export <preset> <path> Export the project using the given preset and matching release template. The preset name should match one defined in export_presets.cfg.\n"); - OS::get_singleton()->print(" <path> should be absolute or relative to the project directory, and include the filename for the binary (e.g. 'builds/game.exe').\n"); - OS::get_singleton()->print(" The target directory should exist. Only the data pack is exported if <path> ends with .pck or .zip.\n"); + OS::get_singleton()->print(" <path> should be absolute or relative to the project directory, and include the filename for the binary (e.g. 'builds/game.exe'). The target directory should exist.\n"); OS::get_singleton()->print(" --export-debug <preset> <path> Same as --export, but using the debug template.\n"); + OS::get_singleton()->print(" --export-pack <preset> <path> Same as --export, but only export the game pack for the given preset. The <path> extension determines whether it will be in PCK or ZIP format.\n"); OS::get_singleton()->print(" --doctool <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found.\n"); OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n"); OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects).\n"); @@ -675,7 +675,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // We still pass it to the main arguments since the argument handling itself is not done in this function main_args.push_back(I->get()); #endif - } else if (I->get() == "--export" || I->get() == "--export-debug") { // Export project + } else if (I->get() == "--export" || I->get() == "--export-debug" || I->get() == "--export-pack") { // Export project editor = true; main_args.push_back(I->get()); @@ -1395,15 +1395,17 @@ bool Main::start() { bool hasicon = false; String doc_tool; List<String> removal_docs; -#ifdef TOOLS_ENABLED - bool doc_base = true; -#endif String game_path; String script; String test; + bool check_only = false; + +#ifdef TOOLS_ENABLED + bool doc_base = true; String _export_preset; bool export_debug = false; - bool check_only = false; + bool export_pack_only = false; +#endif main_timer_sync.init(OS::get_singleton()->get_ticks_usec()); @@ -1442,6 +1444,10 @@ bool Main::start() { editor = true; //needs editor _export_preset = args[i + 1]; export_debug = true; + } else if (args[i] == "--export-pack") { + editor = true; + _export_preset = args[i + 1]; + export_pack_only = true; #endif } else { // The parameter does not match anything known, don't skip the next argument @@ -1511,18 +1517,15 @@ bool Main::start() { return false; } -#endif - if (_export_preset != "") { if (game_path == "") { - String err = "Command line parameter "; - err += export_debug ? "--export-debug" : "--export"; - err += " passed but no destination path given.\n"; + String err = "Command line includes export parameter option, but no destination path was given.\n"; err += "Please specify the binary's file path to export to. Aborting export."; ERR_PRINT(err); return false; } } +#endif if (script == "" && game_path == "" && String(GLOBAL_DEF("application/run/main_scene", "")) != "") { game_path = GLOBAL_DEF("application/run/main_scene", ""); @@ -1706,7 +1709,7 @@ bool Main::start() { sml->get_root()->add_child(editor_node); if (_export_preset != "") { - editor_node->export_preset(_export_preset, game_path, export_debug); + editor_node->export_preset(_export_preset, game_path, export_debug, export_pack_only); game_path = ""; // Do not load anything. } } diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 8240086eb2..0a1eda37ca 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -8047,6 +8047,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) { last_var_assign = lv->assign; if (lv->assign) { + lv->assign_op->arguments[0]->set_datatype(lv->datatype); DataType assign_type = _reduce_node_type(lv->assign); #ifdef DEBUG_ENABLED if (assign_type.has_type && assign_type.kind == DataType::BUILTIN && assign_type.builtin_type == Variant::NIL) { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 100c06955a..6c2928c65c 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -935,6 +935,14 @@ void RichTextLabel::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_MOUSE_EXIT: { + if (meta_hovering) { + meta_hovering = NULL; + emit_signal("meta_hover_ended", current_meta); + current_meta = false; + update(); + } + } break; case NOTIFICATION_RESIZED: { main->first_invalid_line = 0; //invalidate ALL |