summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/config/engine.cpp6
-rw-r--r--core/config/engine.h3
-rw-r--r--core/config/project_settings.cpp5
-rw-r--r--core/config/project_settings.h2
-rw-r--r--core/core_bind.cpp4
-rw-r--r--core/core_bind.h4
-rw-r--r--core/crypto/aes_context.cpp4
-rw-r--r--core/crypto/aes_context.h4
-rw-r--r--core/crypto/crypto.cpp8
-rw-r--r--core/crypto/crypto.h32
-rw-r--r--core/crypto/hashing_context.cpp2
-rw-r--r--core/crypto/hashing_context.h2
-rw-r--r--core/debugger/engine_debugger.cpp2
-rw-r--r--core/debugger/engine_debugger.h2
-rw-r--r--core/debugger/remote_debugger.cpp2
-rw-r--r--core/debugger/remote_debugger.h2
-rw-r--r--core/doc_data.h110
-rw-r--r--core/extension/gdextension.cpp2
-rw-r--r--core/input/input.cpp14
-rw-r--r--core/input/input.h14
-rw-r--r--core/io/config_file.cpp2
-rw-r--r--core/io/config_file.h2
-rw-r--r--core/io/dir_access.cpp14
-rw-r--r--core/io/dir_access.h14
-rw-r--r--core/io/file_access_memory.cpp2
-rw-r--r--core/io/file_access_memory.h2
-rw-r--r--core/io/file_access_pack.cpp2
-rw-r--r--core/io/file_access_pack.h2
-rw-r--r--core/io/file_access_zip.cpp4
-rw-r--r--core/io/file_access_zip.h6
-rw-r--r--core/io/image_loader.cpp2
-rw-r--r--core/io/image_loader.h2
-rw-r--r--core/io/ip.cpp2
-rw-r--r--core/io/logger.cpp2
-rw-r--r--core/io/logger.h2
-rw-r--r--core/io/net_socket.h4
-rw-r--r--core/io/packet_peer_udp.cpp4
-rw-r--r--core/io/packet_peer_udp.h4
-rw-r--r--core/io/resource_loader.cpp4
-rw-r--r--core/io/resource_loader.h4
-rw-r--r--core/io/resource_saver.cpp4
-rw-r--r--core/io/resource_saver.h4
-rw-r--r--core/io/zip_io.cpp2
-rw-r--r--core/io/zip_io.h2
-rw-r--r--core/math/expression.cpp2
-rw-r--r--core/math/expression.h2
-rw-r--r--core/math/geometry_2d.cpp2
-rw-r--r--core/math/geometry_2d.h2
-rw-r--r--core/math/geometry_3d.cpp2
-rw-r--r--core/math/geometry_3d.h2
-rw-r--r--core/object/object.h2
-rw-r--r--core/object/script_language.h3
-rw-r--r--core/object/script_language_extension.cpp1
-rw-r--r--core/object/script_language_extension.h3
-rw-r--r--core/os/os.cpp2
-rw-r--r--core/os/os.h12
-rw-r--r--core/os/time.cpp8
-rw-r--r--core/os/time.h8
-rw-r--r--core/string/print_string.cpp8
-rw-r--r--core/string/print_string.h18
-rw-r--r--core/string/string_name.h5
-rw-r--r--core/string/ustring.cpp2
-rw-r--r--core/string/ustring.h2
-rw-r--r--core/templates/vector.h4
-rw-r--r--core/variant/method_ptrcall.h244
-rw-r--r--core/variant/variant.cpp2
-rw-r--r--core/variant/variant_utility.cpp6
-rw-r--r--core/variant/variant_utility.h6
-rw-r--r--doc/class.xsd21
-rw-r--r--doc/classes/@GlobalScope.xml15
-rw-r--r--doc/classes/AStarGrid2D.xml3
-rw-r--r--doc/classes/AnimatedTexture.xml3
-rw-r--r--doc/classes/AnimationPlayer.xml33
-rw-r--r--doc/classes/AnimationTree.xml15
-rw-r--r--doc/classes/CollisionShape3D.xml4
-rw-r--r--doc/classes/Control.xml4
-rw-r--r--doc/classes/EditorExportPlugin.xml24
-rw-r--r--doc/classes/EditorPlugin.xml6
-rw-r--r--doc/classes/EditorScript.xml3
-rw-r--r--doc/classes/GraphEdit.xml2
-rw-r--r--doc/classes/GraphElement.xml2
-rw-r--r--doc/classes/GraphNode.xml2
-rw-r--r--doc/classes/HTTPClient.xml8
-rw-r--r--doc/classes/InputEventJoypadButton.xml4
-rw-r--r--doc/classes/LightmapGIData.xml3
-rw-r--r--doc/classes/MultiMesh.xml12
-rw-r--r--doc/classes/NavigationAgent2D.xml2
-rw-r--r--doc/classes/NavigationAgent3D.xml2
-rw-r--r--doc/classes/NavigationLink2D.xml2
-rw-r--r--doc/classes/NavigationLink3D.xml2
-rw-r--r--doc/classes/NavigationMesh.xml2
-rw-r--r--doc/classes/NavigationMeshGenerator.xml4
-rw-r--r--doc/classes/NavigationMeshSourceGeometryData2D.xml2
-rw-r--r--doc/classes/NavigationMeshSourceGeometryData3D.xml2
-rw-r--r--doc/classes/NavigationObstacle2D.xml2
-rw-r--r--doc/classes/NavigationObstacle3D.xml2
-rw-r--r--doc/classes/NavigationPathQueryParameters2D.xml2
-rw-r--r--doc/classes/NavigationPathQueryParameters3D.xml2
-rw-r--r--doc/classes/NavigationPathQueryResult2D.xml2
-rw-r--r--doc/classes/NavigationPathQueryResult3D.xml2
-rw-r--r--doc/classes/NavigationPolygon.xml5
-rw-r--r--doc/classes/NavigationRegion2D.xml5
-rw-r--r--doc/classes/NavigationRegion3D.xml5
-rw-r--r--doc/classes/NavigationServer2D.xml2
-rw-r--r--doc/classes/NavigationServer3D.xml6
-rw-r--r--doc/classes/Node.xml4
-rw-r--r--doc/classes/ProjectSettings.xml3
-rw-r--r--doc/classes/RenderingDevice.xml78
-rw-r--r--doc/classes/RenderingServer.xml22
-rw-r--r--doc/classes/Resource.xml8
-rw-r--r--doc/classes/ScriptLanguageExtension.xml8
-rw-r--r--doc/classes/ShapeCast3D.xml4
-rw-r--r--doc/classes/Skeleton3D.xml3
-rw-r--r--doc/classes/SkeletonIK3D.xml3
-rw-r--r--doc/classes/SkeletonModification2D.xml2
-rw-r--r--doc/classes/SkeletonModification2DCCDIK.xml2
-rw-r--r--doc/classes/SkeletonModification2DFABRIK.xml2
-rw-r--r--doc/classes/SkeletonModification2DJiggle.xml2
-rw-r--r--doc/classes/SkeletonModification2DLookAt.xml2
-rw-r--r--doc/classes/SkeletonModification2DPhysicalBones.xml2
-rw-r--r--doc/classes/SkeletonModification2DStackHolder.xml2
-rw-r--r--doc/classes/SkeletonModification2DTwoBoneIK.xml2
-rw-r--r--doc/classes/SkeletonModificationStack2D.xml2
-rw-r--r--doc/classes/StreamPeerGZIP.xml2
-rw-r--r--doc/classes/SubViewportContainer.xml2
-rw-r--r--doc/classes/SurfaceTool.xml3
-rw-r--r--doc/classes/TextureRect.xml2
-rw-r--r--doc/classes/TileMap.xml7
-rw-r--r--doc/classes/TreeItem.xml3
-rw-r--r--doc/classes/Viewport.xml3
-rw-r--r--doc/classes/Window.xml3
-rw-r--r--doc/classes/XRInterface.xml12
-rwxr-xr-xdoc/tools/make_rst.py76
-rw-r--r--drivers/d3d12/rendering_device_driver_d3d12.cpp12
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp2
-rw-r--r--drivers/unix/net_socket_posix.cpp4
-rw-r--r--drivers/unix/net_socket_posix.h4
-rw-r--r--drivers/unix/os_unix.cpp4
-rw-r--r--drivers/unix/os_unix.h4
-rw-r--r--drivers/windows/dir_access_windows.cpp2
-rw-r--r--drivers/windows/dir_access_windows.h2
-rw-r--r--editor/animation_bezier_editor.cpp2
-rw-r--r--editor/animation_track_editor.cpp2
-rw-r--r--editor/connections_dialog.cpp23
-rw-r--r--editor/connections_dialog.h2
-rw-r--r--editor/debugger/editor_visual_profiler.cpp2
-rw-r--r--editor/doc_tools.cpp103
-rw-r--r--editor/editor_help.cpp1162
-rw-r--r--editor/editor_help.h8
-rw-r--r--editor/editor_node.cpp5
-rw-r--r--editor/export/editor_export_plugin.cpp7
-rw-r--r--editor/export/editor_export_plugin.h2
-rw-r--r--editor/export/editor_export_preset.cpp43
-rw-r--r--editor/export/editor_export_preset.h2
-rw-r--r--editor/export/project_export.cpp5
-rw-r--r--editor/filesystem_dock.cpp28
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp5
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_text_editor.cpp9
-rw-r--r--main/main.cpp15
-rw-r--r--modules/csg/csg_shape.cpp2
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml3
-rw-r--r--modules/gdscript/editor/gdscript_docgen.cpp16
-rw-r--r--modules/gdscript/gdscript.cpp2
-rw-r--r--modules/gdscript/gdscript.h2
-rw-r--r--modules/gdscript/gdscript_parser.cpp20
-rw-r--r--modules/gdscript/gdscript_parser.h4
-rw-r--r--modules/gltf/doc_classes/GLTFDocument.xml2
-rw-r--r--modules/gltf/doc_classes/GLTFPhysicsBody.xml2
-rw-r--r--modules/gridmap/doc_classes/GridMap.xml4
-rw-r--r--modules/mbedtls/crypto_mbedtls.cpp26
-rw-r--r--modules/mbedtls/crypto_mbedtls.h26
-rw-r--r--modules/mono/csharp_script.cpp23
-rw-r--r--modules/mono/csharp_script.h3
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs4
-rw-r--r--modules/multiplayer/doc_classes/SceneReplicationConfig.xml12
-rw-r--r--modules/multiplayer/scene_multiplayer.h2
-rw-r--r--platform/android/detect.py8
-rw-r--r--platform/android/dir_access_jandroid.cpp2
-rw-r--r--platform/android/dir_access_jandroid.h2
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/Godot.kt3
-rw-r--r--platform/android/net_socket_android.cpp4
-rw-r--r--platform/android/net_socket_android.h4
-rw-r--r--platform/android/os_android.cpp4
-rw-r--r--platform/android/os_android.h4
-rw-r--r--platform/ios/detect.py4
-rw-r--r--platform/ios/os_ios.h6
-rw-r--r--platform/ios/os_ios.mm6
-rw-r--r--platform/linuxbsd/detect.py4
-rw-r--r--platform/linuxbsd/os_linuxbsd.cpp2
-rw-r--r--platform/linuxbsd/os_linuxbsd.h2
-rw-r--r--platform/macos/detect.py4
-rw-r--r--platform/macos/display_server_macos.mm26
-rw-r--r--platform/macos/os_macos.h4
-rw-r--r--platform/macos/os_macos.mm4
-rw-r--r--platform/web/detect.py4
-rw-r--r--platform/web/os_web.cpp4
-rw-r--r--platform/web/os_web.h4
-rw-r--r--platform/windows/detect.py24
-rw-r--r--platform/windows/display_server_windows.cpp4
-rw-r--r--platform/windows/os_windows.cpp6
-rw-r--r--platform/windows/os_windows.h6
-rw-r--r--scene/3d/path_3d.cpp12
-rw-r--r--scene/3d/path_3d.h10
-rw-r--r--servers/rendering/rendering_device.cpp2
-rw-r--r--tests/core/test_crypto.h12
207 files changed, 1778 insertions, 1168 deletions
diff --git a/core/config/engine.cpp b/core/config/engine.cpp
index 203f8c3882..2bb8837849 100644
--- a/core/config/engine.cpp
+++ b/core/config/engine.cpp
@@ -258,6 +258,12 @@ bool Engine::is_printing_error_messages() const {
return CoreGlobals::print_error_enabled;
}
+void Engine::print_header(const String &p_string) const {
+ if (_print_header) {
+ print_line(p_string);
+ }
+}
+
void Engine::add_singleton(const Singleton &p_singleton) {
ERR_FAIL_COND_MSG(singleton_ptrs.has(p_singleton.name), vformat("Can't register singleton '%s' because it already exists.", p_singleton.name));
singletons.push_back(p_singleton);
diff --git a/core/config/engine.h b/core/config/engine.h
index b64309a9e8..be7cd62f66 100644
--- a/core/config/engine.h
+++ b/core/config/engine.h
@@ -84,6 +84,8 @@ private:
bool project_manager_hint = false;
bool extension_reloading = false;
+ bool _print_header = true;
+
static Engine *singleton;
String write_movie_path;
@@ -123,6 +125,7 @@ public:
void set_print_error_messages(bool p_enabled);
bool is_printing_error_messages() const;
+ void print_header(const String &p_string) const;
void set_frame_delay(uint32_t p_msec);
uint32_t get_frame_delay() const;
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp
index 974fd5283b..4fd6ab9028 100644
--- a/core/config/project_settings.cpp
+++ b/core/config/project_settings.cpp
@@ -688,7 +688,7 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bo
return err;
}
-bool ProjectSettings::has_setting(String p_var) const {
+bool ProjectSettings::has_setting(const String &p_var) const {
_THREAD_SAFE_METHOD_
return props.has(p_var);
@@ -971,7 +971,7 @@ Error ProjectSettings::_save_custom_bnd(const String &p_file) { // add other par
}
#ifdef TOOLS_ENABLED
-bool _csproj_exists(String p_root_dir) {
+bool _csproj_exists(const String &p_root_dir) {
Ref<DirAccess> dir = DirAccess::open(p_root_dir);
ERR_FAIL_COND_V(dir.is_null(), false);
@@ -1393,6 +1393,7 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/run/main_scene", PROPERTY_HINT_FILE, "*.tscn,*.scn,*.res"), "");
GLOBAL_DEF("application/run/disable_stdout", false);
GLOBAL_DEF("application/run/disable_stderr", false);
+ GLOBAL_DEF("application/run/print_header", true);
GLOBAL_DEF_RST("application/config/use_hidden_project_data_directory", true);
GLOBAL_DEF("application/config/use_custom_user_dir", false);
GLOBAL_DEF("application/config/custom_user_dir_name", "");
diff --git a/core/config/project_settings.h b/core/config/project_settings.h
index 55d5957ad1..385f93e91e 100644
--- a/core/config/project_settings.h
+++ b/core/config/project_settings.h
@@ -161,7 +161,7 @@ public:
void store_global_class_list(const Array &p_classes);
String get_global_class_list_path() const;
- bool has_setting(String p_var) const;
+ bool has_setting(const String &p_var) const;
String localize_path(const String &p_path) const;
String globalize_path(const String &p_path) const;
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index e5363f9acc..f5c69b9b98 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -257,7 +257,7 @@ String OS::get_executable_path() const {
return ::OS::get_singleton()->get_executable_path();
}
-Error OS::shell_open(String p_uri) {
+Error OS::shell_open(const String &p_uri) {
if (p_uri.begins_with("res://")) {
WARN_PRINT("Attempting to open an URL with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
} else if (p_uri.begins_with("user://")) {
@@ -266,7 +266,7 @@ Error OS::shell_open(String p_uri) {
return ::OS::get_singleton()->shell_open(p_uri);
}
-Error OS::shell_show_in_file_manager(String p_path, bool p_open_folder) {
+Error OS::shell_show_in_file_manager(const String &p_path, bool p_open_folder) {
if (p_path.begins_with("res://")) {
WARN_PRINT("Attempting to explore file path with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_show_in_file_manager()`.");
} else if (p_path.begins_with("user://")) {
diff --git a/core/core_bind.h b/core/core_bind.h
index 94d95f2ce9..f884426881 100644
--- a/core/core_bind.h
+++ b/core/core_bind.h
@@ -157,8 +157,8 @@ public:
int create_process(const String &p_path, const Vector<String> &p_arguments, bool p_open_console = false);
int create_instance(const Vector<String> &p_arguments);
Error kill(int p_pid);
- Error shell_open(String p_uri);
- Error shell_show_in_file_manager(String p_path, bool p_open_folder = true);
+ Error shell_open(const String &p_uri);
+ Error shell_show_in_file_manager(const String &p_path, bool p_open_folder = true);
bool is_process_running(int p_pid) const;
int get_process_id() const;
diff --git a/core/crypto/aes_context.cpp b/core/crypto/aes_context.cpp
index 8a8d3f875e..7596f4e0e2 100644
--- a/core/crypto/aes_context.cpp
+++ b/core/crypto/aes_context.cpp
@@ -30,7 +30,7 @@
#include "core/crypto/aes_context.h"
-Error AESContext::start(Mode p_mode, PackedByteArray p_key, PackedByteArray p_iv) {
+Error AESContext::start(Mode p_mode, const PackedByteArray &p_key, const PackedByteArray &p_iv) {
ERR_FAIL_COND_V_MSG(mode != MODE_MAX, ERR_ALREADY_IN_USE, "AESContext already started. Call 'finish' before starting a new one.");
ERR_FAIL_COND_V_MSG(p_mode < 0 || p_mode >= MODE_MAX, ERR_INVALID_PARAMETER, "Invalid mode requested.");
// Key check.
@@ -52,7 +52,7 @@ Error AESContext::start(Mode p_mode, PackedByteArray p_key, PackedByteArray p_iv
return OK;
}
-PackedByteArray AESContext::update(PackedByteArray p_src) {
+PackedByteArray AESContext::update(const PackedByteArray &p_src) {
ERR_FAIL_COND_V_MSG(mode < 0 || mode >= MODE_MAX, PackedByteArray(), "AESContext not started. Call 'start' before calling 'update'.");
int len = p_src.size();
ERR_FAIL_COND_V_MSG(len % 16, PackedByteArray(), "The number of bytes to be encrypted must be multiple of 16. Add padding if needed");
diff --git a/core/crypto/aes_context.h b/core/crypto/aes_context.h
index c4d26d815a..f6aeab221f 100644
--- a/core/crypto/aes_context.h
+++ b/core/crypto/aes_context.h
@@ -55,8 +55,8 @@ protected:
static void _bind_methods();
public:
- Error start(Mode p_mode, PackedByteArray p_key, PackedByteArray p_iv = PackedByteArray());
- PackedByteArray update(PackedByteArray p_src);
+ Error start(Mode p_mode, const PackedByteArray &p_key, const PackedByteArray &p_iv = PackedByteArray());
+ PackedByteArray update(const PackedByteArray &p_src);
PackedByteArray get_iv_state();
void finish();
diff --git a/core/crypto/crypto.cpp b/core/crypto/crypto.cpp
index 6b1c2a9cb2..7fef819159 100644
--- a/core/crypto/crypto.cpp
+++ b/core/crypto/crypto.cpp
@@ -124,7 +124,7 @@ HMACContext *HMACContext::create() {
/// Crypto
-void (*Crypto::_load_default_certificates)(String p_path) = nullptr;
+void (*Crypto::_load_default_certificates)(const String &p_path) = nullptr;
Crypto *(*Crypto::_create)() = nullptr;
Crypto *Crypto::create() {
if (_create) {
@@ -133,13 +133,13 @@ Crypto *Crypto::create() {
ERR_FAIL_V_MSG(nullptr, "Crypto is not available when the mbedtls module is disabled.");
}
-void Crypto::load_default_certificates(String p_path) {
+void Crypto::load_default_certificates(const String &p_path) {
if (_load_default_certificates) {
_load_default_certificates(p_path);
}
}
-PackedByteArray Crypto::hmac_digest(HashingContext::HashType p_hash_type, PackedByteArray p_key, PackedByteArray p_msg) {
+PackedByteArray Crypto::hmac_digest(HashingContext::HashType p_hash_type, const PackedByteArray &p_key, const PackedByteArray &p_msg) {
Ref<HMACContext> ctx = Ref<HMACContext>(HMACContext::create());
ERR_FAIL_COND_V_MSG(ctx.is_null(), PackedByteArray(), "HMAC is not available without mbedtls module.");
Error err = ctx->start(p_hash_type, p_key);
@@ -151,7 +151,7 @@ PackedByteArray Crypto::hmac_digest(HashingContext::HashType p_hash_type, Packed
// Compares two HMACS for equality without leaking timing information in order to prevent timing attacks.
// @see: https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy
-bool Crypto::constant_time_compare(PackedByteArray p_trusted, PackedByteArray p_received) {
+bool Crypto::constant_time_compare(const PackedByteArray &p_trusted, const PackedByteArray &p_received) {
const uint8_t *t = p_trusted.ptr();
const uint8_t *r = p_received.ptr();
int tlen = p_trusted.size();
diff --git a/core/crypto/crypto.h b/core/crypto/crypto.h
index 4b5bf8305f..0248b04034 100644
--- a/core/crypto/crypto.h
+++ b/core/crypto/crypto.h
@@ -46,10 +46,10 @@ protected:
public:
static CryptoKey *create();
- virtual Error load(String p_path, bool p_public_only = false) = 0;
- virtual Error save(String p_path, bool p_public_only = false) = 0;
+ virtual Error load(const String &p_path, bool p_public_only = false) = 0;
+ virtual Error save(const String &p_path, bool p_public_only = false) = 0;
virtual String save_to_string(bool p_public_only = false) = 0;
- virtual Error load_from_string(String p_string_key, bool p_public_only = false) = 0;
+ virtual Error load_from_string(const String &p_string_key, bool p_public_only = false) = 0;
virtual bool is_public_only() const = 0;
};
@@ -62,9 +62,9 @@ protected:
public:
static X509Certificate *create();
- virtual Error load(String p_path) = 0;
+ virtual Error load(const String &p_path) = 0;
virtual Error load_from_memory(const uint8_t *p_buffer, int p_len) = 0;
- virtual Error save(String p_path) = 0;
+ virtual Error save(const String &p_path) = 0;
virtual String save_to_string() = 0;
virtual Error load_from_string(const String &string) = 0;
};
@@ -113,8 +113,8 @@ protected:
public:
static HMACContext *create();
- virtual Error start(HashingContext::HashType p_hash_type, PackedByteArray p_key) = 0;
- virtual Error update(PackedByteArray p_data) = 0;
+ virtual Error start(HashingContext::HashType p_hash_type, const PackedByteArray &p_key) = 0;
+ virtual Error update(const PackedByteArray &p_data) = 0;
virtual PackedByteArray finish() = 0;
HMACContext() {}
@@ -127,26 +127,26 @@ class Crypto : public RefCounted {
protected:
static void _bind_methods();
static Crypto *(*_create)();
- static void (*_load_default_certificates)(String p_path);
+ static void (*_load_default_certificates)(const String &p_path);
public:
static Crypto *create();
- static void load_default_certificates(String p_path);
+ static void load_default_certificates(const String &p_path);
virtual PackedByteArray generate_random_bytes(int p_bytes) = 0;
virtual Ref<CryptoKey> generate_rsa(int p_bytes) = 0;
- virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after) = 0;
+ virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, const String &p_issuer_name, const String &p_not_before, const String &p_not_after) = 0;
- virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Ref<CryptoKey> p_key) = 0;
- virtual bool verify(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Vector<uint8_t> p_signature, Ref<CryptoKey> p_key) = 0;
- virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_plaintext) = 0;
- virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_ciphertext) = 0;
+ virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, Ref<CryptoKey> p_key) = 0;
+ virtual bool verify(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, const Vector<uint8_t> &p_signature, Ref<CryptoKey> p_key) = 0;
+ virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_plaintext) = 0;
+ virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_ciphertext) = 0;
- PackedByteArray hmac_digest(HashingContext::HashType p_hash_type, PackedByteArray p_key, PackedByteArray p_msg);
+ PackedByteArray hmac_digest(HashingContext::HashType p_hash_type, const PackedByteArray &p_key, const PackedByteArray &p_msg);
// Compares two PackedByteArrays for equality without leaking timing information in order to prevent timing attacks.
// @see: https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy
- bool constant_time_compare(PackedByteArray p_trusted, PackedByteArray p_received);
+ bool constant_time_compare(const PackedByteArray &p_trusted, const PackedByteArray &p_received);
Crypto() {}
};
diff --git a/core/crypto/hashing_context.cpp b/core/crypto/hashing_context.cpp
index 157a0c091b..01acbdbc17 100644
--- a/core/crypto/hashing_context.cpp
+++ b/core/crypto/hashing_context.cpp
@@ -47,7 +47,7 @@ Error HashingContext::start(HashType p_type) {
return ERR_UNAVAILABLE;
}
-Error HashingContext::update(PackedByteArray p_chunk) {
+Error HashingContext::update(const PackedByteArray &p_chunk) {
ERR_FAIL_NULL_V(ctx, ERR_UNCONFIGURED);
size_t len = p_chunk.size();
ERR_FAIL_COND_V(len == 0, FAILED);
diff --git a/core/crypto/hashing_context.h b/core/crypto/hashing_context.h
index 464261935a..ab7affabaa 100644
--- a/core/crypto/hashing_context.h
+++ b/core/crypto/hashing_context.h
@@ -54,7 +54,7 @@ protected:
public:
Error start(HashType p_type);
- Error update(PackedByteArray p_chunk);
+ Error update(const PackedByteArray &p_chunk);
PackedByteArray finish();
HashingContext() {}
diff --git a/core/debugger/engine_debugger.cpp b/core/debugger/engine_debugger.cpp
index 0cce44d02f..a7655c874a 100644
--- a/core/debugger/engine_debugger.cpp
+++ b/core/debugger/engine_debugger.cpp
@@ -127,7 +127,7 @@ void EngineDebugger::iteration(uint64_t p_frame_ticks, uint64_t p_process_ticks,
singleton->poll_events(true);
}
-void EngineDebugger::initialize(const String &p_uri, bool p_skip_breakpoints, Vector<String> p_breakpoints, void (*p_allow_focus_steal_fn)()) {
+void EngineDebugger::initialize(const String &p_uri, bool p_skip_breakpoints, const Vector<String> &p_breakpoints, void (*p_allow_focus_steal_fn)()) {
register_uri_handler("tcp://", RemoteDebuggerPeerTCP::create); // TCP is the default protocol. Platforms/modules can add more.
if (p_uri.is_empty()) {
return;
diff --git a/core/debugger/engine_debugger.h b/core/debugger/engine_debugger.h
index 88d5490794..16050778aa 100644
--- a/core/debugger/engine_debugger.h
+++ b/core/debugger/engine_debugger.h
@@ -108,7 +108,7 @@ public:
_FORCE_INLINE_ static ScriptDebugger *get_script_debugger() { return script_debugger; };
- static void initialize(const String &p_uri, bool p_skip_breakpoints, Vector<String> p_breakpoints, void (*p_allow_focus_steal_fn)());
+ static void initialize(const String &p_uri, bool p_skip_breakpoints, const Vector<String> &p_breakpoints, void (*p_allow_focus_steal_fn)());
static void deinitialize();
static void register_profiler(const StringName &p_name, const Profiler &p_profiler);
static void unregister_profiler(const StringName &p_name);
diff --git a/core/debugger/remote_debugger.cpp b/core/debugger/remote_debugger.cpp
index 6f2036705d..1973663c72 100644
--- a/core/debugger/remote_debugger.cpp
+++ b/core/debugger/remote_debugger.cpp
@@ -92,7 +92,7 @@ public:
}
};
-Error RemoteDebugger::_put_msg(String p_message, Array p_data) {
+Error RemoteDebugger::_put_msg(const String &p_message, const Array &p_data) {
Array msg;
msg.push_back(p_message);
msg.push_back(Thread::get_caller_id());
diff --git a/core/debugger/remote_debugger.h b/core/debugger/remote_debugger.h
index 519a90e7cc..e91d09be17 100644
--- a/core/debugger/remote_debugger.h
+++ b/core/debugger/remote_debugger.h
@@ -98,7 +98,7 @@ private:
static void _err_handler(void *p_this, const char *p_func, const char *p_file, int p_line, const char *p_err, const char *p_descr, bool p_editor_notify, ErrorHandlerType p_type);
ErrorMessage _create_overflow_error(const String &p_what, const String &p_descr);
- Error _put_msg(String p_message, Array p_data);
+ Error _put_msg(const String &p_message, const Array &p_data);
bool is_peer_connected() { return peer->is_peer_connected(); }
void flush_output();
diff --git a/core/doc_data.h b/core/doc_data.h
index 45463f5931..04bd55eaba 100644
--- a/core/doc_data.h
+++ b/core/doc_data.h
@@ -114,7 +114,9 @@ public:
String qualifiers;
String description;
bool is_deprecated = false;
+ String deprecated_message;
bool is_experimental = false;
+ String experimental_message;
Vector<ArgumentDoc> arguments;
Vector<int> errors_returned;
String keywords;
@@ -172,6 +174,7 @@ public:
doc.description = p_dict["description"];
}
+#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}
@@ -179,6 +182,17 @@ public:
if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
+#endif
+
+ if (p_dict.has("deprecated")) {
+ doc.is_deprecated = true;
+ doc.deprecated_message = p_dict["deprecated"];
+ }
+
+ if (p_dict.has("experimental")) {
+ doc.is_experimental = true;
+ doc.experimental_message = p_dict["experimental"];
+ }
Array arguments;
if (p_dict.has("arguments")) {
@@ -226,9 +240,13 @@ public:
dict["description"] = p_doc.description;
}
- dict["is_deprecated"] = p_doc.is_deprecated;
+ if (p_doc.is_deprecated) {
+ dict["deprecated"] = p_doc.deprecated_message;
+ }
- dict["is_experimental"] = p_doc.is_experimental;
+ if (p_doc.is_experimental) {
+ dict["experimental"] = p_doc.experimental_message;
+ }
if (!p_doc.keywords.is_empty()) {
dict["keywords"] = p_doc.keywords;
@@ -262,7 +280,9 @@ public:
bool is_bitfield = false;
String description;
bool is_deprecated = false;
+ String deprecated_message;
bool is_experimental = false;
+ String experimental_message;
String keywords;
bool operator<(const ConstantDoc &p_const) const {
return name < p_const.name;
@@ -293,6 +313,7 @@ public:
doc.description = p_dict["description"];
}
+#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}
@@ -300,6 +321,17 @@ public:
if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
+#endif
+
+ if (p_dict.has("deprecated")) {
+ doc.is_deprecated = true;
+ doc.deprecated_message = p_dict["deprecated"];
+ }
+
+ if (p_dict.has("experimental")) {
+ doc.is_experimental = true;
+ doc.experimental_message = p_dict["experimental"];
+ }
if (p_dict.has("keywords")) {
doc.keywords = p_dict["keywords"];
@@ -329,9 +361,13 @@ public:
dict["description"] = p_doc.description;
}
- dict["is_deprecated"] = p_doc.is_deprecated;
+ if (p_doc.is_deprecated) {
+ dict["deprecated"] = p_doc.deprecated_message;
+ }
- dict["is_experimental"] = p_doc.is_experimental;
+ if (p_doc.is_experimental) {
+ dict["experimental"] = p_doc.experimental_message;
+ }
if (!p_doc.keywords.is_empty()) {
dict["keywords"] = p_doc.keywords;
@@ -352,7 +388,9 @@ public:
bool overridden = false;
String overrides;
bool is_deprecated = false;
+ String deprecated_message;
bool is_experimental = false;
+ String experimental_message;
String keywords;
bool operator<(const PropertyDoc &p_prop) const {
return name.naturalcasecmp_to(p_prop.name) < 0;
@@ -399,6 +437,7 @@ public:
doc.overrides = p_dict["overrides"];
}
+#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}
@@ -406,6 +445,17 @@ public:
if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
+#endif
+
+ if (p_dict.has("deprecated")) {
+ doc.is_deprecated = true;
+ doc.deprecated_message = p_dict["deprecated"];
+ }
+
+ if (p_dict.has("experimental")) {
+ doc.is_experimental = true;
+ doc.experimental_message = p_dict["experimental"];
+ }
if (p_dict.has("keywords")) {
doc.keywords = p_dict["keywords"];
@@ -451,9 +501,13 @@ public:
dict["overrides"] = p_doc.overrides;
}
- dict["is_deprecated"] = p_doc.is_deprecated;
+ if (p_doc.is_deprecated) {
+ dict["deprecated"] = p_doc.deprecated_message;
+ }
- dict["is_experimental"] = p_doc.is_experimental;
+ if (p_doc.is_experimental) {
+ dict["experimental"] = p_doc.experimental_message;
+ }
if (!p_doc.keywords.is_empty()) {
dict["keywords"] = p_doc.keywords;
@@ -571,7 +625,9 @@ public:
struct EnumDoc {
String description;
bool is_deprecated = false;
+ String deprecated_message;
bool is_experimental = false;
+ String experimental_message;
static EnumDoc from_dict(const Dictionary &p_dict) {
EnumDoc doc;
@@ -579,6 +635,7 @@ public:
doc.description = p_dict["description"];
}
+#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}
@@ -586,6 +643,17 @@ public:
if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
+#endif
+
+ if (p_dict.has("deprecated")) {
+ doc.is_deprecated = true;
+ doc.deprecated_message = p_dict["deprecated"];
+ }
+
+ if (p_dict.has("experimental")) {
+ doc.is_experimental = true;
+ doc.experimental_message = p_dict["experimental"];
+ }
return doc;
}
@@ -596,9 +664,13 @@ public:
dict["description"] = p_doc.description;
}
- dict["is_deprecated"] = p_doc.is_deprecated;
+ if (p_doc.is_deprecated) {
+ dict["deprecated"] = p_doc.deprecated_message;
+ }
- dict["is_experimental"] = p_doc.is_experimental;
+ if (p_doc.is_experimental) {
+ dict["experimental"] = p_doc.experimental_message;
+ }
return dict;
}
@@ -621,7 +693,9 @@ public:
Vector<MethodDoc> annotations;
Vector<ThemeItemDoc> theme_properties;
bool is_deprecated = false;
+ String deprecated_message;
bool is_experimental = false;
+ String experimental_message;
bool is_script_doc = false;
String script_path;
bool operator<(const ClassDoc &p_class) const {
@@ -730,6 +804,7 @@ public:
doc.theme_properties.push_back(ThemeItemDoc::from_dict(theme_properties[i]));
}
+#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}
@@ -737,6 +812,17 @@ public:
if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
+#endif
+
+ if (p_dict.has("deprecated")) {
+ doc.is_deprecated = true;
+ doc.deprecated_message = p_dict["deprecated"];
+ }
+
+ if (p_dict.has("experimental")) {
+ doc.is_experimental = true;
+ doc.experimental_message = p_dict["experimental"];
+ }
if (p_dict.has("is_script_doc")) {
doc.is_script_doc = p_dict["is_script_doc"];
@@ -847,9 +933,13 @@ public:
dict["theme_properties"] = theme_properties;
}
- dict["is_deprecated"] = p_doc.is_deprecated;
+ if (p_doc.is_deprecated) {
+ dict["deprecated"] = p_doc.deprecated_message;
+ }
- dict["is_experimental"] = p_doc.is_experimental;
+ if (p_doc.is_experimental) {
+ dict["experimental"] = p_doc.experimental_message;
+ }
dict["is_script_doc"] = p_doc.is_script_doc;
diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp
index 53007bf5bf..fa4e7eb2e2 100644
--- a/core/extension/gdextension.cpp
+++ b/core/extension/gdextension.cpp
@@ -914,7 +914,7 @@ Error GDExtensionResourceLoader::load_gdextension_resource(const String &p_path,
return ERR_INVALID_DATA;
}
- String library_path = GDExtension::find_extension_library(p_path, config, [](String p_feature) { return OS::get_singleton()->has_feature(p_feature); });
+ String library_path = GDExtension::find_extension_library(p_path, config, [](const String &p_feature) { return OS::get_singleton()->has_feature(p_feature); });
if (library_path.is_empty()) {
const String os_arch = OS::get_singleton()->get_name().to_lower() + "." + Engine::get_singleton()->get_architecture_name();
diff --git a/core/input/input.cpp b/core/input/input.cpp
index d87a8824f7..4117cc8c9c 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -455,7 +455,7 @@ static String _hex_str(uint8_t p_byte) {
return ret;
}
-void Input::joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid, Dictionary p_joypad_info) {
+void Input::joy_connection_changed(int p_idx, bool p_connected, const String &p_name, const String &p_guid, const Dictionary &p_joypad_info) {
_THREAD_SAFE_METHOD_
// Clear the pressed status if a Joypad gets disconnected.
@@ -1414,7 +1414,7 @@ void Input::_get_mapped_hat_events(const JoyDeviceMapping &mapping, HatDir p_hat
}
}
-JoyButton Input::_get_output_button(String output) {
+JoyButton Input::_get_output_button(const String &output) {
for (int i = 0; i < (int)JoyButton::SDL_MAX; i++) {
if (output == _joy_buttons[i]) {
return JoyButton(i);
@@ -1423,7 +1423,7 @@ JoyButton Input::_get_output_button(String output) {
return JoyButton::INVALID;
}
-JoyAxis Input::_get_output_axis(String output) {
+JoyAxis Input::_get_output_axis(const String &output) {
for (int i = 0; i < (int)JoyAxis::SDL_MAX; i++) {
if (output == _joy_axes[i]) {
return JoyAxis(i);
@@ -1432,7 +1432,7 @@ JoyAxis Input::_get_output_axis(String output) {
return JoyAxis::INVALID;
}
-void Input::parse_mapping(String p_mapping) {
+void Input::parse_mapping(const String &p_mapping) {
_THREAD_SAFE_METHOD_;
JoyDeviceMapping mapping;
@@ -1535,7 +1535,7 @@ void Input::parse_mapping(String p_mapping) {
map_db.push_back(mapping);
}
-void Input::add_joy_mapping(String p_mapping, bool p_update_existing) {
+void Input::add_joy_mapping(const String &p_mapping, bool p_update_existing) {
parse_mapping(p_mapping);
if (p_update_existing) {
Vector<String> entry = p_mapping.split(",");
@@ -1549,7 +1549,7 @@ void Input::add_joy_mapping(String p_mapping, bool p_update_existing) {
}
}
-void Input::remove_joy_mapping(String p_guid) {
+void Input::remove_joy_mapping(const String &p_guid) {
for (int i = map_db.size() - 1; i >= 0; i--) {
if (p_guid == map_db[i].uid) {
map_db.remove_at(i);
@@ -1563,7 +1563,7 @@ void Input::remove_joy_mapping(String p_guid) {
}
}
-void Input::set_fallback_mapping(String p_guid) {
+void Input::set_fallback_mapping(const String &p_guid) {
for (int i = 0; i < map_db.size(); i++) {
if (map_db[i].uid == p_guid) {
fallback_mapping = i;
diff --git a/core/input/input.h b/core/input/input.h
index a7ae3349b2..367bb93188 100644
--- a/core/input/input.h
+++ b/core/input/input.h
@@ -239,8 +239,8 @@ private:
JoyEvent _get_mapped_button_event(const JoyDeviceMapping &mapping, JoyButton p_button);
JoyEvent _get_mapped_axis_event(const JoyDeviceMapping &mapping, JoyAxis p_axis, float p_value, JoyAxisRange &r_range);
void _get_mapped_hat_events(const JoyDeviceMapping &mapping, HatDir p_hat, JoyEvent r_events[(size_t)HatDir::MAX]);
- JoyButton _get_output_button(String output);
- JoyAxis _get_output_axis(String output);
+ JoyButton _get_output_button(const String &output);
+ JoyAxis _get_output_axis(const String &output);
void _button_event(int p_device, JoyButton p_index, bool p_pressed);
void _axis_event(int p_device, JoyAxis p_axis, float p_value);
void _update_action_cache(const StringName &p_action_name, ActionState &r_action_state);
@@ -295,7 +295,7 @@ public:
Vector2 get_joy_vibration_strength(int p_device);
float get_joy_vibration_duration(int p_device);
uint64_t get_joy_vibration_timestamp(int p_device);
- void joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid = "", Dictionary p_joypad_info = Dictionary());
+ void joy_connection_changed(int p_idx, bool p_connected, const String &p_name, const String &p_guid = "", const Dictionary &p_joypad_info = Dictionary());
Vector3 get_gravity() const;
Vector3 get_accelerometer() const;
@@ -339,13 +339,13 @@ public:
CursorShape get_current_cursor_shape() const;
void set_custom_mouse_cursor(const Ref<Resource> &p_cursor, CursorShape p_shape = Input::CURSOR_ARROW, const Vector2 &p_hotspot = Vector2());
- void parse_mapping(String p_mapping);
+ void parse_mapping(const String &p_mapping);
void joy_button(int p_device, JoyButton p_button, bool p_pressed);
void joy_axis(int p_device, JoyAxis p_axis, float p_value);
void joy_hat(int p_device, BitField<HatMask> p_val);
- void add_joy_mapping(String p_mapping, bool p_update_existing = false);
- void remove_joy_mapping(String p_guid);
+ void add_joy_mapping(const String &p_mapping, bool p_update_existing = false);
+ void remove_joy_mapping(const String &p_guid);
int get_unused_joy_id();
@@ -353,7 +353,7 @@ public:
String get_joy_guid(int p_device) const;
bool should_ignore_device(int p_vendor_id, int p_product_id) const;
Dictionary get_joy_info(int p_device) const;
- void set_fallback_mapping(String p_guid);
+ void set_fallback_mapping(const String &p_guid);
void flush_buffered_events();
bool is_using_input_buffering();
diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp
index 98f8c3de41..0a4d5a3be6 100644
--- a/core/io/config_file.cpp
+++ b/core/io/config_file.cpp
@@ -81,7 +81,7 @@ void ConfigFile::set_value(const String &p_section, const String &p_key, const V
}
}
-Variant ConfigFile::get_value(const String &p_section, const String &p_key, Variant p_default) const {
+Variant ConfigFile::get_value(const String &p_section, const String &p_key, const Variant &p_default) const {
if (!values.has(p_section) || !values[p_section].has(p_key)) {
ERR_FAIL_COND_V_MSG(p_default.get_type() == Variant::NIL, Variant(),
vformat("Couldn't find the given section \"%s\" and key \"%s\", and no default was given.", p_section, p_key));
diff --git a/core/io/config_file.h b/core/io/config_file.h
index 80973ab9d0..05b4ed899e 100644
--- a/core/io/config_file.h
+++ b/core/io/config_file.h
@@ -53,7 +53,7 @@ protected:
public:
void set_value(const String &p_section, const String &p_key, const Variant &p_value);
- Variant get_value(const String &p_section, const String &p_key, Variant p_default = Variant()) const;
+ Variant get_value(const String &p_section, const String &p_key, const Variant &p_default = Variant()) const;
bool has_section(const String &p_section) const;
bool has_section_key(const String &p_section, const String &p_key) const;
diff --git a/core/io/dir_access.cpp b/core/io/dir_access.cpp
index 40c1a53958..680a653dfc 100644
--- a/core/io/dir_access.cpp
+++ b/core/io/dir_access.cpp
@@ -131,7 +131,7 @@ Error DirAccess::erase_contents_recursive() {
return _erase_recursive(this);
}
-Error DirAccess::make_dir_recursive(String p_dir) {
+Error DirAccess::make_dir_recursive(const String &p_dir) {
if (p_dir.length() < 1) {
return OK;
}
@@ -188,7 +188,7 @@ DirAccess::AccessType DirAccess::get_access_type() const {
return _access_type;
}
-String DirAccess::fix_path(String p_path) const {
+String DirAccess::fix_path(const String &p_path) const {
switch (_access_type) {
case ACCESS_RESOURCES: {
if (ProjectSettings::get_singleton()) {
@@ -338,7 +338,7 @@ String DirAccess::get_full_path(const String &p_path, AccessType p_access) {
return full;
}
-Error DirAccess::copy(String p_from, String p_to, int p_chmod_flags) {
+Error DirAccess::copy(const String &p_from, const String &p_to, int p_chmod_flags) {
//printf("copy %s -> %s\n",p_from.ascii().get_data(),p_to.ascii().get_data());
Error err;
{
@@ -396,7 +396,7 @@ class DirChanger {
String original_dir;
public:
- DirChanger(DirAccess *p_da, String p_dir) :
+ DirChanger(DirAccess *p_da, const String &p_dir) :
da(p_da),
original_dir(p_da->get_current_dir()) {
p_da->change_dir(p_dir);
@@ -407,7 +407,7 @@ public:
}
};
-Error DirAccess::_copy_dir(Ref<DirAccess> &p_target_da, String p_to, int p_chmod_flags, bool p_copy_links) {
+Error DirAccess::_copy_dir(Ref<DirAccess> &p_target_da, const String &p_to, int p_chmod_flags, bool p_copy_links) {
List<String> dirs;
String curdir = get_current_dir();
@@ -460,7 +460,7 @@ Error DirAccess::_copy_dir(Ref<DirAccess> &p_target_da, String p_to, int p_chmod
return OK;
}
-Error DirAccess::copy_dir(String p_from, String p_to, int p_chmod_flags, bool p_copy_links) {
+Error DirAccess::copy_dir(const String &p_from, String p_to, int p_chmod_flags, bool p_copy_links) {
ERR_FAIL_COND_V_MSG(!dir_exists(p_from), ERR_FILE_NOT_FOUND, "Source directory doesn't exist.");
Ref<DirAccess> target_da = DirAccess::create_for_path(p_to);
@@ -481,7 +481,7 @@ Error DirAccess::copy_dir(String p_from, String p_to, int p_chmod_flags, bool p_
return err;
}
-bool DirAccess::exists(String p_dir) {
+bool DirAccess::exists(const String &p_dir) {
Ref<DirAccess> da = DirAccess::create_for_path(p_dir);
return da->change_dir(p_dir) == OK;
}
diff --git a/core/io/dir_access.h b/core/io/dir_access.h
index 4ee69571f2..d175235b98 100644
--- a/core/io/dir_access.h
+++ b/core/io/dir_access.h
@@ -54,7 +54,7 @@ private:
static CreateFunc create_func[ACCESS_MAX]; ///< set this to instance a filesystem object
static Ref<DirAccess> _open(const String &p_path);
- Error _copy_dir(Ref<DirAccess> &p_target_da, String p_to, int p_chmod_flags, bool p_copy_links);
+ Error _copy_dir(Ref<DirAccess> &p_target_da, const String &p_to, int p_chmod_flags, bool p_copy_links);
PackedStringArray _get_contents(bool p_directories);
thread_local static Error last_dir_open_error;
@@ -68,7 +68,7 @@ protected:
virtual String _get_root_string() const;
AccessType get_access_type() const;
- virtual String fix_path(String p_path) const;
+ virtual String fix_path(const String &p_path) const;
template <class T>
static Ref<DirAccess> _create_builtin() {
@@ -91,18 +91,18 @@ public:
virtual Error change_dir(String p_dir) = 0; ///< can be relative or absolute, return false on success
virtual String get_current_dir(bool p_include_drive = true) const = 0; ///< return current dir location
virtual Error make_dir(String p_dir) = 0;
- virtual Error make_dir_recursive(String p_dir);
+ virtual Error make_dir_recursive(const String &p_dir);
virtual Error erase_contents_recursive(); //super dangerous, use with care!
virtual bool file_exists(String p_file) = 0;
virtual bool dir_exists(String p_dir) = 0;
virtual bool is_readable(String p_dir) { return true; };
virtual bool is_writable(String p_dir) { return true; };
- static bool exists(String p_dir);
+ static bool exists(const String &p_dir);
virtual uint64_t get_space_left() = 0;
- Error copy_dir(String p_from, String p_to, int p_chmod_flags = -1, bool p_copy_links = false);
- virtual Error copy(String p_from, String p_to, int p_chmod_flags = -1);
+ Error copy_dir(const String &p_from, String p_to, int p_chmod_flags = -1, bool p_copy_links = false);
+ virtual Error copy(const String &p_from, const String &p_to, int p_chmod_flags = -1);
virtual Error rename(String p_from, String p_to) = 0;
virtual Error remove(String p_name) = 0;
@@ -112,7 +112,7 @@ public:
// Meant for editor code when we want to quickly remove a file without custom
// handling (e.g. removing a cache file).
- static void remove_file_or_error(String p_path) {
+ static void remove_file_or_error(const String &p_path) {
Ref<DirAccess> da = create(ACCESS_FILESYSTEM);
if (da->file_exists(p_path)) {
if (da->remove(p_path) != OK) {
diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp
index da02c883e8..9521a4f666 100644
--- a/core/io/file_access_memory.cpp
+++ b/core/io/file_access_memory.cpp
@@ -36,7 +36,7 @@
static HashMap<String, Vector<uint8_t>> *files = nullptr;
-void FileAccessMemory::register_file(String p_name, Vector<uint8_t> p_data) {
+void FileAccessMemory::register_file(const String &p_name, const Vector<uint8_t> &p_data) {
if (!files) {
files = memnew((HashMap<String, Vector<uint8_t>>));
}
diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h
index ac08e5406f..d9efb354c3 100644
--- a/core/io/file_access_memory.h
+++ b/core/io/file_access_memory.h
@@ -41,7 +41,7 @@ class FileAccessMemory : public FileAccess {
static Ref<FileAccess> create();
public:
- static void register_file(String p_name, Vector<uint8_t> p_data);
+ static void register_file(const String &p_name, const Vector<uint8_t> &p_data);
static void cleanup();
virtual Error open_custom(const uint8_t *p_data, uint64_t p_len); ///< open a file
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index 5a4d6dd099..7595bc41f5 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -455,7 +455,7 @@ String DirAccessPack::get_drive(int p_drive) {
return "";
}
-PackedData::PackedDir *DirAccessPack::_find_dir(String p_dir) {
+PackedData::PackedDir *DirAccessPack::_find_dir(const String &p_dir) {
String nd = p_dir.replace("\\", "/");
// Special handling since simplify_path() will forbid it
diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h
index 97391a5611..c65e65d17d 100644
--- a/core/io/file_access_pack.h
+++ b/core/io/file_access_pack.h
@@ -222,7 +222,7 @@ class DirAccessPack : public DirAccess {
List<String> list_files;
bool cdir = false;
- PackedData::PackedDir *_find_dir(String p_dir);
+ PackedData::PackedDir *_find_dir(const String &p_dir);
public:
virtual Error list_dir_begin() override;
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp
index dd45332412..3c7f67664d 100644
--- a/core/io/file_access_zip.cpp
+++ b/core/io/file_access_zip.cpp
@@ -115,7 +115,7 @@ void ZipArchive::close_handle(unzFile p_file) const {
unzClose(p_file);
}
-unzFile ZipArchive::get_file_handle(String p_file) const {
+unzFile ZipArchive::get_file_handle(const String &p_file) const {
ERR_FAIL_COND_V_MSG(!file_exists(p_file), nullptr, "File '" + p_file + " doesn't exist.");
File file = files[p_file];
@@ -206,7 +206,7 @@ bool ZipArchive::try_open_pack(const String &p_path, bool p_replace_files, uint6
return true;
}
-bool ZipArchive::file_exists(String p_name) const {
+bool ZipArchive::file_exists(const String &p_name) const {
return files.has(p_name);
}
diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h
index 1062a06238..e9ea74e01d 100644
--- a/core/io/file_access_zip.h
+++ b/core/io/file_access_zip.h
@@ -61,11 +61,11 @@ private:
public:
void close_handle(unzFile p_file) const;
- unzFile get_file_handle(String p_file) const;
+ unzFile get_file_handle(const String &p_file) const;
- Error add_package(String p_name);
+ Error add_package(const String &p_name);
- bool file_exists(String p_name) const;
+ bool file_exists(const String &p_name) const;
virtual bool try_open_pack(const String &p_path, bool p_replace_files, uint64_t p_offset) override;
Ref<FileAccess> get_file(const String &p_path, PackedData::PackedFile *p_file) override;
diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp
index bef515f259..92c690dc2a 100644
--- a/core/io/image_loader.cpp
+++ b/core/io/image_loader.cpp
@@ -80,7 +80,7 @@ void ImageFormatLoaderExtension::_bind_methods() {
ClassDB::bind_method(D_METHOD("remove_format_loader"), &ImageFormatLoaderExtension::remove_format_loader);
}
-Error ImageLoader::load_image(String p_file, Ref<Image> p_image, Ref<FileAccess> p_custom, BitField<ImageFormatLoader::LoaderFlags> p_flags, float p_scale) {
+Error ImageLoader::load_image(const String &p_file, Ref<Image> p_image, Ref<FileAccess> p_custom, BitField<ImageFormatLoader::LoaderFlags> p_flags, float p_scale) {
ERR_FAIL_COND_V_MSG(p_image.is_null(), ERR_INVALID_PARAMETER, "Can't load an image: invalid Image object.");
Ref<FileAccess> f = p_custom;
diff --git a/core/io/image_loader.h b/core/io/image_loader.h
index ac51f13376..e9b434522d 100644
--- a/core/io/image_loader.h
+++ b/core/io/image_loader.h
@@ -91,7 +91,7 @@ class ImageLoader {
protected:
public:
- static Error load_image(String p_file, Ref<Image> p_image, Ref<FileAccess> p_custom = Ref<FileAccess>(), BitField<ImageFormatLoader::LoaderFlags> p_flags = ImageFormatLoader::FLAG_NONE, float p_scale = 1.0);
+ static Error load_image(const String &p_file, Ref<Image> p_image, Ref<FileAccess> p_custom = Ref<FileAccess>(), BitField<ImageFormatLoader::LoaderFlags> p_flags = ImageFormatLoader::FLAG_NONE, float p_scale = 1.0);
static void get_recognized_extensions(List<String> *p_extensions);
static Ref<ImageFormatLoader> recognize(const String &p_extension);
diff --git a/core/io/ip.cpp b/core/io/ip.cpp
index 254351897d..ec86104926 100644
--- a/core/io/ip.cpp
+++ b/core/io/ip.cpp
@@ -117,7 +117,7 @@ struct _IP_ResolverPrivate {
HashMap<String, List<IPAddress>> cache;
- static String get_cache_key(String p_hostname, IP::Type p_type) {
+ static String get_cache_key(const String &p_hostname, IP::Type p_type) {
return itos(p_type) + p_hostname;
}
};
diff --git a/core/io/logger.cpp b/core/io/logger.cpp
index b262c1cf28..441df7f5d1 100644
--- a/core/io/logger.cpp
+++ b/core/io/logger.cpp
@@ -230,7 +230,7 @@ void StdLogger::logv(const char *p_format, va_list p_list, bool p_err) {
}
}
-CompositeLogger::CompositeLogger(Vector<Logger *> p_loggers) :
+CompositeLogger::CompositeLogger(const Vector<Logger *> &p_loggers) :
loggers(p_loggers) {
}
diff --git a/core/io/logger.h b/core/io/logger.h
index 943d61e2e8..3cd18965c5 100644
--- a/core/io/logger.h
+++ b/core/io/logger.h
@@ -96,7 +96,7 @@ class CompositeLogger : public Logger {
Vector<Logger *> loggers;
public:
- explicit CompositeLogger(Vector<Logger *> p_loggers);
+ explicit CompositeLogger(const Vector<Logger *> &p_loggers);
virtual void logv(const char *p_format, va_list p_list, bool p_err) override _PRINTF_FORMAT_ATTRIBUTE_2_0;
virtual void log_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify, ErrorType p_type = ERR_ERROR) override;
diff --git a/core/io/net_socket.h b/core/io/net_socket.h
index 2c1a020a46..120ad5e85b 100644
--- a/core/io/net_socket.h
+++ b/core/io/net_socket.h
@@ -74,8 +74,8 @@ public:
virtual void set_ipv6_only_enabled(bool p_enabled) = 0;
virtual void set_tcp_no_delay_enabled(bool p_enabled) = 0;
virtual void set_reuse_address_enabled(bool p_enabled) = 0;
- virtual Error join_multicast_group(const IPAddress &p_multi_address, String p_if_name) = 0;
- virtual Error leave_multicast_group(const IPAddress &p_multi_address, String p_if_name) = 0;
+ virtual Error join_multicast_group(const IPAddress &p_multi_address, const String &p_if_name) = 0;
+ virtual Error leave_multicast_group(const IPAddress &p_multi_address, const String &p_if_name) = 0;
};
#endif // NET_SOCKET_H
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp
index dfd4798d2e..32030146bb 100644
--- a/core/io/packet_peer_udp.cpp
+++ b/core/io/packet_peer_udp.cpp
@@ -45,7 +45,7 @@ void PacketPeerUDP::set_broadcast_enabled(bool p_enabled) {
}
}
-Error PacketPeerUDP::join_multicast_group(IPAddress p_multi_address, String p_if_name) {
+Error PacketPeerUDP::join_multicast_group(IPAddress p_multi_address, const String &p_if_name) {
ERR_FAIL_COND_V(udp_server, ERR_LOCKED);
ERR_FAIL_COND_V(!_sock.is_valid(), ERR_UNAVAILABLE);
ERR_FAIL_COND_V(!p_multi_address.is_valid(), ERR_INVALID_PARAMETER);
@@ -60,7 +60,7 @@ Error PacketPeerUDP::join_multicast_group(IPAddress p_multi_address, String p_if
return _sock->join_multicast_group(p_multi_address, p_if_name);
}
-Error PacketPeerUDP::leave_multicast_group(IPAddress p_multi_address, String p_if_name) {
+Error PacketPeerUDP::leave_multicast_group(IPAddress p_multi_address, const String &p_if_name) {
ERR_FAIL_COND_V(udp_server, ERR_LOCKED);
ERR_FAIL_COND_V(!_sock.is_valid(), ERR_UNAVAILABLE);
ERR_FAIL_COND_V(!_sock->is_open(), ERR_UNCONFIGURED);
diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h
index 3e0e3b437e..c69a138c53 100644
--- a/core/io/packet_peer_udp.h
+++ b/core/io/packet_peer_udp.h
@@ -91,8 +91,8 @@ public:
int get_available_packet_count() const override;
int get_max_packet_size() const override;
void set_broadcast_enabled(bool p_enabled);
- Error join_multicast_group(IPAddress p_multi_address, String p_if_name);
- Error leave_multicast_group(IPAddress p_multi_address, String p_if_name);
+ Error join_multicast_group(IPAddress p_multi_address, const String &p_if_name);
+ Error leave_multicast_group(IPAddress p_multi_address, const String &p_if_name);
PacketPeerUDP();
~PacketPeerUDP();
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 64b47ad19d..5344266a9c 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -1114,7 +1114,7 @@ void ResourceLoader::set_load_callback(ResourceLoadedCallback p_callback) {
ResourceLoadedCallback ResourceLoader::_loaded_callback = nullptr;
-Ref<ResourceFormatLoader> ResourceLoader::_find_custom_resource_format_loader(String path) {
+Ref<ResourceFormatLoader> ResourceLoader::_find_custom_resource_format_loader(const String &path) {
for (int i = 0; i < loader_count; ++i) {
if (loader[i]->get_script_instance() && loader[i]->get_script_instance()->get_script()->get_path() == path) {
return loader[i];
@@ -1123,7 +1123,7 @@ Ref<ResourceFormatLoader> ResourceLoader::_find_custom_resource_format_loader(St
return Ref<ResourceFormatLoader>();
}
-bool ResourceLoader::add_custom_resource_format_loader(String script_path) {
+bool ResourceLoader::add_custom_resource_format_loader(const String &script_path) {
if (_find_custom_resource_format_loader(script_path).is_valid()) {
return false;
}
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h
index 3099d9aab3..1f79b83f11 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -158,7 +158,7 @@ private:
static ResourceLoadedCallback _loaded_callback;
- static Ref<ResourceFormatLoader> _find_custom_resource_format_loader(String path);
+ static Ref<ResourceFormatLoader> _find_custom_resource_format_loader(const String &path);
struct ThreadLoadTask {
WorkerThreadPool::TaskID task_id = 0; // Used if run on a worker thread from the pool.
@@ -263,7 +263,7 @@ public:
static void set_load_callback(ResourceLoadedCallback p_callback);
static ResourceLoaderImport import;
- static bool add_custom_resource_format_loader(String script_path);
+ static bool add_custom_resource_format_loader(const String &script_path);
static void add_custom_loaders();
static void remove_custom_loaders();
diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp
index 51ebea7f2c..e4022b2073 100644
--- a/core/io/resource_saver.cpp
+++ b/core/io/resource_saver.cpp
@@ -215,7 +215,7 @@ void ResourceSaver::remove_resource_format_saver(Ref<ResourceFormatSaver> p_form
--saver_count;
}
-Ref<ResourceFormatSaver> ResourceSaver::_find_custom_resource_format_saver(String path) {
+Ref<ResourceFormatSaver> ResourceSaver::_find_custom_resource_format_saver(const String &path) {
for (int i = 0; i < saver_count; ++i) {
if (saver[i]->get_script_instance() && saver[i]->get_script_instance()->get_script()->get_path() == path) {
return saver[i];
@@ -224,7 +224,7 @@ Ref<ResourceFormatSaver> ResourceSaver::_find_custom_resource_format_saver(Strin
return Ref<ResourceFormatSaver>();
}
-bool ResourceSaver::add_custom_resource_format_saver(String script_path) {
+bool ResourceSaver::add_custom_resource_format_saver(const String &script_path) {
if (_find_custom_resource_format_saver(script_path).is_valid()) {
return false;
}
diff --git a/core/io/resource_saver.h b/core/io/resource_saver.h
index 4828df297a..3e0821926a 100644
--- a/core/io/resource_saver.h
+++ b/core/io/resource_saver.h
@@ -70,7 +70,7 @@ class ResourceSaver {
static ResourceSavedCallback save_callback;
static ResourceSaverGetResourceIDForPath save_get_id_for_path;
- static Ref<ResourceFormatSaver> _find_custom_resource_format_saver(String path);
+ static Ref<ResourceFormatSaver> _find_custom_resource_format_saver(const String &path);
public:
enum SaverFlags {
@@ -99,7 +99,7 @@ public:
static void set_save_callback(ResourceSavedCallback p_callback);
static void set_get_resource_id_for_path(ResourceSaverGetResourceIDForPath p_callback);
- static bool add_custom_resource_format_saver(String script_path);
+ static bool add_custom_resource_format_saver(const String &script_path);
static void add_custom_savers();
static void remove_custom_savers();
};
diff --git a/core/io/zip_io.cpp b/core/io/zip_io.cpp
index a89c6253f1..972656e237 100644
--- a/core/io/zip_io.cpp
+++ b/core/io/zip_io.cpp
@@ -53,7 +53,7 @@ int godot_unzip_get_current_file_info(unzFile p_zip_file, unz_file_info64 &r_fil
return err;
}
-int godot_unzip_locate_file(unzFile p_zip_file, String p_filepath, bool p_case_sensitive) {
+int godot_unzip_locate_file(unzFile p_zip_file, const String &p_filepath, bool p_case_sensitive) {
int err = unzGoToFirstFile(p_zip_file);
while (err == UNZ_OK) {
unz_file_info64 current_file_info;
diff --git a/core/io/zip_io.h b/core/io/zip_io.h
index c59b981373..cd5c873c4b 100644
--- a/core/io/zip_io.h
+++ b/core/io/zip_io.h
@@ -42,7 +42,7 @@
// Get the current file info and safely convert the full filepath to a String.
int godot_unzip_get_current_file_info(unzFile p_zip_file, unz_file_info64 &r_file_info, String &r_filepath);
// Try to locate the file in the archive specified by the filepath (works with large paths and Unicode).
-int godot_unzip_locate_file(unzFile p_zip_file, String p_filepath, bool p_case_sensitive = true);
+int godot_unzip_locate_file(unzFile p_zip_file, const String &p_filepath, bool p_case_sensitive = true);
//
diff --git a/core/math/expression.cpp b/core/math/expression.cpp
index d1ec987d56..636c2c16bf 100644
--- a/core/math/expression.cpp
+++ b/core/math/expression.cpp
@@ -1494,7 +1494,7 @@ Error Expression::parse(const String &p_expression, const Vector<String> &p_inpu
return OK;
}
-Variant Expression::execute(Array p_inputs, Object *p_base, bool p_show_error, bool p_const_calls_only) {
+Variant Expression::execute(const Array &p_inputs, Object *p_base, bool p_show_error, bool p_const_calls_only) {
ERR_FAIL_COND_V_MSG(error_set, Variant(), "There was previously a parse error: " + error_str + ".");
execution_error = false;
diff --git a/core/math/expression.h b/core/math/expression.h
index 175db4e25e..c6ad1bd634 100644
--- a/core/math/expression.h
+++ b/core/math/expression.h
@@ -264,7 +264,7 @@ protected:
public:
Error parse(const String &p_expression, const Vector<String> &p_input_names = Vector<String>());
- Variant execute(Array p_inputs = Array(), Object *p_base = nullptr, bool p_show_error = true, bool p_const_calls_only = false);
+ Variant execute(const Array &p_inputs = Array(), Object *p_base = nullptr, bool p_show_error = true, bool p_const_calls_only = false);
bool has_execute_failed() const;
String get_error_text() const;
diff --git a/core/math/geometry_2d.cpp b/core/math/geometry_2d.cpp
index 1e5f12bebf..602e95bc13 100644
--- a/core/math/geometry_2d.cpp
+++ b/core/math/geometry_2d.cpp
@@ -37,7 +37,7 @@
#define SCALE_FACTOR 100000.0 // Based on CMP_EPSILON.
-Vector<Vector<Vector2>> Geometry2D::decompose_polygon_in_convex(Vector<Point2> polygon) {
+Vector<Vector<Vector2>> Geometry2D::decompose_polygon_in_convex(const Vector<Point2> &polygon) {
Vector<Vector<Vector2>> decomp;
List<TPPLPoly> in_poly, out_poly;
diff --git a/core/math/geometry_2d.h b/core/math/geometry_2d.h
index 9907d579a5..fbcaa018a8 100644
--- a/core/math/geometry_2d.h
+++ b/core/math/geometry_2d.h
@@ -489,7 +489,7 @@ public:
return points;
}
- static Vector<Vector<Vector2>> decompose_polygon_in_convex(Vector<Point2> polygon);
+ static Vector<Vector<Vector2>> decompose_polygon_in_convex(const Vector<Point2> &polygon);
static void make_atlas(const Vector<Size2i> &p_rects, Vector<Point2i> &r_result, Size2i &r_size);
static Vector<Vector3i> partial_pack_rects(const Vector<Vector2i> &p_sizes, const Size2i &p_atlas_size);
diff --git a/core/math/geometry_3d.cpp b/core/math/geometry_3d.cpp
index 9dd88485f9..e2edf8b23e 100644
--- a/core/math/geometry_3d.cpp
+++ b/core/math/geometry_3d.cpp
@@ -449,7 +449,7 @@ static inline void _build_faces(uint8_t ***p_cell_status, int x, int y, int z, i
}
}
-Vector<Face3> Geometry3D::wrap_geometry(Vector<Face3> p_array, real_t *p_error) {
+Vector<Face3> Geometry3D::wrap_geometry(const Vector<Face3> &p_array, real_t *p_error) {
int face_count = p_array.size();
const Face3 *faces = p_array.ptr();
constexpr double min_size = 1.0;
diff --git a/core/math/geometry_3d.h b/core/math/geometry_3d.h
index 305a64e39c..d9788d036f 100644
--- a/core/math/geometry_3d.h
+++ b/core/math/geometry_3d.h
@@ -549,7 +549,7 @@ public:
}
// Create a "wrap" that encloses the given geometry.
- static Vector<Face3> wrap_geometry(Vector<Face3> p_array, real_t *p_error = nullptr);
+ static Vector<Face3> wrap_geometry(const Vector<Face3> &p_array, real_t *p_error = nullptr);
struct MeshData {
struct Face {
diff --git a/core/object/object.h b/core/object/object.h
index d697f14b7e..27f28b4aae 100644
--- a/core/object/object.h
+++ b/core/object/object.h
@@ -165,7 +165,7 @@ struct PropertyInfo {
PropertyInfo() {}
- PropertyInfo(const Variant::Type p_type, const String p_name, const PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", const uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName()) :
+ PropertyInfo(const Variant::Type p_type, const String &p_name, const PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", const uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName()) :
type(p_type),
name(p_name),
hint(p_hint),
diff --git a/core/object/script_language.h b/core/object/script_language.h
index 294231a3e7..4217bc9f96 100644
--- a/core/object/script_language.h
+++ b/core/object/script_language.h
@@ -239,7 +239,7 @@ public:
void get_core_type_words(List<String> *p_core_type_words) const;
virtual void get_reserved_words(List<String> *p_words) const = 0;
- virtual bool is_control_flow_keyword(String p_string) const = 0;
+ virtual bool is_control_flow_keyword(const String &p_string) const = 0;
virtual void get_comment_delimiters(List<String> *p_delimiters) const = 0;
virtual void get_doc_comment_delimiters(List<String> *p_delimiters) const = 0;
virtual void get_string_delimiters(List<String> *p_delimiters) const = 0;
@@ -257,6 +257,7 @@ public:
virtual bool can_inherit_from_file() const { return false; }
virtual int find_function(const String &p_function, const String &p_code) const = 0;
virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const = 0;
+ virtual bool can_make_function() const { return true; }
virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return ERR_UNAVAILABLE; }
virtual bool overrides_external_editor() { return false; }
diff --git a/core/object/script_language_extension.cpp b/core/object/script_language_extension.cpp
index be62cabe25..3a9b171f28 100644
--- a/core/object/script_language_extension.cpp
+++ b/core/object/script_language_extension.cpp
@@ -109,6 +109,7 @@ void ScriptLanguageExtension::_bind_methods() {
GDVIRTUAL_BIND(_can_inherit_from_file);
GDVIRTUAL_BIND(_find_function, "function", "code");
GDVIRTUAL_BIND(_make_function, "class_name", "function_name", "function_args");
+ GDVIRTUAL_BIND(_can_make_function);
GDVIRTUAL_BIND(_open_in_external_editor, "script", "line", "column");
GDVIRTUAL_BIND(_overrides_external_editor);
diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h
index 5b10739486..b7222a159a 100644
--- a/core/object/script_language_extension.h
+++ b/core/object/script_language_extension.h
@@ -229,7 +229,7 @@ public:
p_words->push_back(ret[i]);
}
}
- EXBIND1RC(bool, is_control_flow_keyword, String)
+ EXBIND1RC(bool, is_control_flow_keyword, const String &)
GDVIRTUAL0RC(Vector<String>, _get_comment_delimiters)
@@ -373,6 +373,7 @@ public:
EXBIND2RC(int, find_function, const String &, const String &)
EXBIND3RC(String, make_function, const String &, const String &, const PackedStringArray &)
+ EXBIND0RC(bool, can_make_function)
EXBIND3R(Error, open_in_external_editor, const Ref<Script> &, int, int)
EXBIND0R(bool, overrides_external_editor)
diff --git a/core/os/os.cpp b/core/os/os.cpp
index d5d9988cc1..8582888740 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -298,7 +298,7 @@ String OS::get_system_dir(SystemDir p_dir, bool p_shared_storage) const {
return ".";
}
-Error OS::shell_open(String p_uri) {
+Error OS::shell_open(const String &p_uri) {
return ERR_UNAVAILABLE;
}
diff --git a/core/os/os.h b/core/os/os.h
index e22514dce3..e0dda0b155 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -86,7 +86,7 @@ protected:
void _set_logger(CompositeLogger *p_logger);
public:
- typedef void (*ImeCallback)(void *p_inp, String p_text, Point2 p_selection);
+ typedef void (*ImeCallback)(void *p_inp, const String &p_text, Point2 p_selection);
typedef bool (*HasServerFeatureCallback)(const String &p_feature);
enum RenderThreadMode {
@@ -109,8 +109,8 @@ protected:
virtual void initialize() = 0;
virtual void initialize_joypads() = 0;
- void set_current_rendering_driver_name(String p_driver_name) { _current_rendering_driver_name = p_driver_name; }
- void set_current_rendering_method(String p_name) { _current_rendering_method = p_name; }
+ void set_current_rendering_driver_name(const String &p_driver_name) { _current_rendering_driver_name = p_driver_name; }
+ void set_current_rendering_method(const String &p_name) { _current_rendering_method = p_name; }
void set_display_driver_id(int p_display_driver_id) { _display_driver_id = p_display_driver_id; }
@@ -152,9 +152,9 @@ public:
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
- virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) { return ERR_UNAVAILABLE; }
+ virtual Error open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) { return ERR_UNAVAILABLE; }
virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; }
- virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) { return ERR_UNAVAILABLE; }
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String &p_name, void *&p_symbol_handle, bool p_optional = false) { return ERR_UNAVAILABLE; }
virtual void set_low_processor_usage_mode(bool p_enabled);
virtual bool is_in_low_processor_usage_mode() const;
@@ -176,7 +176,7 @@ public:
virtual bool is_process_running(const ProcessID &p_pid) const = 0;
virtual void vibrate_handheld(int p_duration_ms = 500) {}
- virtual Error shell_open(String p_uri);
+ virtual Error shell_open(const String &p_uri);
virtual Error shell_show_in_file_manager(String p_path, bool p_open_folder = true);
virtual Error set_cwd(const String &p_cwd);
diff --git a/core/os/time.cpp b/core/os/time.cpp
index 7068935d36..d1d3588d09 100644
--- a/core/os/time.cpp
+++ b/core/os/time.cpp
@@ -255,7 +255,7 @@ String Time::get_time_string_from_unix_time(int64_t p_unix_time_val) const {
return vformat("%02d:%02d:%02d", hour, minute, second);
}
-Dictionary Time::get_datetime_dict_from_datetime_string(String p_datetime, bool p_weekday) const {
+Dictionary Time::get_datetime_dict_from_datetime_string(const String &p_datetime, bool p_weekday) const {
PARSE_ISO8601_STRING(Dictionary())
Dictionary dict;
dict[YEAR_KEY] = year;
@@ -273,7 +273,7 @@ Dictionary Time::get_datetime_dict_from_datetime_string(String p_datetime, bool
return dict;
}
-String Time::get_datetime_string_from_datetime_dict(const Dictionary p_datetime, bool p_use_space) const {
+String Time::get_datetime_string_from_datetime_dict(const Dictionary &p_datetime, bool p_use_space) const {
ERR_FAIL_COND_V_MSG(p_datetime.is_empty(), "", "Invalid datetime Dictionary: Dictionary is empty.");
EXTRACT_FROM_DICTIONARY
VALIDATE_YMDHMS("")
@@ -287,7 +287,7 @@ String Time::get_datetime_string_from_datetime_dict(const Dictionary p_datetime,
return timestamp;
}
-int64_t Time::get_unix_time_from_datetime_dict(const Dictionary p_datetime) const {
+int64_t Time::get_unix_time_from_datetime_dict(const Dictionary &p_datetime) const {
ERR_FAIL_COND_V_MSG(p_datetime.is_empty(), 0, "Invalid datetime Dictionary: Dictionary is empty");
EXTRACT_FROM_DICTIONARY
VALIDATE_YMDHMS(0)
@@ -295,7 +295,7 @@ int64_t Time::get_unix_time_from_datetime_dict(const Dictionary p_datetime) cons
return day_number * SECONDS_PER_DAY + hour * 3600 + minute * 60 + second;
}
-int64_t Time::get_unix_time_from_datetime_string(String p_datetime) const {
+int64_t Time::get_unix_time_from_datetime_string(const String &p_datetime) const {
PARSE_ISO8601_STRING(-1)
VALIDATE_YMDHMS(0)
YMD_TO_DAY_NUMBER
diff --git a/core/os/time.h b/core/os/time.h
index ccd2d92b8b..6550cd905e 100644
--- a/core/os/time.h
+++ b/core/os/time.h
@@ -59,10 +59,10 @@ public:
String get_datetime_string_from_unix_time(int64_t p_unix_time_val, bool p_use_space = false) const;
String get_date_string_from_unix_time(int64_t p_unix_time_val) const;
String get_time_string_from_unix_time(int64_t p_unix_time_val) const;
- Dictionary get_datetime_dict_from_datetime_string(String p_datetime, bool p_weekday = true) const;
- String get_datetime_string_from_datetime_dict(const Dictionary p_datetime, bool p_use_space = false) const;
- int64_t get_unix_time_from_datetime_dict(const Dictionary p_datetime) const;
- int64_t get_unix_time_from_datetime_string(String p_datetime) const;
+ Dictionary get_datetime_dict_from_datetime_string(const String &p_datetime, bool p_weekday = true) const;
+ String get_datetime_string_from_datetime_dict(const Dictionary &p_datetime, bool p_use_space = false) const;
+ int64_t get_unix_time_from_datetime_dict(const Dictionary &p_datetime) const;
+ int64_t get_unix_time_from_datetime_string(const String &p_datetime) const;
String get_offset_string_from_offset_minutes(int64_t p_offset_minutes) const;
// Methods that get information from OS.
diff --git a/core/string/print_string.cpp b/core/string/print_string.cpp
index e3614be359..0f019c405f 100644
--- a/core/string/print_string.cpp
+++ b/core/string/print_string.cpp
@@ -68,7 +68,7 @@ void remove_print_handler(const PrintHandlerList *p_handler) {
ERR_FAIL_NULL(l);
}
-void __print_line(String p_string) {
+void __print_line(const String &p_string) {
if (!CoreGlobals::print_line_enabled) {
return;
}
@@ -85,7 +85,7 @@ void __print_line(String p_string) {
_global_unlock();
}
-void __print_line_rich(String p_string) {
+void __print_line_rich(const String &p_string) {
if (!CoreGlobals::print_line_enabled) {
return;
}
@@ -178,7 +178,7 @@ void __print_line_rich(String p_string) {
_global_unlock();
}
-void print_error(String p_string) {
+void print_error(const String &p_string) {
if (!CoreGlobals::print_error_enabled) {
return;
}
@@ -199,6 +199,6 @@ bool is_print_verbose_enabled() {
return OS::get_singleton()->is_stdout_verbose();
}
-String stringify_variants(Variant p_var) {
+String stringify_variants(const Variant &p_var) {
return p_var.operator String();
}
diff --git a/core/string/print_string.h b/core/string/print_string.h
index 7656e9bfa1..570e08c5fb 100644
--- a/core/string/print_string.h
+++ b/core/string/print_string.h
@@ -46,19 +46,19 @@ struct PrintHandlerList {
PrintHandlerList() {}
};
-String stringify_variants(Variant p_var);
+String stringify_variants(const Variant &p_var);
template <typename... Args>
-String stringify_variants(Variant p_var, Args... p_args) {
+String stringify_variants(const Variant &p_var, Args... p_args) {
return p_var.operator String() + " " + stringify_variants(p_args...);
}
void add_print_handler(PrintHandlerList *p_handler);
void remove_print_handler(const PrintHandlerList *p_handler);
-extern void __print_line(String p_string);
-extern void __print_line_rich(String p_string);
-extern void print_error(String p_string);
+extern void __print_line(const String &p_string);
+extern void __print_line_rich(const String &p_string);
+extern void print_error(const String &p_string);
extern bool is_print_verbose_enabled();
// This version avoids processing the text to be printed until it actually has to be printed, saving some CPU usage.
@@ -69,21 +69,21 @@ extern bool is_print_verbose_enabled();
} \
}
-inline void print_line(Variant v) {
+inline void print_line(const Variant &v) {
__print_line(stringify_variants(v));
}
-inline void print_line_rich(Variant v) {
+inline void print_line_rich(const Variant &v) {
__print_line_rich(stringify_variants(v));
}
template <typename... Args>
-void print_line(Variant p_var, Args... p_args) {
+void print_line(const Variant &p_var, Args... p_args) {
__print_line(stringify_variants(p_var, p_args...));
}
template <typename... Args>
-void print_line_rich(Variant p_var, Args... p_args) {
+void print_line_rich(const Variant &p_var, Args... p_args) {
__print_line_rich(stringify_variants(p_var, p_args...));
}
diff --git a/core/string/string_name.h b/core/string/string_name.h
index 4ed58d8286..89b4c07e0e 100644
--- a/core/string/string_name.h
+++ b/core/string/string_name.h
@@ -71,11 +71,6 @@ class StringName {
_Data *_data = nullptr;
- union _HashUnion {
- _Data *ptr = nullptr;
- uint32_t hash;
- };
-
void unref();
friend void register_core_types();
friend void unregister_core_types();
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp
index d094184c4b..67b0fdee20 100644
--- a/core/string/ustring.cpp
+++ b/core/string/ustring.cpp
@@ -1438,7 +1438,7 @@ Vector<int> String::split_ints_mk(const Vector<String> &p_splitters, bool p_allo
return ret;
}
-String String::join(Vector<String> parts) const {
+String String::join(const Vector<String> &parts) const {
String ret;
for (int i = 0; i < parts.size(); ++i) {
if (i > 0) {
diff --git a/core/string/ustring.h b/core/string/ustring.h
index 5ed20396d6..b1348ceb48 100644
--- a/core/string/ustring.h
+++ b/core/string/ustring.h
@@ -361,7 +361,7 @@ public:
Vector<int> split_ints(const String &p_splitter, bool p_allow_empty = true) const;
Vector<int> split_ints_mk(const Vector<String> &p_splitters, bool p_allow_empty = true) const;
- String join(Vector<String> parts) const;
+ String join(const Vector<String> &parts) const;
static char32_t char_uppercase(char32_t p_char);
static char32_t char_lowercase(char32_t p_char);
diff --git a/core/templates/vector.h b/core/templates/vector.h
index 361a7f56d5..0de6a34ced 100644
--- a/core/templates/vector.h
+++ b/core/templates/vector.h
@@ -100,7 +100,7 @@ public:
Size rfind(const T &p_val, Size p_from = -1) const { return _cowdata.rfind(p_val, p_from); }
Size count(const T &p_val) const { return _cowdata.count(p_val); }
- void append_array(Vector<T> p_other);
+ void append_array(const Vector<T> &p_other);
_FORCE_INLINE_ bool has(const T &p_val) const { return find(p_val) != -1; }
@@ -300,7 +300,7 @@ void Vector<T>::reverse() {
}
template <class T>
-void Vector<T>::append_array(Vector<T> p_other) {
+void Vector<T>::append_array(const Vector<T> &p_other) {
const Size ds = p_other.size();
if (ds == 0) {
return;
diff --git a/core/variant/method_ptrcall.h b/core/variant/method_ptrcall.h
index 79be85cae6..1be54ba3fd 100644
--- a/core/variant/method_ptrcall.h
+++ b/core/variant/method_ptrcall.h
@@ -216,7 +216,7 @@ struct PtrToArg<ObjectID> {
} \
return ret; \
} \
- _FORCE_INLINE_ static void encode(Vector<m_type> p_vec, void *p_ptr) { \
+ _FORCE_INLINE_ static void encode(const Vector<m_type> &p_vec, void *p_ptr) { \
Vector<m_type> *dv = reinterpret_cast<Vector<m_type> *>(p_ptr); \
int len = p_vec.size(); \
dv->resize(len); \
@@ -246,49 +246,49 @@ struct PtrToArg<ObjectID> {
}
// No EncodeT because direct pointer conversion not possible.
-#define MAKE_VECARG_ALT(m_type, m_type_alt) \
- template <> \
- struct PtrToArg<Vector<m_type_alt>> { \
- _FORCE_INLINE_ static Vector<m_type_alt> convert(const void *p_ptr) { \
- const Vector<m_type> *dvs = reinterpret_cast<const Vector<m_type> *>(p_ptr); \
- Vector<m_type_alt> ret; \
- int len = dvs->size(); \
- ret.resize(len); \
- { \
- const m_type *r = dvs->ptr(); \
- for (int i = 0; i < len; i++) { \
- ret.write[i] = r[i]; \
- } \
- } \
- return ret; \
- } \
- _FORCE_INLINE_ static void encode(Vector<m_type_alt> p_vec, void *p_ptr) { \
- Vector<m_type> *dv = reinterpret_cast<Vector<m_type> *>(p_ptr); \
- int len = p_vec.size(); \
- dv->resize(len); \
- { \
- m_type *w = dv->ptrw(); \
- for (int i = 0; i < len; i++) { \
- w[i] = p_vec[i]; \
- } \
- } \
- } \
- }; \
- template <> \
- struct PtrToArg<const Vector<m_type_alt> &> { \
- _FORCE_INLINE_ static Vector<m_type_alt> convert(const void *p_ptr) { \
- const Vector<m_type> *dvs = reinterpret_cast<const Vector<m_type> *>(p_ptr); \
- Vector<m_type_alt> ret; \
- int len = dvs->size(); \
- ret.resize(len); \
- { \
- const m_type *r = dvs->ptr(); \
- for (int i = 0; i < len; i++) { \
- ret.write[i] = r[i]; \
- } \
- } \
- return ret; \
- } \
+#define MAKE_VECARG_ALT(m_type, m_type_alt) \
+ template <> \
+ struct PtrToArg<Vector<m_type_alt>> { \
+ _FORCE_INLINE_ static Vector<m_type_alt> convert(const void *p_ptr) { \
+ const Vector<m_type> *dvs = reinterpret_cast<const Vector<m_type> *>(p_ptr); \
+ Vector<m_type_alt> ret; \
+ int len = dvs->size(); \
+ ret.resize(len); \
+ { \
+ const m_type *r = dvs->ptr(); \
+ for (int i = 0; i < len; i++) { \
+ ret.write[i] = r[i]; \
+ } \
+ } \
+ return ret; \
+ } \
+ _FORCE_INLINE_ static void encode(const Vector<m_type_alt> &p_vec, void *p_ptr) { \
+ Vector<m_type> *dv = reinterpret_cast<Vector<m_type> *>(p_ptr); \
+ int len = p_vec.size(); \
+ dv->resize(len); \
+ { \
+ m_type *w = dv->ptrw(); \
+ for (int i = 0; i < len; i++) { \
+ w[i] = p_vec[i]; \
+ } \
+ } \
+ } \
+ }; \
+ template <> \
+ struct PtrToArg<const Vector<m_type_alt> &> { \
+ _FORCE_INLINE_ static Vector<m_type_alt> convert(const void *p_ptr) { \
+ const Vector<m_type> *dvs = reinterpret_cast<const Vector<m_type> *>(p_ptr); \
+ Vector<m_type_alt> ret; \
+ int len = dvs->size(); \
+ ret.resize(len); \
+ { \
+ const m_type *r = dvs->ptr(); \
+ for (int i = 0; i < len; i++) { \
+ ret.write[i] = r[i]; \
+ } \
+ } \
+ return ret; \
+ } \
}
MAKE_VECARG_ALT(String, StringName);
@@ -296,40 +296,40 @@ MAKE_VECARG_ALT(String, StringName);
// For stuff that gets converted to Array vectors.
// No EncodeT because direct pointer conversion not possible.
-#define MAKE_VECARR(m_type) \
- template <> \
- struct PtrToArg<Vector<m_type>> { \
- _FORCE_INLINE_ static Vector<m_type> convert(const void *p_ptr) { \
- const Array *arr = reinterpret_cast<const Array *>(p_ptr); \
- Vector<m_type> ret; \
- int len = arr->size(); \
- ret.resize(len); \
- for (int i = 0; i < len; i++) { \
- ret.write[i] = (*arr)[i]; \
- } \
- return ret; \
- } \
- _FORCE_INLINE_ static void encode(Vector<m_type> p_vec, void *p_ptr) { \
- Array *arr = reinterpret_cast<Array *>(p_ptr); \
- int len = p_vec.size(); \
- arr->resize(len); \
- for (int i = 0; i < len; i++) { \
- (*arr)[i] = p_vec[i]; \
- } \
- } \
- }; \
- template <> \
- struct PtrToArg<const Vector<m_type> &> { \
- _FORCE_INLINE_ static Vector<m_type> convert(const void *p_ptr) { \
- const Array *arr = reinterpret_cast<const Array *>(p_ptr); \
- Vector<m_type> ret; \
- int len = arr->size(); \
- ret.resize(len); \
- for (int i = 0; i < len; i++) { \
- ret.write[i] = (*arr)[i]; \
- } \
- return ret; \
- } \
+#define MAKE_VECARR(m_type) \
+ template <> \
+ struct PtrToArg<Vector<m_type>> { \
+ _FORCE_INLINE_ static Vector<m_type> convert(const void *p_ptr) { \
+ const Array *arr = reinterpret_cast<const Array *>(p_ptr); \
+ Vector<m_type> ret; \
+ int len = arr->size(); \
+ ret.resize(len); \
+ for (int i = 0; i < len; i++) { \
+ ret.write[i] = (*arr)[i]; \
+ } \
+ return ret; \
+ } \
+ _FORCE_INLINE_ static void encode(const Vector<m_type> &p_vec, void *p_ptr) { \
+ Array *arr = reinterpret_cast<Array *>(p_ptr); \
+ int len = p_vec.size(); \
+ arr->resize(len); \
+ for (int i = 0; i < len; i++) { \
+ (*arr)[i] = p_vec[i]; \
+ } \
+ } \
+ }; \
+ template <> \
+ struct PtrToArg<const Vector<m_type> &> { \
+ _FORCE_INLINE_ static Vector<m_type> convert(const void *p_ptr) { \
+ const Array *arr = reinterpret_cast<const Array *>(p_ptr); \
+ Vector<m_type> ret; \
+ int len = arr->size(); \
+ ret.resize(len); \
+ for (int i = 0; i < len; i++) { \
+ ret.write[i] = (*arr)[i]; \
+ } \
+ return ret; \
+ } \
}
MAKE_VECARR(Variant);
@@ -337,49 +337,49 @@ MAKE_VECARR(RID);
MAKE_VECARR(Plane);
// No EncodeT because direct pointer conversion not possible.
-#define MAKE_DVECARR(m_type) \
- template <> \
- struct PtrToArg<Vector<m_type>> { \
- _FORCE_INLINE_ static Vector<m_type> convert(const void *p_ptr) { \
- const Array *arr = reinterpret_cast<const Array *>(p_ptr); \
- Vector<m_type> ret; \
- int len = arr->size(); \
- ret.resize(len); \
- { \
- m_type *w = ret.ptrw(); \
- for (int i = 0; i < len; i++) { \
- w[i] = (*arr)[i]; \
- } \
- } \
- return ret; \
- } \
- _FORCE_INLINE_ static void encode(Vector<m_type> p_vec, void *p_ptr) { \
- Array *arr = reinterpret_cast<Array *>(p_ptr); \
- int len = p_vec.size(); \
- arr->resize(len); \
- { \
- const m_type *r = p_vec.ptr(); \
- for (int i = 0; i < len; i++) { \
- (*arr)[i] = r[i]; \
- } \
- } \
- } \
- }; \
- template <> \
- struct PtrToArg<const Vector<m_type> &> { \
- _FORCE_INLINE_ static Vector<m_type> convert(const void *p_ptr) { \
- const Array *arr = reinterpret_cast<const Array *>(p_ptr); \
- Vector<m_type> ret; \
- int len = arr->size(); \
- ret.resize(len); \
- { \
- m_type *w = ret.ptrw(); \
- for (int i = 0; i < len; i++) { \
- w[i] = (*arr)[i]; \
- } \
- } \
- return ret; \
- } \
+#define MAKE_DVECARR(m_type) \
+ template <> \
+ struct PtrToArg<Vector<m_type>> { \
+ _FORCE_INLINE_ static Vector<m_type> convert(const void *p_ptr) { \
+ const Array *arr = reinterpret_cast<const Array *>(p_ptr); \
+ Vector<m_type> ret; \
+ int len = arr->size(); \
+ ret.resize(len); \
+ { \
+ m_type *w = ret.ptrw(); \
+ for (int i = 0; i < len; i++) { \
+ w[i] = (*arr)[i]; \
+ } \
+ } \
+ return ret; \
+ } \
+ _FORCE_INLINE_ static void encode(const Vector<m_type> &p_vec, void *p_ptr) { \
+ Array *arr = reinterpret_cast<Array *>(p_ptr); \
+ int len = p_vec.size(); \
+ arr->resize(len); \
+ { \
+ const m_type *r = p_vec.ptr(); \
+ for (int i = 0; i < len; i++) { \
+ (*arr)[i] = r[i]; \
+ } \
+ } \
+ } \
+ }; \
+ template <> \
+ struct PtrToArg<const Vector<m_type> &> { \
+ _FORCE_INLINE_ static Vector<m_type> convert(const void *p_ptr) { \
+ const Array *arr = reinterpret_cast<const Array *>(p_ptr); \
+ Vector<m_type> ret; \
+ int len = arr->size(); \
+ ret.resize(len); \
+ { \
+ m_type *w = ret.ptrw(); \
+ for (int i = 0; i < len; i++) { \
+ w[i] = (*arr)[i]; \
+ } \
+ } \
+ return ret; \
+ } \
}
// Special case for IPAddress.
@@ -427,7 +427,7 @@ struct PtrToArg<Vector<Face3>> {
}
return ret;
}
- _FORCE_INLINE_ static void encode(Vector<Face3> p_vec, void *p_ptr) {
+ _FORCE_INLINE_ static void encode(const Vector<Face3> &p_vec, void *p_ptr) {
Vector<Vector3> *arr = reinterpret_cast<Vector<Vector3> *>(p_ptr);
int len = p_vec.size();
arr->resize(len * 3);
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp
index 67f2c10099..ce5423fafc 100644
--- a/core/variant/variant.cpp
+++ b/core/variant/variant.cpp
@@ -1676,7 +1676,7 @@ Variant::operator String() const {
return stringify(0);
}
-String stringify_variant_clean(const Variant p_variant, int recursion_count) {
+String stringify_variant_clean(const Variant &p_variant, int recursion_count) {
String s = p_variant.stringify(recursion_count);
// Wrap strings in quotes to avoid ambiguity.
diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp
index cc48394b64..7136fa00c4 100644
--- a/core/variant/variant_utility.cpp
+++ b/core/variant/variant_utility.cpp
@@ -109,7 +109,7 @@ int64_t VariantUtilityFunctions::posmod(int64_t b, int64_t r) {
return Math::posmod(b, r);
}
-Variant VariantUtilityFunctions::floor(Variant x, Callable::CallError &r_error) {
+Variant VariantUtilityFunctions::floor(const Variant &x, Callable::CallError &r_error) {
r_error.error = Callable::CallError::CALL_OK;
switch (x.get_type()) {
case Variant::INT: {
@@ -153,7 +153,7 @@ int64_t VariantUtilityFunctions::floori(double x) {
return int64_t(Math::floor(x));
}
-Variant VariantUtilityFunctions::ceil(Variant x, Callable::CallError &r_error) {
+Variant VariantUtilityFunctions::ceil(const Variant &x, Callable::CallError &r_error) {
r_error.error = Callable::CallError::CALL_OK;
switch (x.get_type()) {
case Variant::INT: {
@@ -197,7 +197,7 @@ int64_t VariantUtilityFunctions::ceili(double x) {
return int64_t(Math::ceil(x));
}
-Variant VariantUtilityFunctions::round(Variant x, Callable::CallError &r_error) {
+Variant VariantUtilityFunctions::round(const Variant &x, Callable::CallError &r_error) {
r_error.error = Callable::CallError::CALL_OK;
switch (x.get_type()) {
case Variant::INT: {
diff --git a/core/variant/variant_utility.h b/core/variant/variant_utility.h
index a56c84a8e9..75cde4942b 100644
--- a/core/variant/variant_utility.h
+++ b/core/variant/variant_utility.h
@@ -52,13 +52,13 @@ struct VariantUtilityFunctions {
static double fmod(double b, double r);
static double fposmod(double b, double r);
static int64_t posmod(int64_t b, int64_t r);
- static Variant floor(Variant x, Callable::CallError &r_error);
+ static Variant floor(const Variant &x, Callable::CallError &r_error);
static double floorf(double x);
static int64_t floori(double x);
- static Variant ceil(Variant x, Callable::CallError &r_error);
+ static Variant ceil(const Variant &x, Callable::CallError &r_error);
static double ceilf(double x);
static int64_t ceili(double x);
- static Variant round(Variant x, Callable::CallError &r_error);
+ static Variant round(const Variant &x, Callable::CallError &r_error);
static double roundf(double x);
static int64_t roundi(double x);
static Variant abs(const Variant &x, Callable::CallError &r_error);
diff --git a/doc/class.xsd b/doc/class.xsd
index 330fd214c0..f0e1241053 100644
--- a/doc/class.xsd
+++ b/doc/class.xsd
@@ -99,8 +99,12 @@
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional" />
<xs:attribute type="xs:string" name="qualifiers" use="optional" />
+ <!-- deprecated -->
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
+ <!-- /deprecated -->
+ <xs:attribute type="xs:string" name="deprecated" use="optional" />
+ <xs:attribute type="xs:string" name="experimental" use="optional" />
<xs:attribute type="xs:string" name="keywords" use="optional" />
</xs:complexType>
</xs:element>
@@ -122,8 +126,12 @@
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
<xs:attribute type="xs:string" name="default" use="optional" />
+ <!-- deprecated -->
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
+ <!-- /deprecated -->
+ <xs:attribute type="xs:string" name="deprecated" use="optional" />
+ <xs:attribute type="xs:string" name="experimental" use="optional" />
<xs:attribute type="xs:string" name="keywords" use="optional" />
</xs:extension>
</xs:simpleContent>
@@ -152,8 +160,12 @@
<xs:element type="xs:string" name="description" />
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional" />
+ <!-- deprecated -->
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
+ <!-- /deprecated -->
+ <xs:attribute type="xs:string" name="deprecated" use="optional" />
+ <xs:attribute type="xs:string" name="experimental" use="optional" />
</xs:complexType>
</xs:element>
</xs:sequence>
@@ -170,8 +182,12 @@
<xs:attribute type="xs:string" name="value" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
+ <!-- deprecated -->
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
+ <!-- /deprecated -->
+ <xs:attribute type="xs:string" name="deprecated" use="optional" />
+ <xs:attribute type="xs:string" name="experimental" use="optional" />
<xs:attribute type="xs:string" name="keywords" use="optional" />
</xs:extension>
</xs:simpleContent>
@@ -279,8 +295,13 @@
</xs:sequence>
<xs:attribute type="xs:string" name="name" />
<xs:attribute type="xs:string" name="inherits" />
+ <!-- deprecated -->
+ <xs:attribute type="xs:float" name="version" use="optional" />
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
+ <!-- /deprecated -->
+ <xs:attribute type="xs:string" name="deprecated" use="optional" />
+ <xs:attribute type="xs:string" name="experimental" use="optional" />
<xs:attribute type="xs:string" name="keywords" use="optional" />
</xs:complexType>
</xs:element>
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 5736a97a73..4cf5a88dd7 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -2889,8 +2889,7 @@
[/codeblocks]
[b]Note:[/b] The trailing colon is required for properly detecting built-in types.
</constant>
- <constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint" is_deprecated="true">
- [i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future.
+ <constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint" deprecated="This hint is not used anywhere and will be removed in the future.">
</constant>
<constant name="PROPERTY_HINT_OBJECT_TOO_BIG" value="25" enum="PropertyHint">
Hints that an object is too big to be sent via the debugger.
@@ -2904,9 +2903,7 @@
<constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="28" enum="PropertyHint">
Hints that a [String] property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the entire filesystem. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. See also [member FileDialog.filters].
</constant>
- <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="29" enum="PropertyHint" is_deprecated="true">
- Hints that an [int] property is an object ID.
- [i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future.
+ <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="29" enum="PropertyHint" deprecated="This hint is not used anywhere and will be removed in the future.">
</constant>
<constant name="PROPERTY_HINT_INT_IS_POINTER" value="30" enum="PropertyHint">
Hints that an [int] property is a pointer. Used by GDExtension.
@@ -2977,9 +2974,7 @@
<constant name="PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" value="16384" enum="PropertyUsageFlags" is_bitfield="true">
If this property is modified, all inspector fields will be refreshed.
</constant>
- <constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="32768" enum="PropertyUsageFlags" is_bitfield="true" is_deprecated="true">
- Signifies a default value from a placeholder script instance.
- [i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future.
+ <constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="32768" enum="PropertyUsageFlags" is_bitfield="true" deprecated="This hint is not used anywhere and will be removed in the future.">
</constant>
<constant name="PROPERTY_USAGE_CLASS_IS_ENUM" value="65536" enum="PropertyUsageFlags" is_bitfield="true">
The property is an enum, i.e. it only takes named integer constants from its associated enumeration.
@@ -3008,9 +3003,7 @@
<constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="16777216" enum="PropertyUsageFlags" is_bitfield="true">
Inserting an animation key frame of this property will automatically increment the value, allowing to easily keyframe multiple values in a row.
</constant>
- <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags" is_bitfield="true" is_deprecated="true">
- When loading, the resource for this property can be set at the end of loading.
- [i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future.
+ <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags" is_bitfield="true" deprecated="This hint is not used anywhere and will be removed in the future.">
</constant>
<constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="67108864" enum="PropertyUsageFlags" is_bitfield="true">
When this property is a [Resource] and base object is a [Node], a resource instance will be automatically created whenever the node is created in the editor.
diff --git a/doc/classes/AStarGrid2D.xml b/doc/classes/AStarGrid2D.xml
index 7764233116..4501bec314 100644
--- a/doc/classes/AStarGrid2D.xml
+++ b/doc/classes/AStarGrid2D.xml
@@ -182,9 +182,8 @@
<member name="region" type="Rect2i" setter="set_region" getter="get_region" default="Rect2i(0, 0, 0, 0)">
The region of grid cells available for pathfinding. If changed, [method update] needs to be called before finding the next path.
</member>
- <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(0, 0)" is_deprecated="true">
+ <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(0, 0)" deprecated="Use [member region] instead.">
The size of the grid (number of cells of size [member cell_size] on each axis). If changed, [method update] needs to be called before finding the next path.
- [i]Deprecated.[/i] Use [member region] instead.
</member>
</members>
<constants>
diff --git a/doc/classes/AnimatedTexture.xml b/doc/classes/AnimatedTexture.xml
index a5cacff987..aad16f6f3a 100644
--- a/doc/classes/AnimatedTexture.xml
+++ b/doc/classes/AnimatedTexture.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="AnimatedTexture" inherits="Texture2D" is_deprecated="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="AnimatedTexture" inherits="Texture2D" deprecated="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Proxy texture for simple frame-based animations.
</brief_description>
@@ -9,7 +9,6 @@
[AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one.
[b]Note:[/b] AnimatedTexture doesn't support using [AtlasTexture]s. Each frame needs to be a separate [Texture2D].
[b]Warning:[/b] The current implementation is not efficient for the modern renderers.
- [i]Deprecated.[/i] This class is deprecated, and might be removed in a future release.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml
index 233d31a101..6236f96e63 100644
--- a/doc/classes/AnimationPlayer.xml
+++ b/doc/classes/AnimationPlayer.xml
@@ -44,10 +44,9 @@
Returns the blend time (in seconds) between two animations, referenced by their keys.
</description>
</method>
- <method name="get_method_call_mode" qualifiers="const" is_deprecated="true">
+ <method name="get_method_call_mode" qualifiers="const" deprecated="Use [member AnimationMixer.callback_mode_method] instead.">
<return type="int" enum="AnimationPlayer.AnimationMethodCallMode" />
<description>
- For backward compatibility. See [enum AnimationMixer.AnimationCallbackModeMethod].
</description>
</method>
<method name="get_playing_speed" qualifiers="const">
@@ -57,10 +56,9 @@
Returns a negative value if the current animation is playing backwards.
</description>
</method>
- <method name="get_process_callback" qualifiers="const" is_deprecated="true">
+ <method name="get_process_callback" qualifiers="const" deprecated="Use [member AnimationMixer.callback_mode_process] instead.">
<return type="int" enum="AnimationPlayer.AnimationProcessCallback" />
<description>
- For backward compatibility. See [enum AnimationMixer.AnimationCallbackModeProcess].
</description>
</method>
<method name="get_queue">
@@ -69,10 +67,9 @@
Returns a list of the animation keys that are currently queued to play.
</description>
</method>
- <method name="get_root" qualifiers="const" is_deprecated="true">
+ <method name="get_root" qualifiers="const" deprecated="Use [member AnimationMixer.root_node] instead.">
<return type="NodePath" />
<description>
- For backward compatibility. See [member AnimationMixer.root_node].
</description>
</method>
<method name="is_playing" qualifiers="const">
@@ -158,25 +155,22 @@
Specifies a blend time (in seconds) between two animations, referenced by their keys.
</description>
</method>
- <method name="set_method_call_mode" is_deprecated="true">
+ <method name="set_method_call_mode" deprecated="Use [member AnimationMixer.callback_mode_method] instead.">
<return type="void" />
<param index="0" name="mode" type="int" enum="AnimationPlayer.AnimationMethodCallMode" />
<description>
- For backward compatibility. See [enum AnimationMixer.AnimationCallbackModeMethod].
</description>
</method>
- <method name="set_process_callback" is_deprecated="true">
+ <method name="set_process_callback" deprecated="Use [member AnimationMixer.callback_mode_process] instead.">
<return type="void" />
<param index="0" name="mode" type="int" enum="AnimationPlayer.AnimationProcessCallback" />
<description>
- For backward compatibility. See [enum AnimationMixer.AnimationCallbackModeProcess].
</description>
</method>
- <method name="set_root" is_deprecated="true">
+ <method name="set_root" deprecated="Use [member AnimationMixer.root_node] instead.">
<return type="void" />
<param index="0" name="path" type="NodePath" />
<description>
- For backward compatibility. See [member AnimationMixer.root_node].
</description>
</method>
<method name="stop">
@@ -235,20 +229,15 @@
</signal>
</signals>
<constants>
- <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessCallback" is_deprecated="true">
- For backward compatibility. See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS].
+ <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessCallback" deprecated="See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS].">
</constant>
- <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessCallback" is_deprecated="true">
- For backward compatibility. See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE].
+ <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessCallback" deprecated="See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE].">
</constant>
- <constant name="ANIMATION_PROCESS_MANUAL" value="2" enum="AnimationProcessCallback" is_deprecated="true">
- For backward compatibility. See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL].
+ <constant name="ANIMATION_PROCESS_MANUAL" value="2" enum="AnimationProcessCallback" deprecated="See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL].">
</constant>
- <constant name="ANIMATION_METHOD_CALL_DEFERRED" value="0" enum="AnimationMethodCallMode" is_deprecated="true">
- For backward compatibility. See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_DEFERRED].
+ <constant name="ANIMATION_METHOD_CALL_DEFERRED" value="0" enum="AnimationMethodCallMode" deprecated="See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_DEFERRED].">
</constant>
- <constant name="ANIMATION_METHOD_CALL_IMMEDIATE" value="1" enum="AnimationMethodCallMode" is_deprecated="true">
- For backward compatibility. See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE].
+ <constant name="ANIMATION_METHOD_CALL_IMMEDIATE" value="1" enum="AnimationMethodCallMode" deprecated="See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE].">
</constant>
</constants>
</class>
diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml
index 79e84192df..3e0c088b8a 100644
--- a/doc/classes/AnimationTree.xml
+++ b/doc/classes/AnimationTree.xml
@@ -12,17 +12,15 @@
<link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
- <method name="get_process_callback" qualifiers="const" is_deprecated="true">
+ <method name="get_process_callback" qualifiers="const" deprecated="Use [member AnimationMixer.callback_mode_process] instead.">
<return type="int" enum="AnimationTree.AnimationProcessCallback" />
<description>
- For backward compatibility. See [enum AnimationMixer.AnimationCallbackModeProcess].
</description>
</method>
- <method name="set_process_callback" is_deprecated="true">
+ <method name="set_process_callback" deprecated="Use [member AnimationMixer.callback_mode_process] instead.">
<return type="void" />
<param index="0" name="mode" type="int" enum="AnimationTree.AnimationProcessCallback" />
<description>
- For backward compatibility. See [enum AnimationMixer.AnimationCallbackModeProcess].
</description>
</method>
</methods>
@@ -46,14 +44,11 @@
</signal>
</signals>
<constants>
- <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessCallback" is_deprecated="true">
- For backward compatibility. See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS].
+ <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessCallback" deprecated="See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS].">
</constant>
- <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessCallback" is_deprecated="true">
- For backward compatibility. See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE].
+ <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessCallback" deprecated="See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE].">
</constant>
- <constant name="ANIMATION_PROCESS_MANUAL" value="2" enum="AnimationProcessCallback" is_deprecated="true">
- For backward compatibility. See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL].
+ <constant name="ANIMATION_PROCESS_MANUAL" value="2" enum="AnimationProcessCallback" deprecated="See [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL].">
</constant>
</constants>
</class>
diff --git a/doc/classes/CollisionShape3D.xml b/doc/classes/CollisionShape3D.xml
index 4e32545f27..0dcfa75e5b 100644
--- a/doc/classes/CollisionShape3D.xml
+++ b/doc/classes/CollisionShape3D.xml
@@ -20,11 +20,11 @@
Sets the collision shape's shape to the addition of all its convexed [MeshInstance3D] siblings geometry.
</description>
</method>
- <method name="resource_changed" is_deprecated="true">
+ <method name="resource_changed" deprecated="Use [signal Resource.changed] instead.">
<return type="void" />
<param index="0" name="resource" type="Resource" />
<description>
- [i]Obsoleted.[/i] Use [signal Resource.changed] instead.
+ This method does nothing.
</description>
</method>
</methods>
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index a498bbeed3..c3ec2b9e3c 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -1159,12 +1159,12 @@
[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification.
See also [constant NOTIFICATION_MOUSE_EXIT_SELF].
</constant>
- <constant name="NOTIFICATION_MOUSE_ENTER_SELF" value="60" is_experimental="true">
+ <constant name="NOTIFICATION_MOUSE_ENTER_SELF" value="60" experimental="">
Sent when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification.
See also [constant NOTIFICATION_MOUSE_ENTER].
</constant>
- <constant name="NOTIFICATION_MOUSE_EXIT_SELF" value="61" is_experimental="true">
+ <constant name="NOTIFICATION_MOUSE_EXIT_SELF" value="61" experimental="">
Sent when the mouse cursor leaves the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification.
See also [constant NOTIFICATION_MOUSE_EXIT].
diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml
index 853348f64c..436f471e5d 100644
--- a/doc/classes/EditorExportPlugin.xml
+++ b/doc/classes/EditorExportPlugin.xml
@@ -178,6 +178,30 @@
- [code]update_visibility[/code]: An optional boolean value. If set to [code]true[/code], the preset will emit [signal Object.property_list_changed] when the option is changed.
</description>
</method>
+ <method name="_get_export_options_overrides" qualifiers="virtual const">
+ <return type="Dictionary" />
+ <param index="0" name="platform" type="EditorExportPlatform" />
+ <description>
+ Return a [Dictionary] of override values for export options, that will be used instead of user-provided values. Overridden options will be hidden from the user interface.
+ [codeblock]
+ class MyExportPlugin extends EditorExportPlugin:
+ func _get_name() -&gt; String:
+ return "MyExportPlugin"
+
+ func _supports_platform(platform) -&gt; bool:
+ if platform is EditorExportPlatformPC:
+ # Run on all desktop platforms including Windows, MacOS and Linux.
+ return true
+ return false
+
+ func _get_export_options_overrides(platform) -&gt; Dictionary:
+ # Override "Embed PCK" to always be enabled.
+ return {
+ "binary_format/embed_pck": true,
+ }
+ [/codeblock]
+ </description>
+ </method>
<method name="_get_name" qualifiers="virtual const">
<return type="String" />
<description>
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 956157e8cb..08bdd840bb 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -559,11 +559,10 @@
The callback should have 4 arguments: [Object] [code]undo_redo[/code], [Object] [code]modified_object[/code], [String] [code]property[/code] and [Variant] [code]new_value[/code]. They are, respectively, the [UndoRedo] object used by the inspector, the currently modified object, the name of the modified property and the new value the property is about to take.
</description>
</method>
- <method name="get_editor_interface" is_deprecated="true">
+ <method name="get_editor_interface" deprecated="[EditorInterface] is a global singleton and can be accessed directly by its name.">
<return type="EditorInterface" />
<description>
Returns the [EditorInterface] singleton instance.
- [i]Deprecated.[/i] [EditorInterface] is a global singleton and can be accessed directly by its name.
</description>
</method>
<method name="get_export_as_menu">
@@ -750,10 +749,9 @@
Emitted when user changes the workspace ([b]2D[/b], [b]3D[/b], [b]Script[/b], [b]AssetLib[/b]). Also works with custom screens defined by plugins.
</description>
</signal>
- <signal name="project_settings_changed" is_deprecated="true">
+ <signal name="project_settings_changed" deprecated="Use [signal ProjectSettings.settings_changed] instead.">
<description>
Emitted when any project setting has changed.
- [i]Deprecated.[/i] Use [signal ProjectSettings.settings_changed] instead.
</description>
</signal>
<signal name="resource_saved">
diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml
index 8033c18918..24480437fd 100644
--- a/doc/classes/EditorScript.xml
+++ b/doc/classes/EditorScript.xml
@@ -48,11 +48,10 @@
[b]Warning:[/b] The implementation of this method is currently disabled.
</description>
</method>
- <method name="get_editor_interface" qualifiers="const" is_deprecated="true">
+ <method name="get_editor_interface" qualifiers="const" deprecated="[EditorInterface] is a global singleton and can be accessed directly by its name.">
<return type="EditorInterface" />
<description>
Returns the [EditorInterface] singleton instance.
- [i]Deprecated.[/i] [EditorInterface] is a global singleton and can be accessed directly by its name.
</description>
</method>
<method name="get_scene" qualifiers="const">
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 709d26668c..a9ac47d8df 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="GraphEdit" inherits="Control" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="GraphEdit" inherits="Control" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
An editor for graph-like structures, using [GraphNode]s.
</brief_description>
diff --git a/doc/classes/GraphElement.xml b/doc/classes/GraphElement.xml
index dd2c7f3d3e..17c4184a20 100644
--- a/doc/classes/GraphElement.xml
+++ b/doc/classes/GraphElement.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="GraphElement" inherits="Container" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="GraphElement" inherits="Container" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A container that represents a basic element that can be placed inside a [GraphEdit] control.
</brief_description>
diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml
index 5bb3a25158..ad1028d7f4 100644
--- a/doc/classes/GraphNode.xml
+++ b/doc/classes/GraphNode.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="GraphNode" inherits="GraphElement" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="GraphNode" inherits="GraphElement" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A container with connection ports, representing a node in a [GraphEdit].
</brief_description>
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index f0385a7814..4befe2f8ec 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -322,11 +322,11 @@
<constant name="RESPONSE_NOT_MODIFIED" value="304" enum="ResponseCode">
HTTP status code [code]304 Not Modified[/code]. A conditional GET or HEAD request has been received and would have resulted in a 200 OK response if it were not for the fact that the condition evaluated to [code]false[/code].
</constant>
- <constant name="RESPONSE_USE_PROXY" value="305" enum="ResponseCode" is_deprecated="true">
- [i]Deprecated.[/i] HTTP status code [code]305 Use Proxy[/code].
+ <constant name="RESPONSE_USE_PROXY" value="305" enum="ResponseCode" deprecated="">
+ HTTP status code [code]305 Use Proxy[/code].
</constant>
- <constant name="RESPONSE_SWITCH_PROXY" value="306" enum="ResponseCode" is_deprecated="true">
- [i]Deprecated.[/i] HTTP status code [code]306 Switch Proxy[/code].
+ <constant name="RESPONSE_SWITCH_PROXY" value="306" enum="ResponseCode" deprecated="">
+ HTTP status code [code]306 Switch Proxy[/code].
</constant>
<constant name="RESPONSE_TEMPORARY_REDIRECT" value="307" enum="ResponseCode">
HTTP status code [code]307 Temporary Redirect[/code]. The target resource resides temporarily under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI.
diff --git a/doc/classes/InputEventJoypadButton.xml b/doc/classes/InputEventJoypadButton.xml
index 2516ef67dd..a545eaf811 100644
--- a/doc/classes/InputEventJoypadButton.xml
+++ b/doc/classes/InputEventJoypadButton.xml
@@ -16,9 +16,7 @@
<member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
If [code]true[/code], the button's state is pressed. If [code]false[/code], the button's state is released.
</member>
- <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" default="0.0" is_deprecated="true">
- Represents the pressure the user puts on a pressure-sensitive button.
- [i]Deprecated.[/i] This property is never set by the engine and is always [code]0[/code].
+ <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" default="0.0" deprecated="This property is never set by the engine and is always [code]0[/code].">
</member>
</members>
</class>
diff --git a/doc/classes/LightmapGIData.xml b/doc/classes/LightmapGIData.xml
index db6c9e70ca..b1ba6c5d84 100644
--- a/doc/classes/LightmapGIData.xml
+++ b/doc/classes/LightmapGIData.xml
@@ -54,9 +54,8 @@
</method>
</methods>
<members>
- <member name="light_texture" type="TextureLayered" setter="set_light_texture" getter="get_light_texture" is_deprecated="true">
+ <member name="light_texture" type="TextureLayered" setter="set_light_texture" getter="get_light_texture" deprecated="The lightmap atlas can now have multiple textures. See [member lightmap_textures].">
The lightmap atlas texture generated by the lightmapper.
- [i]Deprecated.[/i] The lightmap atlas can now have multiple textures. See [member lightmap_textures].
</member>
<member name="lightmap_textures" type="TextureLayered[]" setter="set_lightmap_textures" getter="get_lightmap_textures" default="[]">
The lightmap atlas textures generated by the lightmapper.
diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml
index f83dadfb15..5539213619 100644
--- a/doc/classes/MultiMesh.xml
+++ b/doc/classes/MultiMesh.xml
@@ -90,11 +90,9 @@
<members>
<member name="buffer" type="PackedFloat32Array" setter="set_buffer" getter="get_buffer" default="PackedFloat32Array()">
</member>
- <member name="color_array" type="PackedColorArray" setter="_set_color_array" getter="_get_color_array" is_deprecated="true">
- See [method set_instance_color].
+ <member name="color_array" type="PackedColorArray" setter="_set_color_array" getter="_get_color_array" deprecated="Use [method set_instance_color] instead.">
</member>
- <member name="custom_data_array" type="PackedColorArray" setter="_set_custom_data_array" getter="_get_custom_data_array" is_deprecated="true">
- See [method set_instance_custom_data].
+ <member name="custom_data_array" type="PackedColorArray" setter="_set_custom_data_array" getter="_get_custom_data_array" deprecated="Use [method set_instance_custom_data] instead.">
</member>
<member name="instance_count" type="int" setter="set_instance_count" getter="get_instance_count" default="0">
Number of instances that will get drawn. This clears and (re)sizes the buffers. Setting data format or flags afterwards will have no effect.
@@ -104,11 +102,9 @@
[Mesh] resource to be instanced.
The looks of the individual instances can be modified using [method set_instance_color] and [method set_instance_custom_data].
</member>
- <member name="transform_2d_array" type="PackedVector2Array" setter="_set_transform_2d_array" getter="_get_transform_2d_array" is_deprecated="true">
- See [method set_instance_transform_2d].
+ <member name="transform_2d_array" type="PackedVector2Array" setter="_set_transform_2d_array" getter="_get_transform_2d_array" deprecated="Use [method set_instance_transform_2d] instead.">
</member>
- <member name="transform_array" type="PackedVector3Array" setter="_set_transform_array" getter="_get_transform_array" is_deprecated="true">
- See [method set_instance_transform].
+ <member name="transform_array" type="PackedVector3Array" setter="_set_transform_array" getter="_get_transform_array" deprecated="Use [method set_instance_transform] instead.">
</member>
<member name="transform_format" type="int" setter="set_transform_format" getter="get_transform_format" enum="MultiMesh.TransformFormat" default="0">
Format of transform used to transform mesh, either 2D or 3D.
diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml
index fc7faf9260..132ece53b0 100644
--- a/doc/classes/NavigationAgent2D.xml
+++ b/doc/classes/NavigationAgent2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationAgent2D" inherits="Node" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationAgent2D" inherits="Node" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A 2D agent used to pathfind to a position while avoiding obstacles.
</brief_description>
diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml
index cbcf50bb29..37f92ab42a 100644
--- a/doc/classes/NavigationAgent3D.xml
+++ b/doc/classes/NavigationAgent3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationAgent3D" inherits="Node" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationAgent3D" inherits="Node" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A 3D agent used to pathfind to a position while avoiding obstacles.
</brief_description>
diff --git a/doc/classes/NavigationLink2D.xml b/doc/classes/NavigationLink2D.xml
index 75b691aaf4..0892c9ec44 100644
--- a/doc/classes/NavigationLink2D.xml
+++ b/doc/classes/NavigationLink2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationLink2D" inherits="Node2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationLink2D" inherits="Node2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A link between two positions on [NavigationRegion2D]s that agents can be routed through.
</brief_description>
diff --git a/doc/classes/NavigationLink3D.xml b/doc/classes/NavigationLink3D.xml
index 711c637dc5..0fcc106beb 100644
--- a/doc/classes/NavigationLink3D.xml
+++ b/doc/classes/NavigationLink3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationLink3D" inherits="Node3D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationLink3D" inherits="Node3D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A link between two positions on [NavigationRegion3D]s that agents can be routed through.
</brief_description>
diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml
index 8b2265baad..42ef354bc8 100644
--- a/doc/classes/NavigationMesh.xml
+++ b/doc/classes/NavigationMesh.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationMesh" inherits="Resource" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationMesh" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A navigation mesh that defines traversable areas and obstacles.
</brief_description>
diff --git a/doc/classes/NavigationMeshGenerator.xml b/doc/classes/NavigationMeshGenerator.xml
index 0997354aff..35c9e13e58 100644
--- a/doc/classes/NavigationMeshGenerator.xml
+++ b/doc/classes/NavigationMeshGenerator.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationMeshGenerator" inherits="Object" is_deprecated="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationMeshGenerator" inherits="Object" deprecated="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Helper class for creating and clearing navigation meshes.
</brief_description>
@@ -14,7 +14,7 @@
<link title="Using NavigationMeshes">$DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html</link>
</tutorials>
<methods>
- <method name="bake" is_deprecated="true">
+ <method name="bake" deprecated="">
<return type="void" />
<param index="0" name="navigation_mesh" type="NavigationMesh" />
<param index="1" name="root_node" type="Node" />
diff --git a/doc/classes/NavigationMeshSourceGeometryData2D.xml b/doc/classes/NavigationMeshSourceGeometryData2D.xml
index 4bf5213da7..3f6fcc733a 100644
--- a/doc/classes/NavigationMeshSourceGeometryData2D.xml
+++ b/doc/classes/NavigationMeshSourceGeometryData2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationMeshSourceGeometryData2D" inherits="Resource" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationMeshSourceGeometryData2D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Container for parsed source geometry data used in navigation mesh baking.
</brief_description>
diff --git a/doc/classes/NavigationMeshSourceGeometryData3D.xml b/doc/classes/NavigationMeshSourceGeometryData3D.xml
index dad3623416..ffa8163eaa 100644
--- a/doc/classes/NavigationMeshSourceGeometryData3D.xml
+++ b/doc/classes/NavigationMeshSourceGeometryData3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationMeshSourceGeometryData3D" inherits="Resource" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationMeshSourceGeometryData3D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Container for parsed source geometry data used in navigation mesh baking.
</brief_description>
diff --git a/doc/classes/NavigationObstacle2D.xml b/doc/classes/NavigationObstacle2D.xml
index 1eb18984a6..19b515c7cb 100644
--- a/doc/classes/NavigationObstacle2D.xml
+++ b/doc/classes/NavigationObstacle2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationObstacle2D" inherits="Node2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationObstacle2D" inherits="Node2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
2D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an area.
</brief_description>
diff --git a/doc/classes/NavigationObstacle3D.xml b/doc/classes/NavigationObstacle3D.xml
index 141442eaf0..998279b3c4 100644
--- a/doc/classes/NavigationObstacle3D.xml
+++ b/doc/classes/NavigationObstacle3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationObstacle3D" inherits="Node3D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationObstacle3D" inherits="Node3D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
3D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an area.
</brief_description>
diff --git a/doc/classes/NavigationPathQueryParameters2D.xml b/doc/classes/NavigationPathQueryParameters2D.xml
index 74cf4bdb75..7d9ecf61b0 100644
--- a/doc/classes/NavigationPathQueryParameters2D.xml
+++ b/doc/classes/NavigationPathQueryParameters2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationPathQueryParameters2D" inherits="RefCounted" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationPathQueryParameters2D" inherits="RefCounted" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Provides parameters for 2D navigation path queries.
</brief_description>
diff --git a/doc/classes/NavigationPathQueryParameters3D.xml b/doc/classes/NavigationPathQueryParameters3D.xml
index 2a366c0498..862f8a8347 100644
--- a/doc/classes/NavigationPathQueryParameters3D.xml
+++ b/doc/classes/NavigationPathQueryParameters3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationPathQueryParameters3D" inherits="RefCounted" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationPathQueryParameters3D" inherits="RefCounted" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Provides parameters for 3D navigation path queries.
</brief_description>
diff --git a/doc/classes/NavigationPathQueryResult2D.xml b/doc/classes/NavigationPathQueryResult2D.xml
index e02133cfba..e1ef2ee7de 100644
--- a/doc/classes/NavigationPathQueryResult2D.xml
+++ b/doc/classes/NavigationPathQueryResult2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationPathQueryResult2D" inherits="RefCounted" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationPathQueryResult2D" inherits="RefCounted" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Represents the result of a 2D pathfinding query.
</brief_description>
diff --git a/doc/classes/NavigationPathQueryResult3D.xml b/doc/classes/NavigationPathQueryResult3D.xml
index 9631c6a644..1cda3e64d5 100644
--- a/doc/classes/NavigationPathQueryResult3D.xml
+++ b/doc/classes/NavigationPathQueryResult3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationPathQueryResult3D" inherits="RefCounted" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationPathQueryResult3D" inherits="RefCounted" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Represents the result of a 3D pathfinding query.
</brief_description>
diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml
index 54c5c80b78..9c4e8169b0 100644
--- a/doc/classes/NavigationPolygon.xml
+++ b/doc/classes/NavigationPolygon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationPolygon" inherits="Resource" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationPolygon" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A 2D navigation mesh that describes a traversable surface for pathfinding.
</brief_description>
@@ -132,11 +132,10 @@
Returns a [PackedVector2Array] containing all the vertices being used to create the polygons.
</description>
</method>
- <method name="make_polygons_from_outlines" is_deprecated="true">
+ <method name="make_polygons_from_outlines" deprecated="Use [method NavigationServer2D.parse_source_geometry_data] and [method NavigationServer2D.bake_from_source_geometry_data] instead.">
<return type="void" />
<description>
Creates polygons from the outlines added in the editor or by script.
- [i]Deprecated.[/i] This function is deprecated, and might be removed in a future release. Use [method NavigationServer2D.parse_source_geometry_data] and [method NavigationServer2D.bake_from_source_geometry_data] instead.
</description>
</method>
<method name="remove_outline">
diff --git a/doc/classes/NavigationRegion2D.xml b/doc/classes/NavigationRegion2D.xml
index 4ad552e97e..8ce1551715 100644
--- a/doc/classes/NavigationRegion2D.xml
+++ b/doc/classes/NavigationRegion2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationRegion2D" inherits="Node2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationRegion2D" inherits="Node2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A traversable 2D region that [NavigationAgent2D]s can use for pathfinding.
</brief_description>
@@ -43,11 +43,10 @@
Returns the current navigation map [RID] used by this region.
</description>
</method>
- <method name="get_region_rid" qualifiers="const" is_deprecated="true">
+ <method name="get_region_rid" qualifiers="const" deprecated="Use [method get_rid] instead.">
<return type="RID" />
<description>
Returns the [RID] of this region on the [NavigationServer2D].
- [i]Deprecated.[/i] Use [method get_rid] instead.
</description>
</method>
<method name="get_rid" qualifiers="const">
diff --git a/doc/classes/NavigationRegion3D.xml b/doc/classes/NavigationRegion3D.xml
index 2a84270d7d..ad31fd0632 100644
--- a/doc/classes/NavigationRegion3D.xml
+++ b/doc/classes/NavigationRegion3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationRegion3D" inherits="Node3D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationRegion3D" inherits="Node3D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A traversable 3D region that [NavigationAgent3D]s can use for pathfinding.
</brief_description>
@@ -36,11 +36,10 @@
Returns the current navigation map [RID] used by this region.
</description>
</method>
- <method name="get_region_rid" qualifiers="const" is_deprecated="true">
+ <method name="get_region_rid" qualifiers="const" deprecated="Use [method get_rid] instead.">
<return type="RID" />
<description>
Returns the [RID] of this region on the [NavigationServer3D].
- [i]Deprecated.[/i] Use [method get_rid] instead.
</description>
</method>
<method name="get_rid" qualifiers="const">
diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml
index 2fe60a1118..39f0718a71 100644
--- a/doc/classes/NavigationServer2D.xml
+++ b/doc/classes/NavigationServer2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationServer2D" inherits="Object" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationServer2D" inherits="Object" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A server interface for low-level 2D navigation access.
</brief_description>
diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml
index caadb844f1..95a803b6e5 100644
--- a/doc/classes/NavigationServer3D.xml
+++ b/doc/classes/NavigationServer3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationServer3D" inherits="Object" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="NavigationServer3D" inherits="Object" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A server interface for low-level 3D navigation access.
</brief_description>
@@ -886,13 +886,13 @@
Queries a path in a given navigation map. Start and target position and other parameters are defined through [NavigationPathQueryParameters3D]. Updates the provided [NavigationPathQueryResult3D] result object with the path among other results requested by the query.
</description>
</method>
- <method name="region_bake_navigation_mesh" is_deprecated="true">
+ <method name="region_bake_navigation_mesh" deprecated="This method is deprecated due to core threading changes.">
<return type="void" />
<param index="0" name="navigation_mesh" type="NavigationMesh" />
<param index="1" name="root_node" type="Node" />
<description>
Bakes the [param navigation_mesh] with bake source geometry collected starting from the [param root_node].
- [i]Deprecated.[/i] This function is deprecated due to core threading changes. To upgrade existing code, first create a [NavigationMeshSourceGeometryData3D] resource. Use this resource with [method parse_source_geometry_data] to parse the SceneTree for nodes that should contribute to the navigation mesh baking. The SceneTree parsing needs to happen on the main thread. After the parsing is finished use the resource with [method bake_from_source_geometry_data] to bake a navigation mesh.
+ [i]Deprecated.[/i] To upgrade existing code, first create a [NavigationMeshSourceGeometryData3D] resource. Use this resource with [method parse_source_geometry_data] to parse the SceneTree for nodes that should contribute to the navigation mesh baking. The SceneTree parsing needs to happen on the main thread. After the parsing is finished use the resource with [method bake_from_source_geometry_data] to bake a navigation mesh.
</description>
</method>
<method name="region_create">
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 02126bf8fe..ada4bd04e6 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -1038,8 +1038,8 @@
Notification received when the node is about to exit a [SceneTree]. See [method _exit_tree].
This notification is received [i]after[/i] the related [signal tree_exiting] signal.
</constant>
- <constant name="NOTIFICATION_MOVED_IN_PARENT" value="12" is_deprecated="true">
- [i]Deprecated.[/i] This notification is no longer emitted. Use [constant NOTIFICATION_CHILD_ORDER_CHANGED] instead.
+ <constant name="NOTIFICATION_MOVED_IN_PARENT" value="12" deprecated="Use [constant NOTIFICATION_CHILD_ORDER_CHANGED] instead.">
+ This notification is no longer emitted.
</constant>
<constant name="NOTIFICATION_READY" value="13">
Notification received when the node is ready. See [method _ready].
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index f69faff2bd..f8e91c94a0 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -353,6 +353,9 @@
This setting can be overridden using the [code]--max-fps &lt;fps&gt;[/code] command line argument (including with a value of [code]0[/code] for unlimited framerate).
[b]Note:[/b] This property is only read when the project starts. To change the rendering FPS cap at runtime, set [member Engine.max_fps] instead.
</member>
+ <member name="application/run/print_header" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], the engine header is printed in the console on startup. This header describes the current version of the engine, as well as the renderer being used. This behavior can also be disabled on the command line with the [code]--no-header[/code] option.
+ </member>
<member name="audio/buses/channel_disable_threshold_db" type="float" setter="" getter="" default="-60.0">
Audio buses will disable automatically when sound goes below a given dB threshold for a given time. This saves CPU as effects assigned to that bus will no longer do any processing.
</member>
diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml
index 21b34db69d..8969d66b35 100644
--- a/doc/classes/RenderingDevice.xml
+++ b/doc/classes/RenderingDevice.xml
@@ -14,12 +14,11 @@
<link title="Using compute shaders">$DOCS_URL/tutorials/shaders/compute_shaders.html</link>
</tutorials>
<methods>
- <method name="barrier" is_deprecated="true">
+ <method name="barrier" deprecated="Barriers are automatically inserted by RenderingDevice.">
<return type="void" />
<param index="0" name="from" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="32767" />
<param index="1" name="to" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="32767" />
<description>
- [i]Deprecated.[/i] Barriers are automatically inserted by RenderingDevice.
</description>
</method>
<method name="buffer_clear">
@@ -190,12 +189,11 @@
Ends the command buffer debug label region started by a [method draw_command_begin_label] call.
</description>
</method>
- <method name="draw_command_insert_label" is_deprecated="true">
+ <method name="draw_command_insert_label" deprecated="Inserting labels no longer applies due to command reordering.">
<return type="void" />
<param index="0" name="name" type="String" />
<param index="1" name="color" type="Color" />
<description>
- [i]Deprecated.[/i] Inserting labels no longer applies due to command reordering.
</description>
</method>
<method name="draw_list_begin">
@@ -242,7 +240,7 @@
[b]Note:[/b] Cannot be used with local RenderingDevices, as these don't have a screen. If called on a local RenderingDevice, [method draw_list_begin_for_screen] returns [constant INVALID_ID].
</description>
</method>
- <method name="draw_list_begin_split" is_deprecated="true">
+ <method name="draw_list_begin_split" deprecated="Split draw lists are used automatically by RenderingDevice.">
<return type="PackedInt64Array" />
<param index="0" name="framebuffer" type="RID" />
<param index="1" name="splits" type="int" />
@@ -256,7 +254,6 @@
<param index="9" name="region" type="Rect2" default="Rect2(0, 0, 0, 0)" />
<param index="10" name="storage_textures" type="RID[]" default="[]" />
<description>
- [i]Deprecated.[/i] Split draw lists are used automatically by RenderingDevice.
</description>
</method>
<method name="draw_list_bind_index_array">
@@ -347,11 +344,10 @@
Switches to the next draw pass.
</description>
</method>
- <method name="draw_list_switch_to_next_pass_split" is_deprecated="true">
+ <method name="draw_list_switch_to_next_pass_split" deprecated="Split draw lists are used automatically by RenderingDevice.">
<return type="PackedInt64Array" />
<param index="0" name="splits" type="int" />
<description>
- [i]Deprecated.[/i] Split draw lists are used automatically by RenderingDevice.
</description>
</method>
<method name="framebuffer_create">
@@ -439,10 +435,9 @@
Tries to free an object in the RenderingDevice. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RenderingDevice directly.
</description>
</method>
- <method name="full_barrier" is_deprecated="true">
+ <method name="full_barrier" deprecated="Barriers are automatically inserted by RenderingDevice.">
<return type="void" />
<description>
- [i]Deprecated.[/i] Barriers are automatically inserted by RenderingDevice.
</description>
</method>
<method name="get_captured_timestamp_cpu_time" qualifiers="const">
@@ -804,13 +799,12 @@
Returns the data format used to create this texture.
</description>
</method>
- <method name="texture_get_native_handle" is_deprecated="true">
+ <method name="texture_get_native_handle" deprecated="Use [method get_driver_resource] with [constant DRIVER_RESOURCE_TEXTURE] instead.">
<return type="int" />
<param index="0" name="texture" type="RID" />
<description>
Returns the internal graphics handle for this texture object. For use when communicating with third-party APIs mostly with GDExtension.
[b]Note:[/b] This function returns a [code]uint64_t[/code] which internally maps to a [code]GLuint[/code] (OpenGL) or [code]VkImage[/code] (Vulkan).
- [i]Deprecated.[/i] Use [method get_driver_resource] with [constant DRIVER_RESOURCE_TEXTURE] instead.
</description>
</method>
<method name="texture_is_format_supported_for_usage" qualifiers="const">
@@ -982,44 +976,31 @@
<constant name="DRIVER_RESOURCE_RENDER_PIPELINE" value="12" enum="DriverResource">
- Vulkan: [code]VkPipeline[/code].
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_DEVICE" value="0" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_LOGICAL_DEVICE].
+ <constant name="DRIVER_RESOURCE_VULKAN_DEVICE" value="0" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_LOGICAL_DEVICE] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE" value="1" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_PHYSICAL_DEVICE].
+ <constant name="DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE" value="1" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_PHYSICAL_DEVICE] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_INSTANCE" value="2" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_TOPMOST_OBJECT].
+ <constant name="DRIVER_RESOURCE_VULKAN_INSTANCE" value="2" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_TOPMOST_OBJECT] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_QUEUE" value="3" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_COMMAND_QUEUE].
+ <constant name="DRIVER_RESOURCE_VULKAN_QUEUE" value="3" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_COMMAND_QUEUE] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_QUEUE_FAMILY_INDEX" value="4" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_QUEUE_FAMILY].
+ <constant name="DRIVER_RESOURCE_VULKAN_QUEUE_FAMILY_INDEX" value="4" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_QUEUE_FAMILY] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_IMAGE" value="5" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_TEXTURE].
+ <constant name="DRIVER_RESOURCE_VULKAN_IMAGE" value="5" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_TEXTURE] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_IMAGE_VIEW" value="6" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_TEXTURE_VIEW].
+ <constant name="DRIVER_RESOURCE_VULKAN_IMAGE_VIEW" value="6" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_TEXTURE_VIEW] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_IMAGE_NATIVE_TEXTURE_FORMAT" value="7" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_TEXTURE_DATA_FORMAT].
+ <constant name="DRIVER_RESOURCE_VULKAN_IMAGE_NATIVE_TEXTURE_FORMAT" value="7" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_TEXTURE_DATA_FORMAT] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_SAMPLER" value="8" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_SAMPLER].
+ <constant name="DRIVER_RESOURCE_VULKAN_SAMPLER" value="8" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_SAMPLER] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_DESCRIPTOR_SET" value="9" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_UNIFORM_SET].
+ <constant name="DRIVER_RESOURCE_VULKAN_DESCRIPTOR_SET" value="9" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_UNIFORM_SET] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_BUFFER" value="10" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_BUFFER].
+ <constant name="DRIVER_RESOURCE_VULKAN_BUFFER" value="10" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_BUFFER] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_COMPUTE_PIPELINE" value="11" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_COMPUTE_PIPELINE].
+ <constant name="DRIVER_RESOURCE_VULKAN_COMPUTE_PIPELINE" value="11" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_COMPUTE_PIPELINE] instead.">
</constant>
- <constant name="DRIVER_RESOURCE_VULKAN_RENDER_PIPELINE" value="12" enum="DriverResource" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant DRIVER_RESOURCE_RENDER_PIPELINE].
+ <constant name="DRIVER_RESOURCE_VULKAN_RENDER_PIPELINE" value="12" enum="DriverResource" deprecated="Use [constant DRIVER_RESOURCE_RENDER_PIPELINE] instead.">
</constant>
<constant name="DATA_FORMAT_R4G4_UNORM_PACK8" value="0" enum="DataFormat">
4-bit-per-channel red/green channel data format, packed into 8 bits. Values are in the [code][0.0, 1.0][/code] range.
@@ -2168,20 +2149,15 @@
<constant name="INITIAL_ACTION_MAX" value="3" enum="InitialAction">
Represents the size of the [enum InitialAction] enum.
</constant>
- <constant name="INITIAL_ACTION_CLEAR_REGION" value="1" enum="InitialAction" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant INITIAL_ACTION_CLEAR] instead.
+ <constant name="INITIAL_ACTION_CLEAR_REGION" value="1" enum="InitialAction" deprecated="Use [constant INITIAL_ACTION_CLEAR] instead.">
</constant>
- <constant name="INITIAL_ACTION_CLEAR_REGION_CONTINUE" value="1" enum="InitialAction" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant INITIAL_ACTION_LOAD] instead.
+ <constant name="INITIAL_ACTION_CLEAR_REGION_CONTINUE" value="1" enum="InitialAction" deprecated="Use [constant INITIAL_ACTION_LOAD] instead.">
</constant>
- <constant name="INITIAL_ACTION_KEEP" value="0" enum="InitialAction" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant INITIAL_ACTION_LOAD] instead.
+ <constant name="INITIAL_ACTION_KEEP" value="0" enum="InitialAction" deprecated="Use [constant INITIAL_ACTION_LOAD] instead.">
</constant>
- <constant name="INITIAL_ACTION_DROP" value="2" enum="InitialAction" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant INITIAL_ACTION_DISCARD] instead.
+ <constant name="INITIAL_ACTION_DROP" value="2" enum="InitialAction" deprecated="Use [constant INITIAL_ACTION_DISCARD] instead.">
</constant>
- <constant name="INITIAL_ACTION_CONTINUE" value="0" enum="InitialAction" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant INITIAL_ACTION_LOAD] instead.
+ <constant name="INITIAL_ACTION_CONTINUE" value="0" enum="InitialAction" deprecated="Use [constant INITIAL_ACTION_LOAD] instead.">
</constant>
<constant name="FINAL_ACTION_STORE" value="0" enum="FinalAction">
Store the result of the draw list in the framebuffer. This is generally what you want to do.
@@ -2192,11 +2168,9 @@
<constant name="FINAL_ACTION_MAX" value="2" enum="FinalAction">
Represents the size of the [enum FinalAction] enum.
</constant>
- <constant name="FINAL_ACTION_READ" value="0" enum="FinalAction" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant FINAL_ACTION_STORE] instead.
+ <constant name="FINAL_ACTION_READ" value="0" enum="FinalAction" deprecated="Use [constant FINAL_ACTION_STORE] instead.">
</constant>
- <constant name="FINAL_ACTION_CONTINUE" value="0" enum="FinalAction" is_deprecated="true">
- [i]Deprecated.[/i] Use [constant FINAL_ACTION_STORE] instead.
+ <constant name="FINAL_ACTION_CONTINUE" value="0" enum="FinalAction" deprecated="Use [constant FINAL_ACTION_STORE] instead.">
</constant>
<constant name="SHADER_STAGE_VERTEX" value="0" enum="ShaderStage">
Vertex shader stage. This can be used to manipulate vertices from a shader (but not create new vertices).
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 4ab511b5a9..4597e50f37 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -1556,11 +1556,11 @@
Returns [code]true[/code] if changes have been made to the RenderingServer's data. [method force_draw] is usually called if this happens.
</description>
</method>
- <method name="has_feature" qualifiers="const" is_deprecated="true">
+ <method name="has_feature" qualifiers="const" deprecated="This method has not been used since Godot 3.0.">
<return type="bool" />
<param index="0" name="feature" type="int" enum="RenderingServer.Features" />
<description>
- [i]Deprecated.[/i] This method has not been used since Godot 3.0. Always returns false.
+ Always returns false.
</description>
</method>
<method name="has_os_feature" qualifiers="const">
@@ -3371,19 +3371,19 @@
Returns a texture [RID] that can be used with [RenderingDevice].
</description>
</method>
- <method name="texture_proxy_create" is_deprecated="true">
+ <method name="texture_proxy_create" deprecated="ProxyTexture was removed in Godot 4.">
<return type="RID" />
<param index="0" name="base" type="RID" />
<description>
- [i]Deprecated.[/i] ProxyTexture was removed in Godot 4, so this method does nothing when called and always returns a null [RID].
+ This method does nothing when called and always returns a null [RID].
</description>
</method>
- <method name="texture_proxy_update" is_deprecated="true">
+ <method name="texture_proxy_update" deprecated="ProxyTexture was removed in Godot 4.">
<return type="void" />
<param index="0" name="texture" type="RID" />
<param index="1" name="proxy_to" type="RID" />
<description>
- [i]Deprecated.[/i] ProxyTexture was removed in Godot 4, so this method cannot be used anymore.
+ This method should not be used.
</description>
</method>
<method name="texture_rd_create">
@@ -4044,8 +4044,8 @@
<constant name="MAX_GLOW_LEVELS" value="7">
The maximum number of glow levels that can be used with the glow post-processing effect.
</constant>
- <constant name="MAX_CURSORS" value="8" is_deprecated="true">
- [i]Deprecated.[/i] This constant is unused internally.
+ <constant name="MAX_CURSORS" value="8" deprecated="">
+ This constant is unused internally.
</constant>
<constant name="MAX_2D_DIRECTIONAL_LIGHTS" value="8">
The maximum number of directional lights that can be rendered at a given time in 2D.
@@ -5340,11 +5340,9 @@
<constant name="RENDERING_INFO_VIDEO_MEM_USED" value="5" enum="RenderingInfo">
Video memory used (in bytes). When using the Forward+ or mobile rendering backends, this is always greater than the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED], since there is miscellaneous data not accounted for by those two metrics. When using the GL Compatibility backend, this is equal to the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED].
</constant>
- <constant name="FEATURE_SHADERS" value="0" enum="Features" is_deprecated="true">
- [i]Deprecated.[/i] This constant has not been used since Godot 3.0.
+ <constant name="FEATURE_SHADERS" value="0" enum="Features" deprecated="This constant has not been used since Godot 3.0.">
</constant>
- <constant name="FEATURE_MULTITHREADED" value="1" enum="Features" is_deprecated="true">
- [i]Deprecated.[/i] This constant has not been used since Godot 3.0.
+ <constant name="FEATURE_MULTITHREADED" value="1" enum="Features" deprecated="This constant has not been used since Godot 3.0.">
</constant>
</constants>
</class>
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index 49db3f81b4..ee6546dd14 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -71,11 +71,10 @@
Returns the [RID] of this resource (or an empty RID). Many resources (such as [Texture2D], [Mesh], and so on) are high-level abstractions of resources stored in a specialized server ([DisplayServer], [RenderingServer], etc.), so this function will return the original [RID].
</description>
</method>
- <method name="setup_local_to_scene" is_deprecated="true">
+ <method name="setup_local_to_scene" deprecated="This method should only be called internally. Override [method _setup_local_to_scene] instead.">
<return type="void" />
<description>
Calls [method _setup_local_to_scene]. If [member resource_local_to_scene] is set to [code]true[/code], this method is automatically called from [method PackedScene.instantiate] by the newly duplicated resource within the scene instance.
- [i]Deprecated.[/i] This method should only be called internally. Override [method _setup_local_to_scene] instead.
</description>
</method>
<method name="take_over_path">
@@ -107,10 +106,9 @@
[b]Note:[/b] This signal is not emitted automatically for properties of custom resources. If necessary, a setter needs to be created to emit the signal.
</description>
</signal>
- <signal name="setup_local_to_scene_requested" is_deprecated="true">
+ <signal name="setup_local_to_scene_requested" deprecated="This signal is only emitted when the resource is created. Override [method _setup_local_to_scene] instead.">
<description>
- Emitted by a newly duplicated resource with [member resource_local_to_scene] set to [code]true[/code].
- [i]Deprecated.[/i] This signal is only emitted when the resource is created. Override [method _setup_local_to_scene] instead.
+ Emitted by a newly duplicated resource with [member resource_local_to_scene] set to [code]true[/code].
</description>
</signal>
</signals>
diff --git a/doc/classes/ScriptLanguageExtension.xml b/doc/classes/ScriptLanguageExtension.xml
index c5248f4888..778e456646 100644
--- a/doc/classes/ScriptLanguageExtension.xml
+++ b/doc/classes/ScriptLanguageExtension.xml
@@ -34,6 +34,11 @@
<description>
</description>
</method>
+ <method name="_can_make_function" qualifiers="virtual const">
+ <return type="bool" />
+ <description>
+ </description>
+ </method>
<method name="_complete_code" qualifiers="virtual const">
<return type="Dictionary" />
<param index="0" name="code" type="String" />
@@ -203,10 +208,9 @@
<description>
</description>
</method>
- <method name="_has_named_classes" qualifiers="virtual const" is_deprecated="true">
+ <method name="_has_named_classes" qualifiers="virtual const" deprecated="This method is not called by the engine.">
<return type="bool" />
<description>
- [i]Deprecated.[/i] This method is not called by the engine.
</description>
</method>
<method name="_init" qualifiers="virtual">
diff --git a/doc/classes/ShapeCast3D.xml b/doc/classes/ShapeCast3D.xml
index e189628f4c..ff057e8c70 100644
--- a/doc/classes/ShapeCast3D.xml
+++ b/doc/classes/ShapeCast3D.xml
@@ -119,11 +119,11 @@
Removes a collision exception so the shape does report collisions with the specified [RID].
</description>
</method>
- <method name="resource_changed" is_deprecated="true">
+ <method name="resource_changed" deprecated="Use [signal Resource.changed] instead.">
<return type="void" />
<param index="0" name="resource" type="Resource" />
<description>
- [i]Obsoleted.[/i] Use [signal Resource.changed] instead.
+ This method does nothing.
</description>
</method>
<method name="set_collision_mask_value">
diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml
index 2a629abc0d..360fc9b2a9 100644
--- a/doc/classes/Skeleton3D.xml
+++ b/doc/classes/Skeleton3D.xml
@@ -44,11 +44,10 @@
Returns the bone index that matches [param name] as its name.
</description>
</method>
- <method name="force_update_all_bone_transforms" is_deprecated="true">
+ <method name="force_update_all_bone_transforms" deprecated="Do not use this method.">
<return type="void" />
<description>
Force updates the bone transforms/poses for all bones in the skeleton.
- [i]Deprecated.[/i] Do not use.
</description>
</method>
<method name="force_update_bone_child_transform">
diff --git a/doc/classes/SkeletonIK3D.xml b/doc/classes/SkeletonIK3D.xml
index c72383c84f..d1f96adec2 100644
--- a/doc/classes/SkeletonIK3D.xml
+++ b/doc/classes/SkeletonIK3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonIK3D" inherits="Node" is_deprecated="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonIK3D" inherits="Node" deprecated="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A node used to rotate all bones of a [Skeleton3D] bone chain a way that places the end bone at a desired 3D position.
</brief_description>
@@ -24,7 +24,6 @@
# Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on Skeleton)
skeleton_ik_node.set_interpolation(0.0)
[/codeblock]
- [i]Deprecated.[/i] This class is deprecated, and might be removed in a future release.
</description>
<tutorials>
<link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
diff --git a/doc/classes/SkeletonModification2D.xml b/doc/classes/SkeletonModification2D.xml
index c1eee9cb5c..c09e63be85 100644
--- a/doc/classes/SkeletonModification2D.xml
+++ b/doc/classes/SkeletonModification2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModification2D" inherits="Resource" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModification2D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Base class for resources that operate on [Bone2D]s in a [Skeleton2D].
</brief_description>
diff --git a/doc/classes/SkeletonModification2DCCDIK.xml b/doc/classes/SkeletonModification2DCCDIK.xml
index af71ae809c..e20cbd8960 100644
--- a/doc/classes/SkeletonModification2DCCDIK.xml
+++ b/doc/classes/SkeletonModification2DCCDIK.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModification2DCCDIK" inherits="SkeletonModification2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModification2DCCDIK" inherits="SkeletonModification2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A modification that uses CCDIK to manipulate a series of bones to reach a target in 2D.
</brief_description>
diff --git a/doc/classes/SkeletonModification2DFABRIK.xml b/doc/classes/SkeletonModification2DFABRIK.xml
index a31c908082..16784dbf4d 100644
--- a/doc/classes/SkeletonModification2DFABRIK.xml
+++ b/doc/classes/SkeletonModification2DFABRIK.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModification2DFABRIK" inherits="SkeletonModification2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModification2DFABRIK" inherits="SkeletonModification2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A modification that uses FABRIK to manipulate a series of [Bone2D] nodes to reach a target.
</brief_description>
diff --git a/doc/classes/SkeletonModification2DJiggle.xml b/doc/classes/SkeletonModification2DJiggle.xml
index 7683d29d1c..4a09806b82 100644
--- a/doc/classes/SkeletonModification2DJiggle.xml
+++ b/doc/classes/SkeletonModification2DJiggle.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModification2DJiggle" inherits="SkeletonModification2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModification2DJiggle" inherits="SkeletonModification2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A modification that jiggles [Bone2D] nodes as they move towards a target.
</brief_description>
diff --git a/doc/classes/SkeletonModification2DLookAt.xml b/doc/classes/SkeletonModification2DLookAt.xml
index 797722eb86..232104f6ac 100644
--- a/doc/classes/SkeletonModification2DLookAt.xml
+++ b/doc/classes/SkeletonModification2DLookAt.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModification2DLookAt" inherits="SkeletonModification2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModification2DLookAt" inherits="SkeletonModification2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A modification that rotates a [Bone2D] node to look at a target.
</brief_description>
diff --git a/doc/classes/SkeletonModification2DPhysicalBones.xml b/doc/classes/SkeletonModification2DPhysicalBones.xml
index 930f201ad5..163fab892c 100644
--- a/doc/classes/SkeletonModification2DPhysicalBones.xml
+++ b/doc/classes/SkeletonModification2DPhysicalBones.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModification2DPhysicalBones" inherits="SkeletonModification2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModification2DPhysicalBones" inherits="SkeletonModification2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A modification that applies the transforms of [PhysicalBone2D] nodes to [Bone2D] nodes.
</brief_description>
diff --git a/doc/classes/SkeletonModification2DStackHolder.xml b/doc/classes/SkeletonModification2DStackHolder.xml
index 60fba86d32..5b9f6f270a 100644
--- a/doc/classes/SkeletonModification2DStackHolder.xml
+++ b/doc/classes/SkeletonModification2DStackHolder.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModification2DStackHolder" inherits="SkeletonModification2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModification2DStackHolder" inherits="SkeletonModification2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A modification that holds and executes a [SkeletonModificationStack2D].
</brief_description>
diff --git a/doc/classes/SkeletonModification2DTwoBoneIK.xml b/doc/classes/SkeletonModification2DTwoBoneIK.xml
index 2206aa5719..1c7bb32f4a 100644
--- a/doc/classes/SkeletonModification2DTwoBoneIK.xml
+++ b/doc/classes/SkeletonModification2DTwoBoneIK.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModification2DTwoBoneIK" inherits="SkeletonModification2D" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModification2DTwoBoneIK" inherits="SkeletonModification2D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A modification that rotates two bones using the law of cosines to reach the target.
</brief_description>
diff --git a/doc/classes/SkeletonModificationStack2D.xml b/doc/classes/SkeletonModificationStack2D.xml
index 391771d1d3..a006f727ee 100644
--- a/doc/classes/SkeletonModificationStack2D.xml
+++ b/doc/classes/SkeletonModificationStack2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SkeletonModificationStack2D" inherits="Resource" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="SkeletonModificationStack2D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A resource that holds a stack of [SkeletonModification2D]s.
</brief_description>
diff --git a/doc/classes/StreamPeerGZIP.xml b/doc/classes/StreamPeerGZIP.xml
index fc22f72df9..e3f8441d19 100644
--- a/doc/classes/StreamPeerGZIP.xml
+++ b/doc/classes/StreamPeerGZIP.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="StreamPeerGZIP" inherits="StreamPeer" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="StreamPeerGZIP" inherits="StreamPeer" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A stream peer that handles GZIP and deflate compression/decompression.
</brief_description>
diff --git a/doc/classes/SubViewportContainer.xml b/doc/classes/SubViewportContainer.xml
index e47e27c0ce..b7d097cc91 100644
--- a/doc/classes/SubViewportContainer.xml
+++ b/doc/classes/SubViewportContainer.xml
@@ -11,7 +11,7 @@
<tutorials>
</tutorials>
<methods>
- <method name="_propagate_input_event" qualifiers="virtual const" is_experimental="true">
+ <method name="_propagate_input_event" qualifiers="virtual const" experimental="">
<return type="bool" />
<param index="0" name="event" type="InputEvent" />
<description>
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index 32c5f8dff7..6df5a4d18e 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -119,13 +119,12 @@
Removes the index array by expanding the vertex array.
</description>
</method>
- <method name="generate_lod" is_deprecated="true">
+ <method name="generate_lod" deprecated="Unused internally and fails to preserve normals or UVs. Consider using [method ImporterMesh.generate_lods] instead.">
<return type="PackedInt32Array" />
<param index="0" name="nd_threshold" type="float" />
<param index="1" name="target_index_count" type="int" default="3" />
<description>
Generates a LOD for a given [param nd_threshold] in linear units (square root of quadric error metric), using at most [param target_index_count] indices.
- [i]Deprecated.[/i] Unused internally and fails to preserve normals or UVs. Consider using [method ImporterMesh.generate_lods] instead.
</description>
</method>
<method name="generate_normals">
diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml
index d5f60839b9..73fbbb783e 100644
--- a/doc/classes/TextureRect.xml
+++ b/doc/classes/TextureRect.xml
@@ -10,7 +10,7 @@
<link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<members>
- <member name="expand_mode" type="int" setter="set_expand_mode" getter="get_expand_mode" enum="TextureRect.ExpandMode" default="0" is_experimental="true">
+ <member name="expand_mode" type="int" setter="set_expand_mode" getter="get_expand_mode" enum="TextureRect.ExpandMode" default="0" experimental="">
Defines how minimum size is determined based on the texture's size. See [enum ExpandMode] for options.
[b]Note:[/b] Using [constant EXPAND_FIT_WIDTH], [constant EXPAND_FIT_WIDTH_PROPORTIONAL], [constant EXPAND_FIT_HEIGHT] or [constant EXPAND_FIT_HEIGHT_PROPORTIONAL] may result in unstable behavior in some containers. This functionality is being re-evaluated and will change in the future.
</member>
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 695ffca1a3..e1e16e86a7 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -76,11 +76,10 @@
Clears cells that do not exist in the tileset.
</description>
</method>
- <method name="force_update" is_deprecated="true">
+ <method name="force_update" deprecated="Use [method notify_runtime_tile_data_update] and/or [method update_internals] instead.">
<return type="void" />
<param index="0" name="layer" type="int" default="-1" />
<description>
- [i]Deprecated.[/i] See [method notify_runtime_tile_data_update] and [method update_internals].
</description>
</method>
<method name="get_cell_alternative_tile" qualifiers="const">
@@ -196,7 +195,7 @@
Returns the number of layers in the TileMap.
</description>
</method>
- <method name="get_navigation_map" qualifiers="const" is_deprecated="true">
+ <method name="get_navigation_map" qualifiers="const" deprecated="">
<return type="RID" />
<param index="0" name="layer" type="int" />
<description>
@@ -445,7 +444,7 @@
If [param layer] is negative, the layers are accessed from the last one.
</description>
</method>
- <method name="set_navigation_map" is_deprecated="true">
+ <method name="set_navigation_map" deprecated="">
<return type="void" />
<param index="0" name="layer" type="int" />
<param index="1" name="map" type="RID" />
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 66a42d4bb4..b79a8cbdb4 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -568,7 +568,7 @@
Sets the given column's custom color.
</description>
</method>
- <method name="set_custom_draw" is_deprecated="true">
+ <method name="set_custom_draw" deprecated="Use [method TreeItem.set_custom_draw_callback] instead.">
<return type="void" />
<param index="0" name="column" type="int" />
<param index="1" name="object" type="Object" />
@@ -576,7 +576,6 @@
<description>
Sets the given column's custom draw callback to [param callback] method on [param object].
The [param callback] should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2].
- [i]Deprecated.[/i] Use [method TreeItem.set_custom_draw_callback] instead.
</description>
</method>
<method name="set_custom_draw_callback">
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 6d8ada9370..711f6eadf8 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -187,7 +187,7 @@
Helper method which calls the [code]set_text()[/code] method on the currently focused [Control], provided that it is defined (e.g. if the focused Control is [Button] or [LineEdit]).
</description>
</method>
- <method name="push_unhandled_input" is_deprecated="true">
+ <method name="push_unhandled_input" deprecated="Use [method push_input] instead.">
<return type="void" />
<param index="0" name="event" type="InputEvent" />
<param index="1" name="in_local_coords" type="bool" default="false" />
@@ -202,7 +202,6 @@
If an earlier method marks the input as handled via [method set_input_as_handled], any later method in this list will not be called.
If none of the methods handle the event and [member physics_object_picking] is [code]true[/code], the event is used for physics object picking.
[b]Note:[/b] This method doesn't propagate input events to embedded [Window]s or [SubViewport]s.
- [i]Deprecated.[/i] Use [method push_input] instead.
</description>
</method>
<method name="set_canvas_cull_mask_bit">
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index ab14f64aa1..57d26bf384 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -357,11 +357,10 @@
Centers a native window on the current screen and an embedded window on its embedder [Viewport].
</description>
</method>
- <method name="move_to_foreground" is_deprecated="true">
+ <method name="move_to_foreground" deprecated="Use [method Window.grab_focus] instead.">
<return type="void" />
<description>
Moves the [Window] on top of other windows and focuses it.
- [i]Deprecated.[/i] Use [method Window.grab_focus] instead.
</description>
</method>
<method name="popup">
diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml
index 6fb43d77d9..5276e05379 100644
--- a/doc/classes/XRInterface.xml
+++ b/doc/classes/XRInterface.xml
@@ -102,18 +102,16 @@
Is [code]true[/code] if this interface has been initialized.
</description>
</method>
- <method name="is_passthrough_enabled" is_deprecated="true">
+ <method name="is_passthrough_enabled" deprecated="Check if [member environment_blend_mode] is [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND], instead.">
<return type="bool" />
<description>
Is [code]true[/code] if passthrough is enabled.
- [i]Deprecated.[/i] Check if [member environment_blend_mode] is [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND], instead.
</description>
</method>
- <method name="is_passthrough_supported" is_deprecated="true">
+ <method name="is_passthrough_supported" deprecated="Check that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is supported using [method get_supported_environment_blend_modes], instead.">
<return type="bool" />
<description>
Is [code]true[/code] if this interface supports passthrough.
- [i]Deprecated.[/i] Check that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is supported using [method get_supported_environment_blend_modes], instead.
</description>
</method>
<method name="set_environment_blend_mode">
@@ -146,19 +144,17 @@
[b]Note:[/b] Changing this after the interface has already been initialized can be jarring for the player, so it's recommended to recenter on the HMD with [method XRServer.center_on_hmd] (if switching to [constant XRInterface.XR_PLAY_AREA_STAGE]) or make the switch during a scene change.
</description>
</method>
- <method name="start_passthrough" is_deprecated="true">
+ <method name="start_passthrough" deprecated="Set the [member environment_blend_mode] to [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND], instead.">
<return type="bool" />
<description>
Starts passthrough, will return [code]false[/code] if passthrough couldn't be started.
[b]Note:[/b] The viewport used for XR must have a transparent background, otherwise passthrough may not properly render.
- [i]Deprecated.[/i] Set the [member environment_blend_mode] to [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND], instead.
</description>
</method>
- <method name="stop_passthrough" is_deprecated="true">
+ <method name="stop_passthrough" deprecated="Set the [member environment_blend_mode] to [constant XRInterface.XR_ENV_BLEND_MODE_OPAQUE], instead.">
<return type="void" />
<description>
Stops passthrough.
- [i]Deprecated.[/i] Set the [member environment_blend_mode] to [constant XRInterface.XR_ENV_BLEND_MODE_OPAQUE], instead.
</description>
</method>
<method name="supports_play_area_mode">
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py
index 76a665d3c0..e52d863f7d 100755
--- a/doc/tools/make_rst.py
+++ b/doc/tools/make_rst.py
@@ -77,6 +77,15 @@ BASE_STRINGS = [
"There is currently no description for this operator. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!",
"There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!",
"There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information.",
+ "Deprecated:",
+ "Experimental:",
+ "This signal may be changed or removed in future versions.",
+ "This constant may be changed or removed in future versions.",
+ "This property may be changed or removed in future versions.",
+ "This constructor may be changed or removed in future versions.",
+ "This method may be changed or removed in future versions.",
+ "This operator may be changed or removed in future versions.",
+ "This theme property may be changed or removed in future versions.",
]
strings_l10n: Dict[str, str] = {}
@@ -158,6 +167,9 @@ class State:
if inherits is not None:
class_def.inherits = inherits
+ class_def.deprecated = class_root.get("deprecated")
+ class_def.experimental = class_root.get("experimental")
+
brief_desc = class_root.find("brief_description")
if brief_desc is not None and brief_desc.text:
class_def.brief_description = brief_desc.text
@@ -191,6 +203,8 @@ class State:
property_def = PropertyDef(
property_name, type_name, setter, getter, property.text, default_value, overrides
)
+ property_def.deprecated = property.get("deprecated")
+ property_def.experimental = property.get("experimental")
class_def.properties[property_name] = property_def
constructors = class_root.find("constructors")
@@ -216,6 +230,8 @@ class State:
method_def = MethodDef(method_name, return_type, params, method_desc, qualifiers)
method_def.definition_name = "constructor"
+ method_def.deprecated = constructor.get("deprecated")
+ method_def.experimental = constructor.get("experimental")
if method_name not in class_def.constructors:
class_def.constructors[method_name] = []
@@ -244,6 +260,8 @@ class State:
method_desc = desc_element.text
method_def = MethodDef(method_name, return_type, params, method_desc, qualifiers)
+ method_def.deprecated = method.get("deprecated")
+ method_def.experimental = method.get("experimental")
if method_name not in class_def.methods:
class_def.methods[method_name] = []
@@ -273,6 +291,8 @@ class State:
method_def = MethodDef(method_name, return_type, params, method_desc, qualifiers)
method_def.definition_name = "operator"
+ method_def.deprecated = operator.get("deprecated")
+ method_def.experimental = operator.get("experimental")
if method_name not in class_def.operators:
class_def.operators[method_name] = []
@@ -288,6 +308,8 @@ class State:
enum = constant.get("enum")
is_bitfield = constant.get("is_bitfield") == "true"
constant_def = ConstantDef(constant_name, value, constant.text, is_bitfield)
+ constant_def.deprecated = constant.get("deprecated")
+ constant_def.experimental = constant.get("experimental")
if enum is None:
if constant_name in class_def.constants:
print_error(f'{class_name}.xml: Duplicate constant "{constant_name}".', self)
@@ -345,6 +367,8 @@ class State:
signal_desc = desc_element.text
signal_def = SignalDef(signal_name, params, signal_desc)
+ signal_def.deprecated = signal.get("deprecated")
+ signal_def.experimental = signal.get("experimental")
class_def.signals[signal_name] = signal_def
theme_items = class_root.find("theme_items")
@@ -357,7 +381,7 @@ class State:
theme_item_id = "{}_{}".format(theme_item_data_name, theme_item_name)
if theme_item_id in class_def.theme_items:
print_error(
- f'{class_name}.xml: Duplicate theme item "{theme_item_name}" of type "{theme_item_data_name}".',
+ f'{class_name}.xml: Duplicate theme property "{theme_item_name}" of type "{theme_item_data_name}".',
self,
)
continue
@@ -447,6 +471,8 @@ class DefinitionBase:
) -> None:
self.definition_name = definition_name
self.name = name
+ self.deprecated: Optional[str] = None
+ self.experimental: Optional[str] = None
class PropertyDef(DefinitionBase):
@@ -540,7 +566,7 @@ class ThemeItemDef(DefinitionBase):
def __init__(
self, name: str, type_name: TypeName, data_name: str, text: Optional[str], default_value: Optional[str]
) -> None:
- super().__init__("theme item", name)
+ super().__init__("theme property", name)
self.type_name = type_name
self.data_name = data_name
@@ -892,6 +918,8 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
f.write(f".. _class_{class_name}:\n\n")
f.write(make_heading(class_name, "=", False))
+ f.write(make_deprecated_experimental(class_def, state))
+
### INHERITANCE TREE ###
# Ascendants
@@ -1066,6 +1094,8 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
# Add signal description, or a call to action if it's missing.
+ f.write(make_deprecated_experimental(signal, state))
+
if signal.description is not None and signal.description.strip() != "":
f.write(f"{format_text_block(signal.description.strip(), signal, state)}\n\n")
else:
@@ -1111,6 +1141,8 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
# Add enum constant description.
+ f.write(make_deprecated_experimental(value, state))
+
if value.text is not None and value.text.strip() != "":
f.write(f"{format_text_block(value.text.strip(), value, state)}")
else:
@@ -1140,7 +1172,9 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
f.write(f"**{constant.name}** = ``{constant.value}``\n\n")
- # Add enum constant description.
+ # Add constant description.
+
+ f.write(make_deprecated_experimental(constant, state))
if constant.text is not None and constant.text.strip() != "":
f.write(f"{format_text_block(constant.text.strip(), constant, state)}")
@@ -1236,6 +1270,8 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
# Add property description, or a call to action if it's missing.
+ f.write(make_deprecated_experimental(property_def, state))
+
if property_def.text is not None and property_def.text.strip() != "":
f.write(f"{format_text_block(property_def.text.strip(), property_def, state)}\n\n")
else:
@@ -1274,6 +1310,8 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
# Add constructor description, or a call to action if it's missing.
+ f.write(make_deprecated_experimental(m, state))
+
if m.description is not None and m.description.strip() != "":
f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n")
else:
@@ -1315,6 +1353,8 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
# Add method description, or a call to action if it's missing.
+ f.write(make_deprecated_experimental(m, state))
+
if m.description is not None and m.description.strip() != "":
f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n")
else:
@@ -1355,6 +1395,8 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
# Add operator description, or a call to action if it's missing.
+ f.write(make_deprecated_experimental(m, state))
+
if m.description is not None and m.description.strip() != "":
f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n")
else:
@@ -1392,6 +1434,8 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
# Add theme property description, or a call to action if it's missing.
+ f.write(make_deprecated_experimental(theme_item_def, state))
+
if theme_item_def.text is not None and theme_item_def.text.strip() != "":
f.write(f"{format_text_block(theme_item_def.text.strip(), theme_item_def, state)}\n\n")
else:
@@ -1542,6 +1586,28 @@ def make_getter_signature(class_def: ClassDef, property_def: PropertyDef, state:
return f"{ret_type} {signature}"
+def make_deprecated_experimental(item: DefinitionBase, state: State) -> str:
+ result = ""
+
+ if item.deprecated is not None:
+ deprecated_prefix = translate("Deprecated:")
+ if item.deprecated.strip() == "":
+ default_message = translate(f"This {item.definition_name} may be changed or removed in future versions.")
+ result += f"**{deprecated_prefix}** {default_message}\n\n"
+ else:
+ result += f"**{deprecated_prefix}** {format_text_block(item.deprecated.strip(), item, state)}\n\n"
+
+ if item.experimental is not None:
+ experimental_prefix = translate("Experimental:")
+ if item.experimental.strip() == "":
+ default_message = translate(f"This {item.definition_name} may be changed or removed in future versions.")
+ result += f"**{experimental_prefix}** {default_message}\n\n"
+ else:
+ result += f"**{experimental_prefix}** {format_text_block(item.experimental.strip(), item, state)}\n\n"
+
+ return result
+
+
def make_heading(title: str, underline: str, l10n: bool = True) -> str:
if l10n:
new_title = translate(title)
@@ -1965,7 +2031,7 @@ def format_text_block(
elif target_name in class_def.theme_items:
print_warning(
- f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} theme item in {context_name}. {code_warning_if_intended_string}',
+ f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} theme property in {context_name}. {code_warning_if_intended_string}',
state,
)
@@ -2076,7 +2142,7 @@ def format_text_block(
elif tag_state.name == "theme_item":
if target_name not in class_def.theme_items:
print_error(
- f'{state.current_class}.xml: Unresolved theme item reference "{link_target}" in {context_name}.',
+ f'{state.current_class}.xml: Unresolved theme property reference "{link_target}" in {context_name}.',
state,
)
else:
diff --git a/drivers/d3d12/rendering_device_driver_d3d12.cpp b/drivers/d3d12/rendering_device_driver_d3d12.cpp
index 8d1045b2b3..6517b4e91b 100644
--- a/drivers/d3d12/rendering_device_driver_d3d12.cpp
+++ b/drivers/d3d12/rendering_device_driver_d3d12.cpp
@@ -1545,24 +1545,26 @@ RDD::TextureID RenderingDeviceDriverD3D12::texture_create_shared_from_slice(Text
}
} break;
case TEXTURE_SLICE_CUBEMAP: {
- if (srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBE) {
- DEV_ASSERT(uav_desc.ViewDimension == D3D12_UAV_DIMENSION_TEXTURE2DARRAY);
- } else if (srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBE || p_layer == 0) {
+ if (srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBE || p_layer == 0) {
srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURECUBE;
+ srv_desc.TextureCube.MostDetailedMip = p_mipmap;
+ srv_desc.TextureCube.MipLevels = 1;
DEV_ASSERT(uav_desc.ViewDimension == D3D12_UAV_DIMENSION_TEXTURE2DARRAY);
- uav_desc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2DARRAY;
+ uav_desc.Texture2DArray.MipSlice = p_mipmap;
uav_desc.Texture2DArray.FirstArraySlice = 0;
uav_desc.Texture2DArray.ArraySize = 6;
uav_desc.Texture2DArray.PlaneSlice = 0;
} else if (srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBEARRAY || p_layer != 0) {
srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURECUBEARRAY;
+ srv_desc.TextureCubeArray.MostDetailedMip = p_mipmap;
+ srv_desc.TextureCubeArray.MipLevels = 1;
srv_desc.TextureCubeArray.First2DArrayFace = p_layer;
srv_desc.TextureCubeArray.NumCubes = 1;
srv_desc.TextureCubeArray.ResourceMinLODClamp = 0.0f;
DEV_ASSERT(uav_desc.ViewDimension == D3D12_UAV_DIMENSION_TEXTURE2DARRAY);
- uav_desc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2DARRAY;
+ uav_desc.Texture2DArray.MipSlice = p_mipmap;
uav_desc.Texture2DArray.FirstArraySlice = p_layer;
uav_desc.Texture2DArray.ArraySize = 6;
uav_desc.Texture2DArray.PlaneSlice = 0;
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index 0a20d83836..f5296f969f 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -193,7 +193,7 @@ typedef void(GLAPIENTRY *DEBUGPROCARB)(GLenum source,
typedef void(GLAPIENTRY *DebugMessageCallbackARB)(DEBUGPROCARB callback, const void *userParam);
void RasterizerGLES3::initialize() {
- print_line(vformat("OpenGL API %s - Compatibility - Using Device: %s - %s", RS::get_singleton()->get_video_adapter_api_version(), RS::get_singleton()->get_video_adapter_vendor(), RS::get_singleton()->get_video_adapter_name()));
+ Engine::get_singleton()->print_header(vformat("OpenGL API %s - Compatibility - Using Device: %s - %s", RS::get_singleton()->get_video_adapter_api_version(), RS::get_singleton()->get_video_adapter_vendor(), RS::get_singleton()->get_video_adapter_name()));
}
void RasterizerGLES3::finalize() {
diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp
index a8074aa3f6..1e52b39be1 100644
--- a/drivers/unix/net_socket_posix.cpp
+++ b/drivers/unix/net_socket_posix.cpp
@@ -787,11 +787,11 @@ Ref<NetSocket> NetSocketPosix::accept(IPAddress &r_ip, uint16_t &r_port) {
return Ref<NetSocket>(ns);
}
-Error NetSocketPosix::join_multicast_group(const IPAddress &p_multi_address, String p_if_name) {
+Error NetSocketPosix::join_multicast_group(const IPAddress &p_multi_address, const String &p_if_name) {
return _change_multicast_group(p_multi_address, p_if_name, true);
}
-Error NetSocketPosix::leave_multicast_group(const IPAddress &p_multi_address, String p_if_name) {
+Error NetSocketPosix::leave_multicast_group(const IPAddress &p_multi_address, const String &p_if_name) {
return _change_multicast_group(p_multi_address, p_if_name, false);
}
diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h
index 2682530e15..aa59ff36ee 100644
--- a/drivers/unix/net_socket_posix.h
+++ b/drivers/unix/net_socket_posix.h
@@ -98,8 +98,8 @@ public:
virtual void set_tcp_no_delay_enabled(bool p_enabled);
virtual void set_reuse_address_enabled(bool p_enabled);
virtual void set_reuse_port_enabled(bool p_enabled);
- virtual Error join_multicast_group(const IPAddress &p_multi_address, String p_if_name);
- virtual Error leave_multicast_group(const IPAddress &p_multi_address, String p_if_name);
+ virtual Error join_multicast_group(const IPAddress &p_multi_address, const String &p_if_name);
+ virtual Error leave_multicast_group(const IPAddress &p_multi_address, const String &p_if_name);
NetSocketPosix();
~NetSocketPosix();
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 8126f74332..83a332dea9 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -639,7 +639,7 @@ String OS_Unix::get_locale() const {
return locale;
}
-Error OS_Unix::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
+Error OS_Unix::open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
String path = p_path;
if (FileAccess::exists(path) && path.is_relative_path()) {
@@ -677,7 +677,7 @@ Error OS_Unix::close_dynamic_library(void *p_library_handle) {
return OK;
}
-Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional) {
+Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const String &p_name, void *&p_symbol_handle, bool p_optional) {
const char *error;
dlerror(); // Clear existing errors
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 86b0e38e92..d3393c98ec 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -55,9 +55,9 @@ public:
virtual Error get_entropy(uint8_t *r_buffer, int p_bytes) override;
- virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
+ virtual Error open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
virtual Error close_dynamic_library(void *p_library_handle) override;
- virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) override;
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String &p_name, void *&p_symbol_handle, bool p_optional = false) override;
virtual Error set_cwd(const String &p_cwd) override;
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp
index 9d370e30a5..43dd62cdf6 100644
--- a/drivers/windows/dir_access_windows.cpp
+++ b/drivers/windows/dir_access_windows.cpp
@@ -68,7 +68,7 @@ struct DirAccessWindowsPrivate {
WIN32_FIND_DATAW fu; // Unicode version.
};
-String DirAccessWindows::fix_path(String p_path) const {
+String DirAccessWindows::fix_path(const String &p_path) const {
String r_path = DirAccess::fix_path(p_path);
if (r_path.is_absolute_path() && !r_path.is_network_share_path() && r_path.length() > MAX_PATH) {
r_path = "\\\\?\\" + r_path.replace("/", "\\");
diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h
index 1dcab84c9d..576ba18d9a 100644
--- a/drivers/windows/dir_access_windows.h
+++ b/drivers/windows/dir_access_windows.h
@@ -54,7 +54,7 @@ class DirAccessWindows : public DirAccess {
bool _cishidden = false;
protected:
- virtual String fix_path(String p_path) const override;
+ virtual String fix_path(const String &p_path) const override;
public:
virtual Error list_dir_begin() override; ///< This starts dir listing
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 5029b5caa9..e1ce08b83e 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -794,7 +794,7 @@ void AnimationBezierTrackEdit::_clear_selection() {
void AnimationBezierTrackEdit::_change_selected_keys_handle_mode(Animation::HandleMode p_mode, bool p_auto) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
- undo_redo->create_action(TTR("Update Selected Key Handles"));
+ undo_redo->create_action(TTR("Update Selected Key Handles"), UndoRedo::MERGE_DISABLE, animation.ptr());
for (SelectionSet::Element *E = selection.back(); E; E = E->prev()) {
const IntPair track_key_pair = E->get();
undo_redo->add_undo_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track_key_pair.first, track_key_pair.second, animation->bezier_track_get_key_handle_mode(track_key_pair.first, track_key_pair.second), Animation::HANDLE_SET_MODE_NONE);
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 47c2df9d0f..1ff403291f 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -305,7 +305,7 @@ bool AnimationTrackKeyEdit::_set(const StringName &p_name, const Variant &p_valu
const Variant &value = p_value;
setting = true;
- undo_redo->create_action(TTR("Animation Change Keyframe Value"), UndoRedo::MERGE_ENDS);
+ undo_redo->create_action(TTR("Animation Change Keyframe Value"), UndoRedo::MERGE_ENDS, animation.ptr());
int prev_mode = animation->bezier_track_get_key_handle_mode(track, key);
Vector2 prev_in_handle = animation->bezier_track_get_key_in_handle(track, key);
Vector2 prev_out_handle = animation->bezier_track_get_key_out_handle(track, key);
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index e022294277..6ad8dae3b4 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -178,6 +178,7 @@ void ConnectDialog::_tree_node_selected() {
set_dst_method(generate_method_callback_name(source, signal, current));
}
_update_method_tree();
+ _update_warning_label();
_update_ok_enabled();
}
@@ -433,6 +434,23 @@ void ConnectDialog::_update_ok_enabled() {
get_ok_button()->set_disabled(false);
}
+void ConnectDialog::_update_warning_label() {
+ Ref<Script> scr = source->get_node(dst_path)->get_script();
+ if (scr.is_null()) {
+ warning_label->set_visible(false);
+ return;
+ }
+
+ ScriptLanguage *language = scr->get_language();
+ if (language->can_make_function()) {
+ warning_label->set_visible(false);
+ return;
+ }
+
+ warning_label->set_text(vformat(TTR("%s: Callback code won't be generated, please add it manually."), language->get_name()));
+ warning_label->set_visible(true);
+}
+
void ConnectDialog::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
@@ -617,6 +635,7 @@ void ConnectDialog::init(const ConnectionData &p_cd, const PackedStringArray &p_
void ConnectDialog::popup_dialog(const String p_for_signal) {
from_signal->set_text(p_for_signal);
+ warning_label->add_theme_color_override("font_color", warning_label->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
error_label->add_theme_color_override("font_color", error_label->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
filter_nodes->clear();
@@ -694,6 +713,10 @@ ConnectDialog::ConnectDialog() {
connect_to_label = Object::cast_to<Label>(vbc_left->get_child(mc->get_index() - 1));
vbc_left->add_child(tree);
+ warning_label = memnew(Label);
+ vbc_left->add_child(warning_label);
+ warning_label->hide();
+
error_label = memnew(Label);
error_label->set_text(TTR("Scene does not contain any script."));
vbc_left->add_child(error_label);
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index a99f0dd0fe..4f628d5685 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -134,6 +134,7 @@ private:
CheckButton *advanced = nullptr;
Vector<Control *> bind_controls;
+ Label *warning_label = nullptr;
Label *error_label = nullptr;
void ok_pressed() override;
@@ -155,6 +156,7 @@ private:
void _remove_bind();
void _advanced_pressed();
void _update_ok_enabled();
+ void _update_warning_label();
protected:
void _notification(int p_what);
diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp
index 4ebed726c5..72f1060589 100644
--- a/editor/debugger/editor_visual_profiler.cpp
+++ b/editor/debugger/editor_visual_profiler.cpp
@@ -70,7 +70,7 @@ void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) {
updating_frame = true;
clear_button->set_disabled(false);
cursor_metric_edit->set_max(frame_metrics[last_metric].frame_number);
- cursor_metric_edit->set_min(MAX(frame_metrics[last_metric].frame_number - frame_metrics.size(), 0u));
+ cursor_metric_edit->set_min(MAX(int64_t(frame_metrics[last_metric].frame_number) - frame_metrics.size(), 0));
if (!seeking) {
cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number);
diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp
index 18c6c8b69b..ee3e54e9df 100644
--- a/editor/doc_tools.cpp
+++ b/editor/doc_tools.cpp
@@ -87,7 +87,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.deprecated_message = cf.deprecated_message;
c.is_experimental = cf.is_experimental;
+ c.experimental_message = cf.experimental_message;
c.keywords = cf.keywords;
c.description = cf.description;
@@ -139,7 +141,9 @@ void DocTools::merge_from(const DocTools &p_data) {
m.description = mf.description;
m.is_deprecated = mf.is_deprecated;
+ m.deprecated_message = mf.deprecated_message;
m.is_experimental = mf.is_experimental;
+ m.experimental_message = mf.experimental_message;
break;
}
}
@@ -156,7 +160,9 @@ void DocTools::merge_from(const DocTools &p_data) {
m.description = mf.description;
m.is_deprecated = mf.is_deprecated;
+ m.deprecated_message = mf.deprecated_message;
m.is_experimental = mf.is_experimental;
+ m.experimental_message = mf.experimental_message;
m.keywords = mf.keywords;
break;
}
@@ -173,7 +179,9 @@ void DocTools::merge_from(const DocTools &p_data) {
m.description = mf.description;
m.is_deprecated = mf.is_deprecated;
+ m.deprecated_message = mf.deprecated_message;
m.is_experimental = mf.is_experimental;
+ m.experimental_message = mf.experimental_message;
m.keywords = mf.keywords;
break;
}
@@ -190,7 +198,9 @@ void DocTools::merge_from(const DocTools &p_data) {
m.description = mf.description;
m.is_deprecated = mf.is_deprecated;
+ m.deprecated_message = mf.deprecated_message;
m.is_experimental = mf.is_experimental;
+ m.experimental_message = mf.experimental_message;
m.keywords = mf.keywords;
break;
}
@@ -207,7 +217,9 @@ void DocTools::merge_from(const DocTools &p_data) {
m.description = mf.description;
m.is_deprecated = mf.is_deprecated;
+ m.deprecated_message = mf.deprecated_message;
m.is_experimental = mf.is_experimental;
+ m.experimental_message = mf.experimental_message;
m.keywords = mf.keywords;
break;
}
@@ -224,7 +236,9 @@ void DocTools::merge_from(const DocTools &p_data) {
p.description = pf.description;
p.is_deprecated = pf.is_deprecated;
+ p.deprecated_message = pf.deprecated_message;
p.is_experimental = pf.is_experimental;
+ p.experimental_message = pf.experimental_message;
p.keywords = pf.keywords;
break;
}
@@ -290,7 +304,9 @@ void DocTools::merge_from(const DocTools &p_data) {
m.description = mf.description;
m.is_deprecated = mf.is_deprecated;
+ m.deprecated_message = mf.deprecated_message;
m.is_experimental = mf.is_experimental;
+ m.experimental_message = mf.experimental_message;
break;
}
}
@@ -1068,12 +1084,22 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> &
if (parser->has_attribute("qualifiers")) {
method.qualifiers = parser->get_named_attribute_value("qualifiers");
}
+#ifndef DISABLE_DEPRECATED
if (parser->has_attribute("is_deprecated")) {
method.is_deprecated = parser->get_named_attribute_value("is_deprecated").to_lower() == "true";
}
if (parser->has_attribute("is_experimental")) {
method.is_experimental = parser->get_named_attribute_value("is_experimental").to_lower() == "true";
}
+#endif
+ if (parser->has_attribute("deprecated")) {
+ method.is_deprecated = true;
+ method.deprecated_message = parser->get_named_attribute_value("deprecated");
+ }
+ if (parser->has_attribute("experimental")) {
+ method.is_experimental = true;
+ method.experimental_message = parser->get_named_attribute_value("experimental");
+ }
if (parser->has_attribute("keywords")) {
method.keywords = parser->get_named_attribute_value("keywords");
}
@@ -1216,13 +1242,22 @@ Error DocTools::_load(Ref<XMLParser> parser) {
inheriting[c.inherits].insert(name);
+#ifndef DISABLE_DEPRECATED
if (parser->has_attribute("is_deprecated")) {
c.is_deprecated = parser->get_named_attribute_value("is_deprecated").to_lower() == "true";
}
-
if (parser->has_attribute("is_experimental")) {
c.is_experimental = parser->get_named_attribute_value("is_experimental").to_lower() == "true";
}
+#endif
+ if (parser->has_attribute("deprecated")) {
+ c.is_deprecated = true;
+ c.deprecated_message = parser->get_named_attribute_value("deprecated");
+ }
+ if (parser->has_attribute("experimental")) {
+ c.is_experimental = true;
+ c.experimental_message = parser->get_named_attribute_value("experimental");
+ }
if (parser->has_attribute("keywords")) {
c.keywords = parser->get_named_attribute_value("keywords");
@@ -1304,12 +1339,22 @@ Error DocTools::_load(Ref<XMLParser> parser) {
prop2.is_bitfield = parser->get_named_attribute_value("is_bitfield").to_lower() == "true";
}
}
+#ifndef DISABLE_DEPRECATED
if (parser->has_attribute("is_deprecated")) {
prop2.is_deprecated = parser->get_named_attribute_value("is_deprecated").to_lower() == "true";
}
if (parser->has_attribute("is_experimental")) {
prop2.is_experimental = parser->get_named_attribute_value("is_experimental").to_lower() == "true";
}
+#endif
+ if (parser->has_attribute("deprecated")) {
+ prop2.is_deprecated = true;
+ prop2.deprecated_message = parser->get_named_attribute_value("deprecated");
+ }
+ if (parser->has_attribute("experimental")) {
+ prop2.is_experimental = true;
+ prop2.experimental_message = parser->get_named_attribute_value("experimental");
+ }
if (parser->has_attribute("keywords")) {
prop2.keywords = parser->get_named_attribute_value("keywords");
}
@@ -1380,12 +1425,22 @@ Error DocTools::_load(Ref<XMLParser> parser) {
constant2.is_bitfield = parser->get_named_attribute_value("is_bitfield").to_lower() == "true";
}
}
+#ifndef DISABLE_DEPRECATED
if (parser->has_attribute("is_deprecated")) {
constant2.is_deprecated = parser->get_named_attribute_value("is_deprecated").to_lower() == "true";
}
if (parser->has_attribute("is_experimental")) {
constant2.is_experimental = parser->get_named_attribute_value("is_experimental").to_lower() == "true";
}
+#endif
+ if (parser->has_attribute("deprecated")) {
+ constant2.is_deprecated = true;
+ constant2.deprecated_message = parser->get_named_attribute_value("deprecated");
+ }
+ if (parser->has_attribute("experimental")) {
+ constant2.is_experimental = true;
+ constant2.experimental_message = parser->get_named_attribute_value("experimental");
+ }
if (parser->has_attribute("keywords")) {
constant2.keywords = parser->get_named_attribute_value("keywords");
}
@@ -1438,21 +1493,21 @@ static void _write_method_doc(Ref<FileAccess> f, const String &p_name, Vector<Do
additional_attributes += " qualifiers=\"" + m.qualifiers.xml_escape(true) + "\"";
}
if (m.is_deprecated) {
- additional_attributes += " is_deprecated=\"true\"";
+ additional_attributes += " deprecated=\"" + m.deprecated_message.xml_escape(true) + "\"";
}
if (m.is_experimental) {
- additional_attributes += " is_experimental=\"true\"";
+ additional_attributes += " experimental=\"" + m.experimental_message.xml_escape(true) + "\"";
}
if (!m.keywords.is_empty()) {
additional_attributes += String(" keywords=\"") + m.keywords.xml_escape(true) + "\"";
}
- _write_string(f, 2, "<" + p_name + " name=\"" + m.name.xml_escape() + "\"" + additional_attributes + ">");
+ _write_string(f, 2, "<" + p_name + " name=\"" + m.name.xml_escape(true) + "\"" + additional_attributes + ">");
if (!m.return_type.is_empty()) {
String enum_text;
if (!m.return_enum.is_empty()) {
- enum_text = " enum=\"" + m.return_enum + "\"";
+ enum_text = " enum=\"" + m.return_enum.xml_escape(true) + "\"";
if (m.return_is_bitfield) {
enum_text += " is_bitfield=\"true\"";
}
@@ -1470,16 +1525,16 @@ static void _write_method_doc(Ref<FileAccess> f, const String &p_name, Vector<Do
String enum_text;
if (!a.enumeration.is_empty()) {
- enum_text = " enum=\"" + a.enumeration + "\"";
+ enum_text = " enum=\"" + a.enumeration.xml_escape(true) + "\"";
if (a.is_bitfield) {
enum_text += " is_bitfield=\"true\"";
}
}
if (!a.default_value.is_empty()) {
- _write_string(f, 3, "<param index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape(true) + "\"" + enum_text + " default=\"" + a.default_value.xml_escape(true) + "\" />");
+ _write_string(f, 3, "<param index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape(true) + "\" type=\"" + a.type.xml_escape(true) + "\"" + enum_text + " default=\"" + a.default_value.xml_escape(true) + "\" />");
} else {
- _write_string(f, 3, "<param index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape(true) + "\"" + enum_text + " />");
+ _write_string(f, 3, "<param index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape(true) + "\" type=\"" + a.type.xml_escape(true) + "\"" + enum_text + " />");
}
}
@@ -1517,10 +1572,10 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
if (!c.inherits.is_empty()) {
header += " inherits=\"" + c.inherits.xml_escape(true) + "\"";
if (c.is_deprecated) {
- header += " is_deprecated=\"true\"";
+ header += " deprecated=\"" + c.deprecated_message.xml_escape(true) + "\"";
}
if (c.is_experimental) {
- header += " is_experimental=\"true\"";
+ header += " experimental=\"" + c.experimental_message.xml_escape(true) + "\"";
}
}
if (!c.keywords.is_empty()) {
@@ -1548,7 +1603,7 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
_write_string(f, 1, "<tutorials>");
for (int i = 0; i < c.tutorials.size(); i++) {
DocData::TutorialDoc tutorial = c.tutorials.get(i);
- String title_attribute = (!tutorial.title.is_empty()) ? " title=\"" + _translate_doc_string(tutorial.title).xml_escape() + "\"" : "";
+ String title_attribute = (!tutorial.title.is_empty()) ? " title=\"" + _translate_doc_string(tutorial.title).xml_escape(true) + "\"" : "";
_write_string(f, 2, "<link" + title_attribute + ">" + tutorial.link.xml_escape() + "</link>");
}
_write_string(f, 1, "</tutorials>");
@@ -1565,7 +1620,7 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
for (int i = 0; i < c.properties.size(); i++) {
String additional_attributes;
if (!c.properties[i].enumeration.is_empty()) {
- additional_attributes += " enum=\"" + c.properties[i].enumeration + "\"";
+ additional_attributes += " enum=\"" + c.properties[i].enumeration.xml_escape(true) + "\"";
if (c.properties[i].is_bitfield) {
additional_attributes += " is_bitfield=\"true\"";
}
@@ -1574,10 +1629,10 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
additional_attributes += " default=\"" + c.properties[i].default_value.xml_escape(true) + "\"";
}
if (c.properties[i].is_deprecated) {
- additional_attributes += " is_deprecated=\"true\"";
+ additional_attributes += " deprecated=\"" + c.properties[i].deprecated_message.xml_escape(true) + "\"";
}
if (c.properties[i].is_experimental) {
- additional_attributes += " is_experimental=\"true\"";
+ additional_attributes += " experimental=\"" + c.properties[i].experimental_message.xml_escape(true) + "\"";
}
if (!c.properties[i].keywords.is_empty()) {
additional_attributes += String(" keywords=\"") + c.properties[i].keywords.xml_escape(true) + "\"";
@@ -1586,9 +1641,9 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
const DocData::PropertyDoc &p = c.properties[i];
if (c.properties[i].overridden) {
- _write_string(f, 2, "<member name=\"" + p.name + "\" type=\"" + p.type.xml_escape(true) + "\" setter=\"" + p.setter + "\" getter=\"" + p.getter + "\" overrides=\"" + p.overrides + "\"" + additional_attributes + " />");
+ _write_string(f, 2, "<member name=\"" + p.name.xml_escape(true) + "\" type=\"" + p.type.xml_escape(true) + "\" setter=\"" + p.setter.xml_escape(true) + "\" getter=\"" + p.getter.xml_escape(true) + "\" overrides=\"" + p.overrides.xml_escape(true) + "\"" + additional_attributes + " />");
} else {
- _write_string(f, 2, "<member name=\"" + p.name + "\" type=\"" + p.type.xml_escape(true) + "\" setter=\"" + p.setter + "\" getter=\"" + p.getter + "\"" + additional_attributes + ">");
+ _write_string(f, 2, "<member name=\"" + p.name.xml_escape(true) + "\" type=\"" + p.type.xml_escape(true) + "\" setter=\"" + p.setter.xml_escape(true) + "\" getter=\"" + p.getter.xml_escape(true) + "\"" + additional_attributes + ">");
_write_string(f, 3, _translate_doc_string(p.description).strip_edges().xml_escape());
_write_string(f, 2, "</member>");
}
@@ -1605,10 +1660,10 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
String additional_attributes;
if (c.constants[i].is_deprecated) {
- additional_attributes += " is_deprecated=\"true\"";
+ additional_attributes += " deprecated=\"" + c.constants[i].deprecated_message.xml_escape(true) + "\"";
}
if (c.constants[i].is_experimental) {
- additional_attributes += " is_experimental=\"true\"";
+ additional_attributes += " experimental=\"" + c.constants[i].experimental_message.xml_escape(true) + "\"";
}
if (!c.constants[i].keywords.is_empty()) {
additional_attributes += String(" keywords=\"") + c.constants[i].keywords.xml_escape(true) + "\"";
@@ -1617,18 +1672,18 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
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.xml_escape(true) + "\" enum=\"" + k.enumeration + "\" is_bitfield=\"true\"" + additional_attributes + ">");
+ _write_string(f, 2, "<constant name=\"" + k.name.xml_escape(true) + "\" value=\"" + k.value.xml_escape(true) + "\" enum=\"" + k.enumeration.xml_escape(true) + "\" is_bitfield=\"true\"" + additional_attributes + ">");
} else {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value.xml_escape(true) + "\" enum=\"" + k.enumeration + "\"" + additional_attributes + ">");
+ _write_string(f, 2, "<constant name=\"" + k.name.xml_escape(true) + "\" value=\"" + k.value.xml_escape(true) + "\" enum=\"" + k.enumeration.xml_escape(true) + "\"" + additional_attributes + ">");
}
} else {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value.xml_escape(true) + "\"" + additional_attributes + ">");
+ _write_string(f, 2, "<constant name=\"" + k.name.xml_escape(true) + "\" value=\"" + k.value.xml_escape(true) + "\"" + additional_attributes + ">");
}
} else {
if (!k.enumeration.is_empty()) {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"platform-dependent\" enum=\"" + k.enumeration + "\"" + additional_attributes + ">");
+ _write_string(f, 2, "<constant name=\"" + k.name.xml_escape(true) + "\" value=\"platform-dependent\" enum=\"" + k.enumeration.xml_escape(true) + "\"" + additional_attributes + ">");
} else {
- _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"platform-dependent\"" + additional_attributes + ">");
+ _write_string(f, 2, "<constant name=\"" + k.name.xml_escape(true) + "\" value=\"platform-dependent\"" + additional_attributes + ">");
}
}
_write_string(f, 3, _translate_doc_string(k.description).strip_edges().xml_escape());
@@ -1655,7 +1710,7 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
additional_attributes += String(" keywords=\"") + ti.keywords.xml_escape(true) + "\"";
}
- _write_string(f, 2, "<theme_item name=\"" + ti.name + "\" data_type=\"" + ti.data_type + "\" type=\"" + ti.type + "\"" + additional_attributes + ">");
+ _write_string(f, 2, "<theme_item name=\"" + ti.name.xml_escape(true) + "\" data_type=\"" + ti.data_type.xml_escape(true) + "\" type=\"" + ti.type.xml_escape(true) + "\"" + additional_attributes + ">");
_write_string(f, 3, _translate_doc_string(ti.description).strip_edges().xml_escape());
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 7f15eca11d..a31da1bd13 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -211,7 +211,7 @@ void EditorHelp::_class_desc_select(const String &p_select) {
emit_signal(SNAME("go_to_help"), "class_name:" + p_select.substr(1, p_select.length()));
return;
} else if (p_select.begins_with("@")) {
- int tag_end = p_select.find(" ");
+ int tag_end = p_select.find_char(' ');
String tag = p_select.substr(1, tag_end - 1);
String link = p_select.substr(tag_end + 1, p_select.length()).lstrip(" ");
@@ -244,7 +244,7 @@ void EditorHelp::_class_desc_select(const String &p_select) {
topic = "class_annotation";
table = &annotation_line;
} else if (tag == "theme_item") {
- topic = "theme_item";
+ topic = "class_theme_item";
table = &theme_property_line;
} else {
return;
@@ -284,7 +284,7 @@ void EditorHelp::_class_desc_select(const String &p_select) {
}
if (link.contains(".")) {
- int class_end = link.find(".");
+ int class_end = link.find_char('.');
emit_signal(SNAME("go_to_help"), topic + ":" + link.substr(0, class_end) + ":" + link.substr(class_end + 1, link.length()));
}
}
@@ -317,8 +317,8 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum, bool p_is
class_desc->push_color(Color(theme_cache.type_color, 0.5));
class_desc->push_hint(TTR("No return value."));
class_desc->add_text("void");
- class_desc->pop();
- class_desc->pop();
+ class_desc->pop(); // hint
+ class_desc->pop(); // color
return;
}
@@ -345,15 +345,15 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum, bool p_is
class_desc->push_meta("#Array"); // class
class_desc->add_text("Array");
- class_desc->pop();
+ class_desc->pop(); // meta
class_desc->add_text("[");
} else if (is_bitfield) {
class_desc->push_color(Color(theme_cache.type_color, 0.5));
class_desc->push_hint(TTR("This value is an integer composed as a bitmask of the following flags."));
class_desc->add_text("BitField");
- class_desc->pop();
+ class_desc->pop(); // hint
class_desc->add_text("[");
- class_desc->pop();
+ class_desc->pop(); // color
}
if (is_enum_type) {
@@ -370,10 +370,10 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum, bool p_is
} else if (is_bitfield) {
class_desc->push_color(Color(theme_cache.type_color, 0.5));
class_desc->add_text("]");
- class_desc->pop();
+ class_desc->pop(); // color
}
}
- class_desc->pop();
+ class_desc->pop(); // color
}
void EditorHelp::_add_type_icon(const String &p_type, int p_size, const String &p_fallback) {
@@ -405,23 +405,60 @@ String EditorHelp::_fix_constant(const String &p_constant) const {
return p_constant;
}
-// Macros for assigning the deprecation/experimental information to class members
+// Macros for assigning the deprecated/experimental marks to class members in overview.
+
#define DEPRECATED_DOC_TAG \
+ class_desc->push_font(theme_cache.doc_bold_font); \
class_desc->push_color(get_theme_color(SNAME("error_color"), EditorStringName(Editor))); \
Ref<Texture2D> error_icon = get_editor_theme_icon(SNAME("StatusError")); \
- 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->add_text(String::chr(160) + TTR("Deprecated")); \
+ class_desc->pop(); \
class_desc->pop();
#define EXPERIMENTAL_DOC_TAG \
+ class_desc->push_font(theme_cache.doc_bold_font); \
class_desc->push_color(get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); \
Ref<Texture2D> warning_icon = get_editor_theme_icon(SNAME("NodeWarning")); \
- 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->add_text(String::chr(160) + TTR("Experimental")); \
+ class_desc->pop(); \
class_desc->pop();
+// Macros for displaying the deprecated/experimental info in class member descriptions.
+
+#define DEPRECATED_DOC_MSG(m_message, m_default_message) \
+ Ref<Texture2D> error_icon = get_editor_theme_icon(SNAME("StatusError")); \
+ class_desc->add_image(error_icon, error_icon->get_width(), error_icon->get_height()); \
+ class_desc->add_text(" "); \
+ class_desc->push_color(get_theme_color(SNAME("error_color"), EditorStringName(Editor))); \
+ class_desc->push_font(theme_cache.doc_bold_font); \
+ class_desc->add_text(TTR("Deprecated:")); \
+ class_desc->pop(); \
+ class_desc->pop(); \
+ class_desc->add_text(" "); \
+ if ((m_message).is_empty()) { \
+ class_desc->add_text(m_default_message); \
+ } else { \
+ _add_text(m_message); \
+ }
+
+#define EXPERIMENTAL_DOC_MSG(m_message, m_default_message) \
+ Ref<Texture2D> warning_icon = get_editor_theme_icon(SNAME("NodeWarning")); \
+ class_desc->add_image(warning_icon, warning_icon->get_width(), warning_icon->get_height()); \
+ class_desc->add_text(" "); \
+ class_desc->push_color(get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); \
+ class_desc->push_font(theme_cache.doc_bold_font); \
+ class_desc->add_text(TTR("Experimental:")); \
+ class_desc->pop(); \
+ class_desc->pop(); \
+ class_desc->add_text(" "); \
+ if ((m_message).is_empty()) { \
+ class_desc->add_text(m_default_message); \
+ } else { \
+ _add_text(m_message); \
+ }
+
void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview, bool p_override) {
if (p_override) {
method_line[p_method.name] = class_desc->get_paragraph_count() - 2; // Gets overridden if description.
@@ -439,7 +476,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
_add_type(p_method.return_type, p_method.return_enum, p_method.return_is_bitfield);
if (p_overview) {
- class_desc->pop(); // align
+ class_desc->pop(); // paragraph
class_desc->pop(); // cell
class_desc->push_cell();
} else {
@@ -451,8 +488,8 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
}
class_desc->push_color(theme_cache.headline_color);
- _add_text(p_method.name);
- class_desc->pop();
+ class_desc->add_text(p_method.name);
+ class_desc->pop(); // color
if (p_overview && !p_method.description.strip_edges().is_empty()) {
class_desc->pop(); // meta
@@ -460,7 +497,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text("(");
- class_desc->pop();
+ class_desc->pop(); // color
for (int j = 0; j < p_method.arguments.size(); j++) {
class_desc->push_color(theme_cache.text_color);
@@ -468,35 +505,38 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
class_desc->add_text(", ");
}
- _add_text(p_method.arguments[j].name);
+ class_desc->add_text(p_method.arguments[j].name);
class_desc->add_text(": ");
_add_type(p_method.arguments[j].type, p_method.arguments[j].enumeration, p_method.arguments[j].is_bitfield);
+
if (!p_method.arguments[j].default_value.is_empty()) {
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(" = ");
- class_desc->pop();
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.value_color);
class_desc->add_text(_fix_constant(p_method.arguments[j].default_value));
- class_desc->pop();
+ class_desc->pop(); // color
}
- class_desc->pop();
+ class_desc->pop(); // color
}
if (is_vararg) {
class_desc->push_color(theme_cache.text_color);
- if (p_method.arguments.size()) {
+ if (!p_method.arguments.is_empty()) {
class_desc->add_text(", ");
}
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text("...");
- class_desc->pop();
- class_desc->pop();
+ class_desc->pop(); // color
}
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(")");
- class_desc->pop();
+ class_desc->pop(); // color
if (!p_method.qualifiers.is_empty()) {
class_desc->push_color(theme_cache.qualifier_color);
@@ -517,23 +557,26 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
if (!hint.is_empty()) {
class_desc->push_hint(hint);
class_desc->add_text(qualifier);
- class_desc->pop();
+ class_desc->pop(); // hint
} else {
class_desc->add_text(qualifier);
}
}
- class_desc->pop();
- }
- if (p_method.is_deprecated) {
- DEPRECATED_DOC_TAG;
- }
-
- if (p_method.is_experimental) {
- EXPERIMENTAL_DOC_TAG;
+ class_desc->pop(); // color
}
if (p_overview) {
+ if (p_method.is_deprecated) {
+ class_desc->add_text(" ");
+ DEPRECATED_DOC_TAG;
+ }
+
+ if (p_method.is_experimental) {
+ class_desc->add_text(" ");
+ EXPERIMENTAL_DOC_TAG;
+ }
+
class_desc->pop(); // cell
}
}
@@ -549,20 +592,20 @@ void EditorHelp::_push_normal_font() {
}
void EditorHelp::_pop_normal_font() {
- class_desc->pop();
- class_desc->pop();
+ class_desc->pop(); // font_size
+ class_desc->pop(); // font
}
void EditorHelp::_push_title_font() {
- class_desc->push_color(theme_cache.title_color);
class_desc->push_font(theme_cache.doc_title_font);
class_desc->push_font_size(theme_cache.doc_title_font_size);
+ class_desc->push_color(theme_cache.title_color);
}
void EditorHelp::_pop_title_font() {
- class_desc->pop();
- class_desc->pop();
- class_desc->pop();
+ class_desc->pop(); // color
+ class_desc->pop(); // font_size
+ class_desc->pop(); // font
}
void EditorHelp::_push_code_font() {
@@ -571,8 +614,8 @@ void EditorHelp::_push_code_font() {
}
void EditorHelp::_pop_code_font() {
- class_desc->pop();
- class_desc->pop();
+ class_desc->pop(); // font_size
+ class_desc->pop(); // font
}
Error EditorHelp::_goto_desc(const String &p_class) {
@@ -596,11 +639,27 @@ Error EditorHelp::_goto_desc(const String &p_class) {
return OK;
}
-void EditorHelp::_update_method_list(const Vector<DocData::MethodDoc> p_methods, MethodType p_method_type) {
+void EditorHelp::_update_method_list(MethodType p_method_type, const Vector<DocData::MethodDoc> &p_methods) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
+ static const char *titles_by_type[METHOD_TYPE_MAX] = {
+ TTRC("Methods"),
+ TTRC("Constructors"),
+ TTRC("Operators"),
+ };
+ const String title = TTRGET(titles_by_type[p_method_type]);
+
+ section_line.push_back(Pair<String, int>(title, class_desc->get_paragraph_count() - 2));
+ _push_title_font();
+ class_desc->add_text(title);
+ _pop_title_font();
+
+ class_desc->add_newline();
class_desc->add_newline();
- _push_code_font();
class_desc->push_indent(1);
+ _push_code_font();
class_desc->push_table(2);
class_desc->set_table_column_expand(1, true);
@@ -650,18 +709,30 @@ void EditorHelp::_update_method_list(const Vector<DocData::MethodDoc> p_methods,
}
class_desc->pop(); // table
- class_desc->pop();
_pop_code_font();
-
- class_desc->add_newline();
- class_desc->add_newline();
+ class_desc->pop(); // indent
}
-void EditorHelp::_update_method_descriptions(const DocData::ClassDoc p_classdoc, const Vector<DocData::MethodDoc> p_methods, MethodType p_method_type) {
- String link_color_text = theme_cache.title_color.to_html(false);
+void EditorHelp::_update_method_descriptions(const DocData::ClassDoc &p_classdoc, MethodType p_method_type, const Vector<DocData::MethodDoc> &p_methods) {
+#define DTR_DOC(m_string) (p_classdoc.is_script_doc ? (m_string) : DTR(m_string))
class_desc->add_newline();
class_desc->add_newline();
+ class_desc->add_newline();
+
+ static const char *titles_by_type[METHOD_TYPE_MAX] = {
+ TTRC("Method Descriptions"),
+ TTRC("Constructor Descriptions"),
+ TTRC("Operator Descriptions"),
+ };
+ const String title = TTRGET(titles_by_type[p_method_type]);
+
+ section_line.push_back(Pair<String, int>(title, class_desc->get_paragraph_count() - 2));
+ _push_title_font();
+ class_desc->add_text(title);
+ _pop_title_font();
+
+ String link_color_text = theme_cache.title_color.to_html(false);
for (int pass = 0; pass < 2; pass++) {
Vector<DocData::MethodDoc> methods_filtered;
@@ -674,6 +745,10 @@ void EditorHelp::_update_method_descriptions(const DocData::ClassDoc p_classdoc,
}
for (int i = 0; i < methods_filtered.size(); i++) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+ class_desc->add_newline();
+
_push_code_font();
// For constructors always point to the first one.
_add_method(methods_filtered[i], false, (p_method_type != METHOD_TYPE_CONSTRUCTOR || i == 0));
@@ -682,17 +757,43 @@ void EditorHelp::_update_method_descriptions(const DocData::ClassDoc p_classdoc,
class_desc->add_newline();
class_desc->add_newline();
- class_desc->push_color(theme_cache.text_color);
- _push_normal_font();
class_desc->push_indent(1);
- if (methods_filtered[i].errors_returned.size()) {
- class_desc->append_text(TTR("Error codes returned:"));
+ _push_normal_font();
+ class_desc->push_color(theme_cache.text_color);
+
+ if (methods_filtered[i].is_deprecated) {
+ static const char *messages_by_type[METHOD_TYPE_MAX] = {
+ TTRC("This method may be changed or removed in future versions."),
+ TTRC("This constructor may be changed or removed in future versions."),
+ TTRC("This operator may be changed or removed in future versions."),
+ };
+ DEPRECATED_DOC_MSG(DTR_DOC(methods_filtered[i].deprecated_message), TTRGET(messages_by_type[p_method_type]));
+
+ class_desc->add_newline();
+ class_desc->add_newline();
+ }
+
+ if (methods_filtered[i].is_experimental) {
+ static const char *messages_by_type[METHOD_TYPE_MAX] = {
+ TTRC("This method may be changed or removed in future versions."),
+ TTRC("This constructor may be changed or removed in future versions."),
+ TTRC("This operator may be changed or removed in future versions."),
+ };
+ EXPERIMENTAL_DOC_MSG(DTR_DOC(methods_filtered[i].experimental_message), TTRGET(messages_by_type[p_method_type]));
+
+ class_desc->add_newline();
+ class_desc->add_newline();
+ }
+
+ if (!methods_filtered[i].errors_returned.is_empty()) {
+ class_desc->add_text(TTR("Error codes returned:"));
class_desc->add_newline();
class_desc->push_list(0, RichTextLabel::LIST_DOTS, false);
for (int j = 0; j < methods_filtered[i].errors_returned.size(); j++) {
if (j > 0) {
class_desc->add_newline();
}
+
int val = methods_filtered[i].errors_returned[j];
String text = itos(val);
for (int k = 0; k < CoreConstants::get_global_constant_count(); k++) {
@@ -702,21 +803,20 @@ void EditorHelp::_update_method_descriptions(const DocData::ClassDoc p_classdoc,
}
}
- class_desc->push_bold();
- class_desc->append_text(text);
- class_desc->pop();
+ class_desc->push_font(theme_cache.doc_bold_font);
+ class_desc->add_text(text);
+ class_desc->pop(); // font
}
- class_desc->pop();
+ class_desc->pop(); // list
+
class_desc->add_newline();
class_desc->add_newline();
}
- if (!methods_filtered[i].description.strip_edges().is_empty()) {
- _add_text(DTR(methods_filtered[i].description));
- } else {
- class_desc->add_image(get_editor_theme_icon(SNAME("Error")));
- class_desc->add_text(" ");
- class_desc->push_color(theme_cache.comment_color);
+ const String descr = DTR_DOC(methods_filtered[i].description).strip_edges();
+ if (!descr.is_empty()) {
+ _add_text(descr);
+ } else {
String message;
if (p_classdoc.is_script_doc) {
static const char *messages_by_type[METHOD_TYPE_MAX] = {
@@ -733,19 +833,21 @@ void EditorHelp::_update_method_descriptions(const DocData::ClassDoc p_classdoc,
};
message = TTRGET(messages_by_type[p_method_type]).replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text);
}
+
+ class_desc->add_image(get_editor_theme_icon(SNAME("Error")));
+ class_desc->add_text(" ");
+ class_desc->push_color(theme_cache.comment_color);
class_desc->append_text(message);
- class_desc->pop();
+ class_desc->pop(); // color
}
- class_desc->pop();
+ class_desc->pop(); // color
_pop_normal_font();
- class_desc->pop();
-
- class_desc->add_newline();
- class_desc->add_newline();
- class_desc->add_newline();
+ class_desc->pop(); // indent
}
}
+
+#undef DTR_DOC
}
void EditorHelp::_update_doc() {
@@ -758,46 +860,52 @@ void EditorHelp::_update_doc() {
class_desc->clear();
method_line.clear();
section_line.clear();
+ section_line.push_back(Pair<String, int>(TTR("Top"), 0));
String link_color_text = theme_cache.title_color.to_html(false);
DocData::ClassDoc cd = doc->class_list[edited_class]; // Make a copy, so we can sort without worrying.
+#define DTR_DOC(m_string) (cd.is_script_doc ? (m_string) : DTR(m_string))
+
// Class name
- section_line.push_back(Pair<String, int>(TTR("Top"), 0));
+
_push_title_font();
+
class_desc->add_text(TTR("Class:") + " ");
_add_type_icon(edited_class, theme_cache.doc_title_font_size, "Object");
class_desc->add_text(" ");
+
class_desc->push_color(theme_cache.headline_color);
- _add_text(edited_class);
+ class_desc->add_text(edited_class);
class_desc->pop(); // color
+
_pop_title_font();
if (cd.is_deprecated) {
- class_desc->add_text(" ");
- Ref<Texture2D> error_icon = get_editor_theme_icon(SNAME("StatusError"));
- class_desc->add_image(error_icon, error_icon->get_width(), error_icon->get_height());
+ class_desc->add_newline();
+ DEPRECATED_DOC_MSG(DTR_DOC(cd.deprecated_message), TTR("This class may be changed or removed in future versions."));
}
+
if (cd.is_experimental) {
- class_desc->add_text(" ");
- Ref<Texture2D> warning_icon = get_editor_theme_icon(SNAME("NodeWarning"));
- class_desc->add_image(warning_icon, warning_icon->get_width(), warning_icon->get_height());
+ class_desc->add_newline();
+ EXPERIMENTAL_DOC_MSG(DTR_DOC(cd.experimental_message), TTR("This class may be changed or removed in future versions."));
}
- class_desc->add_newline();
-
- const String non_breaking_space = String::chr(160);
// Inheritance tree
+ const String non_breaking_space = String::chr(160);
+
// Ascendents
if (!cd.inherits.is_empty()) {
- class_desc->push_color(theme_cache.title_color);
+ class_desc->add_newline();
+
_push_normal_font();
+ class_desc->push_color(theme_cache.title_color);
+
class_desc->add_text(TTR("Inherits:") + " ");
String inherits = cd.inherits;
-
while (!inherits.is_empty()) {
_add_type_icon(inherits, theme_cache.doc_font_size, "ArrowRight");
class_desc->add_text(non_breaking_space); // Otherwise icon borrows hyperlink from _add_type().
@@ -810,13 +918,14 @@ void EditorHelp::_update_doc() {
}
}
+ class_desc->pop(); // color
_pop_normal_font();
- class_desc->pop();
- class_desc->add_newline();
}
// Descendants
if ((cd.is_script_doc || ClassDB::class_exists(cd.name)) && doc->inheriting.has(cd.name)) {
+ class_desc->add_newline();
+
_push_normal_font();
class_desc->push_color(theme_cache.title_color);
class_desc->add_text(TTR("Inherited by:") + " ");
@@ -830,58 +939,40 @@ void EditorHelp::_update_doc() {
class_desc->add_text(non_breaking_space); // Otherwise icon borrows hyperlink from _add_type().
_add_type(itr->get());
}
- _pop_normal_font();
-
- class_desc->pop();
- class_desc->add_newline();
- }
-
- // Note if deprecated.
- if (cd.is_deprecated) {
- Ref<Texture2D> error_icon = get_editor_theme_icon(SNAME("StatusError"));
- class_desc->push_color(get_theme_color(SNAME("error_color"), EditorStringName(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_editor_theme_icon(SNAME("NodeWarning"));
- class_desc->push_color(get_theme_color(SNAME("warning_color"), EditorStringName(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->pop(); // color
+ _pop_normal_font();
}
bool has_description = false;
- class_desc->add_newline();
- class_desc->add_newline();
-
// Brief description
- if (!cd.brief_description.strip_edges().is_empty()) {
+ const String brief_class_descr = DTR_DOC(cd.brief_description).strip_edges();
+ if (!brief_class_descr.is_empty()) {
has_description = true;
- class_desc->push_color(theme_cache.text_color);
- class_desc->push_font(theme_cache.doc_bold_font);
- class_desc->push_indent(1);
- _add_text(DTR(cd.brief_description));
- class_desc->pop();
- class_desc->pop();
- class_desc->pop();
-
- class_desc->add_newline();
class_desc->add_newline();
class_desc->add_newline();
+
+ class_desc->push_indent(1);
+ class_desc->push_font(theme_cache.doc_bold_font);
+ class_desc->push_color(theme_cache.text_color);
+
+ _add_text(brief_class_descr);
+
+ class_desc->pop(); // color
+ class_desc->pop(); // font
+ class_desc->pop(); // indent
}
// Class description
- if (!cd.description.strip_edges().is_empty()) {
+ const String class_descr = DTR_DOC(cd.description).strip_edges();
+ if (!class_descr.is_empty()) {
has_description = true;
+ class_desc->add_newline();
+ class_desc->add_newline();
+
section_line.push_back(Pair<String, int>(TTR("Description"), class_desc->get_paragraph_count() - 2));
description_line = class_desc->get_paragraph_count() - 2;
_push_title_font();
@@ -890,53 +981,64 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
class_desc->add_newline();
- class_desc->push_color(theme_cache.text_color);
- _push_normal_font();
+
class_desc->push_indent(1);
- _add_text(DTR(cd.description));
- class_desc->pop();
+ _push_normal_font();
+ class_desc->push_color(theme_cache.text_color);
+
+ _add_text(class_descr);
+
+ class_desc->pop(); // color
_pop_normal_font();
- class_desc->pop();
+ class_desc->pop(); // indent
+ }
+ if (!has_description) {
class_desc->add_newline();
class_desc->add_newline();
- class_desc->add_newline();
- }
- if (!has_description) {
+ class_desc->push_indent(1);
+ _push_normal_font();
+
class_desc->add_image(get_editor_theme_icon(SNAME("Error")));
class_desc->add_text(" ");
- class_desc->push_color(theme_cache.comment_color);
+ class_desc->push_color(theme_cache.comment_color);
if (cd.is_script_doc) {
- class_desc->append_text(TTR("There is currently no description for this class."));
+ class_desc->add_text(TTR("There is currently no description for this class."));
} else {
class_desc->append_text(TTR("There is currently no description for this class. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text));
}
+ class_desc->pop(); // color
- class_desc->add_newline();
- class_desc->add_newline();
+ _pop_normal_font();
+ class_desc->pop(); // indent
}
#ifdef MODULE_MONO_ENABLED
if (classes_with_csharp_differences.has(cd.name)) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
const String &csharp_differences_url = vformat("%s/tutorials/scripting/c_sharp/c_sharp_differences.html", VERSION_DOCS_URL);
- class_desc->push_color(theme_cache.text_color);
- _push_normal_font();
class_desc->push_indent(1);
- _add_text("[b]" + TTR("Note:") + "[/b] " + vformat(TTR("There are notable differences when using this API with C#. See [url=%s]C# API differences to GDScript[/url] for more information."), csharp_differences_url));
- class_desc->pop();
- _pop_normal_font();
- class_desc->pop();
+ _push_normal_font();
+ class_desc->push_color(theme_cache.text_color);
- class_desc->add_newline();
- class_desc->add_newline();
+ class_desc->append_text("[b]" + TTR("Note:") + "[/b] " + vformat(TTR("There are notable differences when using this API with C#. See [url=%s]C# API differences to GDScript[/url] for more information."), csharp_differences_url));
+
+ class_desc->pop(); // color
+ _pop_normal_font();
+ class_desc->pop(); // indent
}
#endif
// Online tutorials
- if (cd.tutorials.size()) {
+ if (!cd.tutorials.is_empty()) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
_push_title_font();
class_desc->add_text(TTR("Online Tutorials"));
_pop_title_font();
@@ -945,26 +1047,29 @@ void EditorHelp::_update_doc() {
class_desc->push_indent(1);
_push_code_font();
+ class_desc->push_color(theme_cache.symbol_color);
for (int i = 0; i < cd.tutorials.size(); i++) {
- const String link = DTR(cd.tutorials[i].link);
- String linktxt = (cd.tutorials[i].title.is_empty()) ? link : DTR(cd.tutorials[i].title);
- const int seppos = linktxt.find("//");
- if (seppos != -1) {
- linktxt = link.substr(seppos + 2);
+ const String link = DTR_DOC(cd.tutorials[i].link).strip_edges();
+
+ String link_text = DTR_DOC(cd.tutorials[i].title).strip_edges();
+ if (link_text.is_empty()) {
+ const int sep_pos = link.find("//");
+ if (sep_pos >= 0) {
+ link_text = link.substr(sep_pos + 2);
+ } else {
+ link_text = link;
+ }
}
- class_desc->push_color(theme_cache.symbol_color);
- class_desc->append_text("[url=" + link + "]" + linktxt + "[/url]");
- class_desc->pop();
class_desc->add_newline();
+ _add_bulletpoint();
+ class_desc->append_text("[url=" + link + "]" + link_text + "[/url]");
}
+ class_desc->pop(); // color
_pop_code_font();
- class_desc->pop();
-
- class_desc->add_newline();
- class_desc->add_newline();
+ class_desc->pop(); // indent
}
// Properties overview
@@ -984,15 +1089,19 @@ void EditorHelp::_update_doc() {
}
if (has_properties) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
section_line.push_back(Pair<String, int>(TTR("Properties"), class_desc->get_paragraph_count() - 2));
_push_title_font();
class_desc->add_text(TTR("Properties"));
_pop_title_font();
class_desc->add_newline();
+ class_desc->add_newline();
- _push_code_font();
class_desc->push_indent(1);
+ _push_code_font();
class_desc->push_table(4);
class_desc->set_table_column_expand(1, true);
@@ -1006,29 +1115,29 @@ void EditorHelp::_update_doc() {
if (cd.properties[i].name.begins_with("_") && cd.properties[i].description.strip_edges().is_empty()) {
continue;
}
+
if (is_generating_overridden_properties && !cd.properties[i].overridden) {
is_generating_overridden_properties = false;
// No need for the extra spacing when there's no overridden property.
if (overridden_property_exists) {
class_desc->push_cell();
- class_desc->pop();
+ class_desc->pop(); // cell
class_desc->push_cell();
- class_desc->pop();
+ class_desc->pop(); // cell
class_desc->push_cell();
- class_desc->pop();
+ class_desc->pop(); // cell
class_desc->push_cell();
- class_desc->pop();
+ class_desc->pop(); // cell
}
}
- property_line[cd.properties[i].name] = class_desc->get_paragraph_count() - 2; //gets overridden if description
+
+ property_line[cd.properties[i].name] = class_desc->get_paragraph_count() - 2; // Gets overridden if description.
// Property type.
class_desc->push_cell();
class_desc->push_paragraph(HORIZONTAL_ALIGNMENT_RIGHT, Control::TEXT_DIRECTION_AUTO, "");
- _push_code_font();
_add_type(cd.properties[i].type, cd.properties[i].enumeration, cd.properties[i].is_bitfield);
- _pop_code_font();
- class_desc->pop();
+ class_desc->pop(); // paragraph
class_desc->pop(); // cell
bool describe = false;
@@ -1052,69 +1161,60 @@ void EditorHelp::_update_doc() {
// Property name.
class_desc->push_cell();
- _push_code_font();
class_desc->push_color(theme_cache.headline_color);
if (describe) {
class_desc->push_meta("@member " + cd.properties[i].name);
}
- _add_text(cd.properties[i].name);
+ class_desc->add_text(cd.properties[i].name);
if (describe) {
- class_desc->pop();
+ class_desc->pop(); // meta
}
- class_desc->pop();
- _pop_code_font();
+ class_desc->pop(); // color
class_desc->pop(); // cell
// Property value.
class_desc->push_cell();
- _push_code_font();
if (!cd.properties[i].default_value.is_empty()) {
if (cd.properties[i].overridden) {
class_desc->push_color(theme_cache.override_color);
- class_desc->add_text(" [");
- class_desc->push_meta("@member " + cd.properties[i].overrides + "." + cd.properties[i].name);
- _add_text(vformat(TTR("overrides %s:"), cd.properties[i].overrides));
- class_desc->pop();
+ class_desc->add_text("[");
+ const String link = vformat("[url=@member %s.%s]%s[/url]", cd.properties[i].overrides, cd.properties[i].name, cd.properties[i].overrides);
+ class_desc->append_text(vformat(TTR("overrides %s:"), link));
class_desc->add_text(" " + _fix_constant(cd.properties[i].default_value) + "]");
+ class_desc->pop(); // color
overridden_property_exists = true;
} else {
class_desc->push_color(theme_cache.symbol_color);
- class_desc->add_text(" [" + TTR("default:") + " ");
+ class_desc->add_text("[" + TTR("default:") + " ");
+ class_desc->pop(); // color
class_desc->push_color(theme_cache.value_color);
class_desc->add_text(_fix_constant(cd.properties[i].default_value));
- class_desc->pop();
+ class_desc->pop(); // color
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text("]");
- class_desc->pop();
+ class_desc->pop(); // color
}
- class_desc->pop(); // color
- }
-
- if (cd.properties[i].is_deprecated) {
- DEPRECATED_DOC_TAG;
}
- if (cd.properties[i].is_experimental) {
- EXPERIMENTAL_DOC_TAG;
- }
-
- _pop_code_font();
class_desc->pop(); // cell
- // Property setters and getters.
+ // Property setter/getter and deprecated/experimental marks.
class_desc->push_cell();
- _push_code_font();
+
+ bool has_prev_text = false;
if (cd.is_script_doc && (!cd.properties[i].setter.is_empty() || !cd.properties[i].getter.is_empty())) {
+ has_prev_text = true;
+
class_desc->push_color(theme_cache.symbol_color);
- class_desc->add_text(" [" + TTR("property:") + " ");
+ class_desc->add_text("[" + TTR("property:") + " ");
class_desc->pop(); // color
if (!cd.properties[i].setter.is_empty()) {
@@ -1138,16 +1238,28 @@ void EditorHelp::_update_doc() {
class_desc->pop(); // color
}
- _pop_code_font();
+ if (cd.properties[i].is_deprecated) {
+ if (has_prev_text) {
+ class_desc->add_text(" ");
+ }
+ has_prev_text = true;
+ DEPRECATED_DOC_TAG;
+ }
+
+ if (cd.properties[i].is_experimental) {
+ if (has_prev_text) {
+ class_desc->add_text(" ");
+ }
+ has_prev_text = true;
+ EXPERIMENTAL_DOC_TAG;
+ }
+
class_desc->pop(); // cell
}
class_desc->pop(); // table
- class_desc->pop();
_pop_code_font();
-
- class_desc->add_newline();
- class_desc->add_newline();
+ class_desc->pop(); // indent
}
// Methods overview
@@ -1172,53 +1284,33 @@ void EditorHelp::_update_doc() {
if (sort_methods) {
cd.constructors.sort();
}
-
- section_line.push_back(Pair<String, int>(TTR("Constructors"), class_desc->get_paragraph_count() - 2));
- _push_title_font();
- class_desc->add_text(TTR("Constructors"));
- _pop_title_font();
-
- _update_method_list(cd.constructors, METHOD_TYPE_CONSTRUCTOR);
+ _update_method_list(METHOD_TYPE_CONSTRUCTOR, cd.constructors);
}
if (!methods.is_empty()) {
if (sort_methods) {
methods.sort();
}
-
- section_line.push_back(Pair<String, int>(TTR("Methods"), class_desc->get_paragraph_count() - 2));
- _push_title_font();
- class_desc->add_text(TTR("Methods"));
- _pop_title_font();
-
- _update_method_list(methods, METHOD_TYPE_METHOD);
+ _update_method_list(METHOD_TYPE_METHOD, methods);
}
if (!cd.operators.is_empty()) {
if (sort_methods) {
cd.operators.sort();
}
-
- section_line.push_back(Pair<String, int>(TTR("Operators"), class_desc->get_paragraph_count() - 2));
- _push_title_font();
- class_desc->add_text(TTR("Operators"));
- _pop_title_font();
-
- _update_method_list(cd.operators, METHOD_TYPE_OPERATOR);
+ _update_method_list(METHOD_TYPE_OPERATOR, cd.operators);
}
// Theme properties
if (!cd.theme_properties.is_empty()) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
section_line.push_back(Pair<String, int>(TTR("Theme Properties"), class_desc->get_paragraph_count() - 2));
_push_title_font();
class_desc->add_text(TTR("Theme Properties"));
_pop_title_font();
- class_desc->add_newline();
- class_desc->add_newline();
-
- class_desc->push_indent(1);
-
String theme_data_type;
HashMap<String, String> data_type_names;
data_type_names["color"] = TTR("Colors");
@@ -1229,23 +1321,32 @@ void EditorHelp::_update_doc() {
data_type_names["style"] = TTR("Styles");
for (int i = 0; i < cd.theme_properties.size(); i++) {
- theme_property_line[cd.theme_properties[i].name] = class_desc->get_paragraph_count() - 2; // Gets overridden if description.
-
if (theme_data_type != cd.theme_properties[i].data_type) {
theme_data_type = cd.theme_properties[i].data_type;
+ class_desc->add_newline();
+ class_desc->add_newline();
+
+ class_desc->push_indent(1);
_push_title_font();
+
if (data_type_names.has(theme_data_type)) {
class_desc->add_text(data_type_names[theme_data_type]);
} else {
- class_desc->add_text("");
+ class_desc->add_text(theme_data_type);
}
- _pop_title_font();
- class_desc->add_newline();
- class_desc->add_newline();
+ _pop_title_font();
+ class_desc->pop(); // indent
}
+ class_desc->add_newline();
+ class_desc->add_newline();
+
+ theme_property_line[cd.theme_properties[i].name] = class_desc->get_paragraph_count() - 2; // Gets overridden if description.
+
+ class_desc->push_indent(1);
+
// Theme item header.
_push_code_font();
_add_bulletpoint();
@@ -1256,41 +1357,52 @@ void EditorHelp::_update_doc() {
// Theme item name.
class_desc->push_color(theme_cache.headline_color);
class_desc->add_text(" ");
- _add_text(cd.theme_properties[i].name);
- class_desc->pop();
+ class_desc->add_text(cd.theme_properties[i].name);
+ class_desc->pop(); // color
// Theme item default value.
if (!cd.theme_properties[i].default_value.is_empty()) {
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(" [" + TTR("default:") + " ");
- class_desc->pop();
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.value_color);
class_desc->add_text(_fix_constant(cd.theme_properties[i].default_value));
- class_desc->pop();
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text("]");
- class_desc->pop();
+ class_desc->pop(); // color
}
_pop_code_font();
// Theme item description.
- if (!cd.theme_properties[i].description.strip_edges().is_empty()) {
+ class_desc->push_indent(1);
+ _push_normal_font();
+ class_desc->push_color(theme_cache.comment_color);
+
+ const String descr = DTR_DOC(cd.theme_properties[i].description).strip_edges();
+ if (!descr.is_empty()) {
+ _add_text(descr);
+ } else {
+ class_desc->add_image(get_editor_theme_icon(SNAME("Error")));
+ class_desc->add_text(" ");
class_desc->push_color(theme_cache.comment_color);
- _push_normal_font();
- class_desc->push_indent(1);
- _add_text(DTR(cd.theme_properties[i].description));
- class_desc->pop(); // indent
- _pop_normal_font();
+ if (cd.is_script_doc) {
+ class_desc->add_text(TTR("There is currently no description for this theme property."));
+ } else {
+ class_desc->append_text(TTR("There is currently no description for this theme property. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text));
+ }
class_desc->pop(); // color
}
- class_desc->add_newline();
- class_desc->add_newline();
- }
+ class_desc->pop(); // color
+ _pop_normal_font();
+ class_desc->pop(); // indent
- class_desc->pop();
- class_desc->add_newline();
+ class_desc->pop(); // indent
+ }
}
// Signals
@@ -1299,76 +1411,111 @@ void EditorHelp::_update_doc() {
cd.signals.sort();
}
+ class_desc->add_newline();
+ class_desc->add_newline();
+
section_line.push_back(Pair<String, int>(TTR("Signals"), class_desc->get_paragraph_count() - 2));
_push_title_font();
class_desc->add_text(TTR("Signals"));
_pop_title_font();
- class_desc->add_newline();
- class_desc->add_newline();
-
- class_desc->push_indent(1);
-
for (int i = 0; i < cd.signals.size(); i++) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
signal_line[cd.signals[i].name] = class_desc->get_paragraph_count() - 2; // Gets overridden if description.
+ class_desc->push_indent(1);
+
+ // Signal header.
_push_code_font();
_add_bulletpoint();
class_desc->push_color(theme_cache.headline_color);
- _add_text(cd.signals[i].name);
- class_desc->pop();
+ class_desc->add_text(cd.signals[i].name);
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text("(");
- class_desc->pop();
+ class_desc->pop(); // color
+
for (int j = 0; j < cd.signals[i].arguments.size(); j++) {
class_desc->push_color(theme_cache.text_color);
+
if (j > 0) {
class_desc->add_text(", ");
}
- _add_text(cd.signals[i].arguments[j].name);
+ class_desc->add_text(cd.signals[i].arguments[j].name);
class_desc->add_text(": ");
_add_type(cd.signals[i].arguments[j].type, cd.signals[i].arguments[j].enumeration, cd.signals[i].arguments[j].is_bitfield);
+
+ // Signals currently do not support default argument values, neither the core nor GDScript.
+ // This code is just for completeness.
if (!cd.signals[i].arguments[j].default_value.is_empty()) {
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(" = ");
- class_desc->pop();
- _add_text(cd.signals[i].arguments[j].default_value);
+ class_desc->pop(); // color
+
+ class_desc->push_color(theme_cache.value_color);
+ class_desc->add_text(_fix_constant(cd.signals[i].arguments[j].default_value));
+ class_desc->pop(); // color
}
- class_desc->pop();
+ class_desc->pop(); // color
}
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(")");
+ class_desc->pop(); // color
+
+ _pop_code_font();
+
+ class_desc->add_newline();
+
+ // Signal description.
+ class_desc->push_indent(1);
+ _push_normal_font();
+ class_desc->push_color(theme_cache.comment_color);
+
+ const String descr = DTR_DOC(cd.signals[i].description).strip_edges();
+ const bool is_multiline = descr.find_char('\n') > 0;
if (cd.signals[i].is_deprecated) {
- DEPRECATED_DOC_TAG;
+ DEPRECATED_DOC_MSG(DTR_DOC(cd.signals[i].deprecated_message), TTR("This signal may be changed or removed in future versions."));
+ class_desc->add_newline();
+ if (is_multiline) {
+ class_desc->add_newline();
+ }
}
if (cd.signals[i].is_experimental) {
- EXPERIMENTAL_DOC_TAG;
+ EXPERIMENTAL_DOC_MSG(DTR_DOC(cd.signals[i].experimental_message), TTR("This signal may be changed or removed in future versions."));
+ class_desc->add_newline();
+ if (is_multiline) {
+ class_desc->add_newline();
+ }
}
- class_desc->pop();
- _pop_code_font();
-
- if (!cd.signals[i].description.strip_edges().is_empty()) {
+ if (!descr.is_empty()) {
+ _add_text(descr);
+ } else {
+ class_desc->add_image(get_editor_theme_icon(SNAME("Error")));
+ class_desc->add_text(" ");
class_desc->push_color(theme_cache.comment_color);
- _push_normal_font();
- class_desc->push_indent(1);
- _add_text(DTR(cd.signals[i].description));
- class_desc->pop(); // indent
- _pop_normal_font();
+ if (cd.is_script_doc) {
+ class_desc->add_text(TTR("There is currently no description for this signal."));
+ } else {
+ class_desc->append_text(TTR("There is currently no description for this signal. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text));
+ }
class_desc->pop(); // color
}
- class_desc->add_newline();
- class_desc->add_newline();
- }
+ class_desc->pop(); // color
+ _pop_normal_font();
+ class_desc->pop(); // indent
- class_desc->pop();
- class_desc->add_newline();
+ class_desc->pop(); // indent
+ }
}
// Constants and enums
@@ -1404,13 +1551,13 @@ void EditorHelp::_update_doc() {
}
}
if (has_enums) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
section_line.push_back(Pair<String, int>(TTR("Enumerations"), class_desc->get_paragraph_count() - 2));
_push_title_font();
class_desc->add_text(TTR("Enumerations"));
_pop_title_font();
- class_desc->push_indent(1);
-
- class_desc->add_newline();
for (KeyValue<String, Vector<DocData::ConstantDoc>> &E : enums) {
String key = E.key;
@@ -1423,130 +1570,196 @@ void EditorHelp::_update_doc() {
}
}
- enum_line[E.key] = class_desc->get_paragraph_count() - 2;
+ class_desc->add_newline();
+ class_desc->add_newline();
+
+ // Enum header.
_push_code_font();
+ enum_line[E.key] = class_desc->get_paragraph_count() - 2;
class_desc->push_color(theme_cache.title_color);
if (E.value.size() && E.value[0].is_bitfield) {
class_desc->add_text("flags ");
} else {
class_desc->add_text("enum ");
}
- class_desc->pop();
+ class_desc->pop(); // color
class_desc->push_color(theme_cache.headline_color);
class_desc->add_text(key);
- class_desc->pop();
+ class_desc->pop(); // color
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(":");
- class_desc->pop();
-
- if (cd.enums[key].is_deprecated) {
- DEPRECATED_DOC_TAG;
- }
- if (cd.enums[key].is_experimental) {
- EXPERIMENTAL_DOC_TAG;
- }
+ class_desc->pop(); // color
_pop_code_font();
- class_desc->add_newline();
- class_desc->add_newline();
-
// Enum description.
- if (key != "@unnamed_enums" && cd.enums.has(key) && !cd.enums[key].description.strip_edges().is_empty()) {
- class_desc->push_color(theme_cache.text_color);
- _push_normal_font();
- class_desc->push_indent(1);
- _add_text(cd.enums[key].description);
- class_desc->pop();
- _pop_normal_font();
- class_desc->pop();
+ if (key != "@unnamed_enums" && cd.enums.has(key)) {
+ const String descr = DTR_DOC(cd.enums[key].description).strip_edges();
+ const bool is_multiline = descr.find_char('\n') > 0;
+ if (cd.enums[key].is_deprecated || cd.enums[key].is_experimental || !descr.is_empty()) {
+ class_desc->add_newline();
- class_desc->add_newline();
- class_desc->add_newline();
+ class_desc->push_indent(1);
+ _push_normal_font();
+ class_desc->push_color(theme_cache.text_color);
+
+ bool has_prev_text = false;
+
+ if (cd.enums[key].is_deprecated) {
+ has_prev_text = true;
+ DEPRECATED_DOC_MSG(DTR_DOC(cd.enums[key].deprecated_message), TTR("This enumeration may be changed or removed in future versions."));
+ }
+
+ if (cd.enums[key].is_experimental) {
+ if (has_prev_text) {
+ class_desc->add_newline();
+ if (is_multiline) {
+ class_desc->add_newline();
+ }
+ }
+ has_prev_text = true;
+ EXPERIMENTAL_DOC_MSG(DTR_DOC(cd.enums[key].experimental_message), TTR("This enumeration may be changed or removed in future versions."));
+ }
+
+ if (!descr.is_empty()) {
+ if (has_prev_text) {
+ class_desc->add_newline();
+ if (is_multiline) {
+ class_desc->add_newline();
+ }
+ }
+ has_prev_text = true;
+ _add_text(descr);
+ }
+
+ class_desc->pop(); // color
+ _pop_normal_font();
+ class_desc->pop(); // indent
+ }
}
- class_desc->push_indent(1);
Vector<DocData::ConstantDoc> enum_list = E.value;
+ HashMap<String, int> enum_values;
+ const int enum_start_line = enum_line[E.key];
- HashMap<String, int> enumValuesContainer;
- int enumStartingLine = enum_line[E.key];
-
+ bool prev_is_multiline = true; // Use a large margin for the first item.
for (int i = 0; i < enum_list.size(); i++) {
+ const String descr = DTR_DOC(enum_list[i].description).strip_edges();
+ const bool is_multiline = descr.find_char('\n') > 0;
+
+ class_desc->add_newline();
+ if (prev_is_multiline || is_multiline) {
+ class_desc->add_newline();
+ }
+ prev_is_multiline = is_multiline;
+
if (cd.name == "@GlobalScope") {
- enumValuesContainer[enum_list[i].name] = enumStartingLine;
+ enum_values[enum_list[i].name] = enum_start_line;
}
// Add the enum constant line to the constant_line map so we can locate it as a constant.
constant_line[enum_list[i].name] = class_desc->get_paragraph_count() - 2;
- _push_code_font();
+ class_desc->push_indent(1);
+ // Enum value header.
+ _push_code_font();
_add_bulletpoint();
+
class_desc->push_color(theme_cache.headline_color);
- _add_text(enum_list[i].name);
- class_desc->pop();
+ class_desc->add_text(enum_list[i].name);
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(" = ");
- class_desc->pop();
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.value_color);
class_desc->add_text(_fix_constant(enum_list[i].value));
- class_desc->pop();
-
- if (enum_list[i].is_deprecated) {
- DEPRECATED_DOC_TAG;
- }
-
- if (enum_list[i].is_experimental) {
- EXPERIMENTAL_DOC_TAG;
- }
+ class_desc->pop(); // color
_pop_code_font();
- class_desc->add_newline();
+ // Enum value description.
+ if (enum_list[i].is_deprecated || enum_list[i].is_experimental || !descr.is_empty()) {
+ class_desc->add_newline();
- if (!enum_list[i].description.strip_edges().is_empty()) {
- class_desc->push_color(theme_cache.comment_color);
+ class_desc->push_indent(1);
_push_normal_font();
- _add_text(DTR(enum_list[i].description));
- _pop_normal_font();
- class_desc->pop();
- if (DTR(enum_list[i].description).find("\n") > 0) {
- class_desc->add_newline();
+ class_desc->push_color(theme_cache.comment_color);
+
+ bool has_prev_text = false;
+
+ if (enum_list[i].is_deprecated) {
+ has_prev_text = true;
+ DEPRECATED_DOC_MSG(DTR_DOC(enum_list[i].deprecated_message), TTR("This constant may be changed or removed in future versions."));
}
+
+ if (enum_list[i].is_experimental) {
+ if (has_prev_text) {
+ class_desc->add_newline();
+ if (is_multiline) {
+ class_desc->add_newline();
+ }
+ }
+ has_prev_text = true;
+ EXPERIMENTAL_DOC_MSG(DTR_DOC(enum_list[i].experimental_message), TTR("This constant may be changed or removed in future versions."));
+ }
+
+ if (!descr.is_empty()) {
+ if (has_prev_text) {
+ class_desc->add_newline();
+ if (is_multiline) {
+ class_desc->add_newline();
+ }
+ }
+ has_prev_text = true;
+ _add_text(descr);
+ }
+
+ class_desc->pop(); // color
+ _pop_normal_font();
+ class_desc->pop(); // indent
}
- class_desc->add_newline();
+ class_desc->pop(); // indent
}
if (cd.name == "@GlobalScope") {
- enum_values_line[E.key] = enumValuesContainer;
+ enum_values_line[E.key] = enum_values;
}
-
- class_desc->pop();
-
- class_desc->add_newline();
}
-
- class_desc->pop();
- class_desc->add_newline();
}
// Constants
- if (constants.size()) {
+ if (!constants.is_empty()) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
section_line.push_back(Pair<String, int>(TTR("Constants"), class_desc->get_paragraph_count() - 2));
_push_title_font();
class_desc->add_text(TTR("Constants"));
_pop_title_font();
- class_desc->push_indent(1);
-
- class_desc->add_newline();
+ bool prev_is_multiline = true; // Use a large margin for the first item.
for (int i = 0; i < constants.size(); i++) {
+ const String descr = DTR_DOC(constants[i].description).strip_edges();
+ const bool is_multiline = descr.find_char('\n') > 0;
+
+ class_desc->add_newline();
+ if (prev_is_multiline || is_multiline) {
+ class_desc->add_newline();
+ }
+ prev_is_multiline = is_multiline;
+
constant_line[constants[i].name] = class_desc->get_paragraph_count() - 2;
+ class_desc->push_indent(1);
+
+ // Constant header.
_push_code_font();
if (constants[i].value.begins_with("Color(") && constants[i].value.ends_with(")")) {
@@ -1555,50 +1768,70 @@ void EditorHelp::_update_doc() {
if (color.size() >= 3) {
class_desc->push_color(Color(color[0], color[1], color[2]));
_add_bulletpoint();
- class_desc->pop();
+ class_desc->pop(); // color
}
} else {
_add_bulletpoint();
}
class_desc->push_color(theme_cache.headline_color);
- _add_text(constants[i].name);
- class_desc->pop();
+ class_desc->add_text(constants[i].name);
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(" = ");
- class_desc->pop();
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.value_color);
class_desc->add_text(_fix_constant(constants[i].value));
- class_desc->pop();
-
- if (constants[i].is_deprecated) {
- DEPRECATED_DOC_TAG;
- }
-
- if (constants[i].is_experimental) {
- EXPERIMENTAL_DOC_TAG;
- }
+ class_desc->pop(); // color
_pop_code_font();
- class_desc->add_newline();
+ // Constant description.
+ if (constants[i].is_deprecated || constants[i].is_experimental || !descr.is_empty()) {
+ class_desc->add_newline();
- if (!constants[i].description.strip_edges().is_empty()) {
- class_desc->push_color(theme_cache.comment_color);
+ class_desc->push_indent(1);
_push_normal_font();
- _add_text(DTR(constants[i].description));
- _pop_normal_font();
- class_desc->pop();
- if (DTR(constants[i].description).find("\n") > 0) {
- class_desc->add_newline();
+ class_desc->push_color(theme_cache.comment_color);
+
+ bool has_prev_text = false;
+
+ if (constants[i].is_deprecated) {
+ has_prev_text = true;
+ DEPRECATED_DOC_MSG(DTR_DOC(constants[i].deprecated_message), TTR("This constant may be changed or removed in future versions."));
+ }
+
+ if (constants[i].is_experimental) {
+ if (has_prev_text) {
+ class_desc->add_newline();
+ if (is_multiline) {
+ class_desc->add_newline();
+ }
+ }
+ has_prev_text = true;
+ EXPERIMENTAL_DOC_MSG(DTR_DOC(constants[i].experimental_message), TTR("This constant may be changed or removed in future versions."));
+ }
+
+ if (!descr.is_empty()) {
+ if (has_prev_text) {
+ class_desc->add_newline();
+ if (is_multiline) {
+ class_desc->add_newline();
+ }
+ }
+ has_prev_text = true;
+ _add_text(descr);
}
+
+ class_desc->pop(); // color
+ _pop_normal_font();
+ class_desc->pop(); // indent
}
- class_desc->add_newline();
+ class_desc->pop(); // indent
}
-
- class_desc->pop();
- class_desc->add_newline();
}
}
@@ -1608,112 +1841,126 @@ void EditorHelp::_update_doc() {
cd.annotations.sort();
}
+ class_desc->add_newline();
+ class_desc->add_newline();
+
section_line.push_back(Pair<String, int>(TTR("Annotations"), class_desc->get_paragraph_count() - 2));
_push_title_font();
class_desc->add_text(TTR("Annotations"));
_pop_title_font();
- class_desc->add_newline();
- class_desc->add_newline();
-
- class_desc->push_indent(1);
-
for (int i = 0; i < cd.annotations.size(); i++) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+
annotation_line[cd.annotations[i].name] = class_desc->get_paragraph_count() - 2; // Gets overridden if description.
+ class_desc->push_indent(1);
+
+ // Annotation header.
_push_code_font();
_add_bulletpoint();
+
class_desc->push_color(theme_cache.headline_color);
- _add_text(cd.annotations[i].name);
- class_desc->pop();
+ class_desc->add_text(cd.annotations[i].name);
+ class_desc->pop(); // color
if (cd.annotations[i].arguments.size() > 0) {
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text("(");
- class_desc->pop();
+ class_desc->pop(); // color
+
for (int j = 0; j < cd.annotations[i].arguments.size(); j++) {
class_desc->push_color(theme_cache.text_color);
+
if (j > 0) {
class_desc->add_text(", ");
}
- _add_text(cd.annotations[i].arguments[j].name);
+ class_desc->add_text(cd.annotations[i].arguments[j].name);
class_desc->add_text(": ");
_add_type(cd.annotations[i].arguments[j].type);
+
if (!cd.annotations[i].arguments[j].default_value.is_empty()) {
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(" = ");
- class_desc->pop();
- _add_text(cd.annotations[i].arguments[j].default_value);
+ class_desc->pop(); // color
+
+ class_desc->push_color(theme_cache.value_color);
+ class_desc->add_text(_fix_constant(cd.annotations[i].arguments[j].default_value));
+ class_desc->pop(); // color
}
- class_desc->pop();
+ class_desc->pop(); // color
}
if (cd.annotations[i].qualifiers.contains("vararg")) {
class_desc->push_color(theme_cache.text_color);
- if (cd.annotations[i].arguments.size()) {
+ if (!cd.annotations[i].arguments.is_empty()) {
class_desc->add_text(", ");
}
+ class_desc->pop(); // color
+
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text("...");
- class_desc->pop();
- class_desc->pop();
+ class_desc->pop(); // color
}
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(")");
- class_desc->pop();
+ class_desc->pop(); // color
}
if (!cd.annotations[i].qualifiers.is_empty()) {
class_desc->push_color(theme_cache.qualifier_color);
class_desc->add_text(" ");
- _add_text(cd.annotations[i].qualifiers);
- class_desc->pop();
+ class_desc->add_text(cd.annotations[i].qualifiers);
+ class_desc->pop(); // color
}
_pop_code_font();
- if (!cd.annotations[i].description.strip_edges().is_empty()) {
- class_desc->push_color(theme_cache.comment_color);
- _push_normal_font();
- class_desc->push_indent(1);
- _add_text(DTR(cd.annotations[i].description));
- class_desc->pop(); // indent
- _pop_normal_font();
- class_desc->pop(); // color
+ class_desc->add_newline();
+
+ // Annotation description.
+ class_desc->push_indent(1);
+ _push_normal_font();
+ class_desc->push_color(theme_cache.comment_color);
+
+ const String descr = DTR_DOC(cd.annotations[i].description).strip_edges();
+ if (!descr.is_empty()) {
+ _add_text(descr);
} else {
- class_desc->push_indent(1);
class_desc->add_image(get_editor_theme_icon(SNAME("Error")));
class_desc->add_text(" ");
class_desc->push_color(theme_cache.comment_color);
if (cd.is_script_doc) {
- class_desc->append_text(TTR("There is currently no description for this annotation."));
+ class_desc->add_text(TTR("There is currently no description for this annotation."));
} else {
class_desc->append_text(TTR("There is currently no description for this annotation. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text));
}
- class_desc->pop();
- class_desc->pop(); // indent
+ class_desc->pop(); // color
}
- class_desc->add_newline();
- class_desc->add_newline();
- }
- class_desc->pop();
- class_desc->add_newline();
+ class_desc->pop(); // color
+ _pop_normal_font();
+ class_desc->pop(); // indent
+
+ class_desc->pop(); // indent
+ }
}
// Property descriptions
if (has_property_descriptions) {
+ class_desc->add_newline();
+ class_desc->add_newline();
+ class_desc->add_newline();
+
section_line.push_back(Pair<String, int>(TTR("Property Descriptions"), class_desc->get_paragraph_count() - 2));
_push_title_font();
class_desc->add_text(TTR("Property Descriptions"));
_pop_title_font();
- class_desc->add_newline();
- class_desc->add_newline();
-
for (int i = 0; i < cd.properties.size(); i++) {
if (cd.properties[i].overridden) {
continue;
@@ -1723,6 +1970,10 @@ void EditorHelp::_update_doc() {
continue;
}
+ class_desc->add_newline();
+ class_desc->add_newline();
+ class_desc->add_newline();
+
property_line[cd.properties[i].name] = class_desc->get_paragraph_count() - 2;
class_desc->push_table(2);
@@ -1731,16 +1982,15 @@ void EditorHelp::_update_doc() {
class_desc->push_cell();
_push_code_font();
_add_bulletpoint();
-
_add_type(cd.properties[i].type, cd.properties[i].enumeration, cd.properties[i].is_bitfield);
- class_desc->add_text(" ");
_pop_code_font();
class_desc->pop(); // cell
class_desc->push_cell();
_push_code_font();
+
class_desc->push_color(theme_cache.headline_color);
- _add_text(cd.properties[i].name);
+ class_desc->add_text(cd.properties[i].name);
class_desc->pop(); // color
if (!cd.properties[i].default_value.is_empty()) {
@@ -1757,14 +2007,6 @@ 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(theme_cache.symbol_color);
class_desc->add_text(" [" + TTR("property:") + " ");
@@ -1813,7 +2055,7 @@ void EditorHelp::_update_doc() {
// Setters with additional arguments are exposed in the method list, so we link them here for quick access.
class_desc->push_meta("@method " + cd.properties[i].setter);
class_desc->add_text(cd.properties[i].setter + TTR("(value)"));
- class_desc->pop();
+ class_desc->pop(); // meta
} else {
class_desc->add_text(cd.properties[i].setter + TTR("(value)"));
}
@@ -1840,7 +2082,7 @@ void EditorHelp::_update_doc() {
// Getters with additional arguments are exposed in the method list, so we link them here for quick access.
class_desc->push_meta("@method " + cd.properties[i].getter);
class_desc->add_text(cd.properties[i].getter + "()");
- class_desc->pop();
+ class_desc->pop(); // meta
} else {
class_desc->add_text(cd.properties[i].getter + "()");
}
@@ -1861,64 +2103,66 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
class_desc->add_newline();
- class_desc->push_color(theme_cache.text_color);
- _push_normal_font();
class_desc->push_indent(1);
- if (!cd.properties[i].description.strip_edges().is_empty()) {
- _add_text(DTR(cd.properties[i].description));
+ _push_normal_font();
+ class_desc->push_color(theme_cache.text_color);
+
+ if (cd.properties[i].is_deprecated) {
+ DEPRECATED_DOC_MSG(DTR_DOC(cd.properties[i].deprecated_message), TTR("This property may be changed or removed in future versions."));
+ class_desc->add_newline();
+ class_desc->add_newline();
+ }
+
+ if (cd.properties[i].is_experimental) {
+ EXPERIMENTAL_DOC_MSG(DTR_DOC(cd.properties[i].experimental_message), TTR("This property may be changed or removed in future versions."));
+ class_desc->add_newline();
+ class_desc->add_newline();
+ }
+
+ const String descr = DTR_DOC(cd.properties[i].description).strip_edges();
+ if (!descr.is_empty()) {
+ _add_text(descr);
} else {
class_desc->add_image(get_editor_theme_icon(SNAME("Error")));
class_desc->add_text(" ");
class_desc->push_color(theme_cache.comment_color);
if (cd.is_script_doc) {
- class_desc->append_text(TTR("There is currently no description for this property."));
+ class_desc->add_text(TTR("There is currently no description for this property."));
} else {
class_desc->append_text(TTR("There is currently no description for this property. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text));
}
- class_desc->pop();
+ class_desc->pop(); // color
}
- class_desc->pop();
- _pop_normal_font();
- class_desc->pop();
- class_desc->add_newline();
- class_desc->add_newline();
- class_desc->add_newline();
+ class_desc->pop(); // color
+ _pop_normal_font();
+ class_desc->pop(); // indent
}
}
// Constructor descriptions
if (!cd.constructors.is_empty()) {
- section_line.push_back(Pair<String, int>(TTR("Constructor Descriptions"), class_desc->get_paragraph_count() - 2));
- _push_title_font();
- class_desc->add_text(TTR("Constructor Descriptions"));
- _pop_title_font();
-
- _update_method_descriptions(cd, cd.constructors, METHOD_TYPE_CONSTRUCTOR);
+ _update_method_descriptions(cd, METHOD_TYPE_CONSTRUCTOR, cd.constructors);
}
// Method descriptions
if (!methods.is_empty()) {
- section_line.push_back(Pair<String, int>(TTR("Method Descriptions"), class_desc->get_paragraph_count() - 2));
- _push_title_font();
- class_desc->add_text(TTR("Method Descriptions"));
- _pop_title_font();
-
- _update_method_descriptions(cd, methods, METHOD_TYPE_METHOD);
+ _update_method_descriptions(cd, METHOD_TYPE_METHOD, methods);
}
// Operator descriptions
if (!cd.operators.is_empty()) {
- section_line.push_back(Pair<String, int>(TTR("Operator Descriptions"), class_desc->get_paragraph_count() - 2));
- _push_title_font();
- class_desc->add_text(TTR("Operator Descriptions"));
- _pop_title_font();
-
- _update_method_descriptions(cd, cd.operators, METHOD_TYPE_OPERATOR);
+ _update_method_descriptions(cd, METHOD_TYPE_OPERATOR, cd.operators);
}
+ // Allow the document to be scrolled slightly below the end.
+ class_desc->add_newline();
+ class_desc->add_newline();
+
// Free the scroll.
scroll_locked = false;
+
+#undef DTR_DOC
}
void EditorHelp::_request_help(const String &p_string) {
@@ -2081,6 +2325,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
bbcode = bbcode.replace("[codeblock]\n", "[codeblock]");
bbcode = bbcode.replace("[codeblock skip-lint]\n", "[codeblock skip-lint]"); // Extra argument to silence validation warnings.
bbcode = bbcode.replace("\n[/codeblock]", "[/codeblock]");
+ bbcode = bbcode.replace("[/codeblock]\n", "[/codeblock]");
List<String> tag_stack;
bool code_tag = false;
@@ -2088,7 +2333,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
int pos = 0;
while (pos < bbcode.length()) {
- int brk_pos = bbcode.find("[", pos);
+ int brk_pos = bbcode.find_char('[', pos);
if (brk_pos < 0) {
brk_pos = bbcode.length();
@@ -2106,7 +2351,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
break; // Nothing else to add.
}
- int brk_end = bbcode.find("]", brk_pos + 1);
+ int brk_end = bbcode.find_char(']', brk_pos + 1);
if (brk_end == -1) {
String text = bbcode.substr(brk_pos, bbcode.length() - brk_pos);
@@ -2144,6 +2389,9 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
p_rt->pop();
p_rt->pop();
p_rt->pop();
+ if (pos < bbcode.length()) {
+ p_rt->add_newline();
+ }
}
}
code_tag = false;
@@ -2154,7 +2402,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
pos = brk_pos + 1;
} else if (tag.begins_with("method ") || tag.begins_with("constructor ") || tag.begins_with("operator ") || tag.begins_with("member ") || tag.begins_with("signal ") || tag.begins_with("enum ") || tag.begins_with("constant ") || tag.begins_with("annotation ") || tag.begins_with("theme_item ")) {
- const int tag_end = tag.find(" ");
+ const int tag_end = tag.find_char(' ');
const String link_tag = tag.substr(0, tag_end);
const String link_target = tag.substr(tag_end + 1, tag.length()).lstrip(" ");
@@ -2166,7 +2414,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
Color target_color = link_color;
if (link_tag == "method" || link_tag == "constructor" || link_tag == "operator") {
target_color = link_method_color;
- } else if (link_tag == "member" || link_tag == "signal" || link_tag == "theme property") {
+ } else if (link_tag == "member" || link_tag == "signal" || link_tag == "theme_item") {
target_color = link_property_color;
} else if (link_tag == "annotation") {
target_color = link_annotation_color;
@@ -2182,7 +2430,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
pos = brk_end + 1;
} else if (tag.begins_with("param ")) {
- const int tag_end = tag.find(" ");
+ const int tag_end = tag.find_char(' ');
const String param_name = tag.substr(tag_end + 1, tag.length()).lstrip(" ");
// Use monospace font with translucent background color to make code easier to distinguish from other text.
@@ -2298,7 +2546,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
p_rt->add_text("]");
pos = brk_end + 1;
} else if (tag == "url") {
- int end = bbcode.find("[", brk_end);
+ int end = bbcode.find_char('[', brk_end);
if (end == -1) {
end = bbcode.length();
}
@@ -2322,7 +2570,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
HashMap<String, String> bbcode_options;
for (int i = 0; i < subtags.size(); i++) {
const String &expr = subtags[i];
- int value_pos = expr.find("=");
+ int value_pos = expr.find_char('=');
if (value_pos > -1) {
bbcode_options[expr.substr(0, value_pos)] = expr.substr(value_pos + 1).unquote();
}
@@ -2343,7 +2591,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control
}
}
}
- int end = bbcode.find("[", brk_end);
+ int end = bbcode.find_char('[', brk_end);
if (end == -1) {
end = bbcode.length();
}
@@ -2668,13 +2916,13 @@ DocTools *EditorHelp::get_doc_data() {
/// EditorHelpBit ///
-void EditorHelpBit::_go_to_help(String p_what) {
+void EditorHelpBit::_go_to_help(const String &p_what) {
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
ScriptEditor::get_singleton()->goto_help(p_what);
emit_signal(SNAME("request_hide"));
}
-void EditorHelpBit::_meta_clicked(String p_select) {
+void EditorHelpBit::_meta_clicked(const String &p_select) {
if (p_select.begins_with("$")) { // enum
String select = p_select.substr(1, p_select.length());
String class_name;
@@ -2967,7 +3215,7 @@ void EditorHelpTooltip::parse_tooltip(const String &p_text) {
formatted_text = TTR("Signal:");
} else if (type == "theme_item") {
description = get_theme_item_description(class_name, property_name);
- formatted_text = TTR("Theme Item:");
+ formatted_text = TTR("Theme Property:");
} else {
ERR_FAIL_MSG("Invalid tooltip type '" + type + "'. Valid types are 'class', 'property', 'method', 'signal', and 'theme_item'.");
}
diff --git a/editor/editor_help.h b/editor/editor_help.h
index 49d13c5522..5018f6570d 100644
--- a/editor/editor_help.h
+++ b/editor/editor_help.h
@@ -179,8 +179,8 @@ class EditorHelp : public VBoxContainer {
Error _goto_desc(const String &p_class);
//void _update_history_buttons();
- void _update_method_list(const Vector<DocData::MethodDoc> p_methods, MethodType p_method_type);
- void _update_method_descriptions(const DocData::ClassDoc p_classdoc, const Vector<DocData::MethodDoc> p_methods, MethodType p_method_type);
+ void _update_method_list(MethodType p_method_type, const Vector<DocData::MethodDoc> &p_methods);
+ void _update_method_descriptions(const DocData::ClassDoc &p_classdoc, MethodType p_method_type, const Vector<DocData::MethodDoc> &p_methods);
void _update_doc();
void _request_help(const String &p_string);
@@ -259,8 +259,8 @@ class EditorHelpBit : public MarginContainer {
inline static HashMap<StringName, HashMap<StringName, String>> doc_theme_item_cache;
RichTextLabel *rich_text = nullptr;
- void _go_to_help(String p_what);
- void _meta_clicked(String p_select);
+ void _go_to_help(const String &p_what);
+ void _meta_clicked(const String &p_select);
String text;
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 827e2c7bf6..663cddc0da 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -955,6 +955,7 @@ void EditorNode::_fs_changed() {
err = FAILED;
export_error = vformat("Export preset \"%s\" doesn't have a matching platform.", preset_name);
} else {
+ export_preset->update_value_overrides();
if (export_defer.pack_only) { // Only export .pck or .zip data pack.
if (export_path.ends_with(".zip")) {
err = platform->export_zip(export_preset, export_defer.debug, export_path);
@@ -6767,8 +6768,8 @@ EditorNode::EditorNode() {
warning->add_button(TTR("Copy Text"), true, "copy");
warning->connect("custom_action", callable_mp(this, &EditorNode::_copy_warning));
- ED_SHORTCUT("editor/next_tab", TTR("Next Scene Tab"), KeyModifierMask::CMD_OR_CTRL + Key::TAB);
- ED_SHORTCUT("editor/prev_tab", TTR("Previous Scene Tab"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::TAB);
+ ED_SHORTCUT("editor/next_tab", TTR("Next Scene Tab"), KeyModifierMask::CTRL + Key::TAB);
+ ED_SHORTCUT("editor/prev_tab", TTR("Previous Scene Tab"), KeyModifierMask::CTRL + KeyModifierMask::SHIFT + Key::TAB);
ED_SHORTCUT("editor/filter_files", TTR("Focus FileSystem Filter"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::ALT + Key::P);
command_palette = EditorCommandPalette::get_singleton();
diff --git a/editor/export/editor_export_plugin.cpp b/editor/export/editor_export_plugin.cpp
index ec8c8c7b69..5353eae654 100644
--- a/editor/export/editor_export_plugin.cpp
+++ b/editor/export/editor_export_plugin.cpp
@@ -285,6 +285,12 @@ String EditorExportPlugin::_get_export_option_warning(const Ref<EditorExportPlat
return ret;
}
+Dictionary EditorExportPlugin::_get_export_options_overrides(const Ref<EditorExportPlatform> &p_platform) const {
+ Dictionary ret;
+ GDVIRTUAL_CALL(_get_export_options_overrides, p_platform, ret);
+ return ret;
+}
+
void EditorExportPlugin::_export_file(const String &p_path, const String &p_type, const HashSet<String> &p_features) {
}
@@ -327,6 +333,7 @@ void EditorExportPlugin::_bind_methods() {
GDVIRTUAL_BIND(_end_customize_resources);
GDVIRTUAL_BIND(_get_export_options, "platform");
+ GDVIRTUAL_BIND(_get_export_options_overrides, "platform");
GDVIRTUAL_BIND(_should_update_export_options, "platform");
GDVIRTUAL_BIND(_get_export_option_warning, "platform", "option");
diff --git a/editor/export/editor_export_plugin.h b/editor/export/editor_export_plugin.h
index fe97d2e04f..a4e9917a81 100644
--- a/editor/export/editor_export_plugin.h
+++ b/editor/export/editor_export_plugin.h
@@ -128,6 +128,7 @@ protected:
GDVIRTUAL2RC(PackedStringArray, _get_export_features, const Ref<EditorExportPlatform> &, bool);
GDVIRTUAL1RC(TypedArray<Dictionary>, _get_export_options, const Ref<EditorExportPlatform> &);
+ GDVIRTUAL1RC(Dictionary, _get_export_options_overrides, const Ref<EditorExportPlatform> &);
GDVIRTUAL1RC(bool, _should_update_export_options, const Ref<EditorExportPlatform> &);
GDVIRTUAL2RC(String, _get_export_option_warning, const Ref<EditorExportPlatform> &, String);
@@ -155,6 +156,7 @@ protected:
virtual PackedStringArray _get_export_features(const Ref<EditorExportPlatform> &p_export_platform, bool p_debug) const;
virtual void _get_export_options(const Ref<EditorExportPlatform> &p_export_platform, List<EditorExportPlatform::ExportOption> *r_options) const;
+ virtual Dictionary _get_export_options_overrides(const Ref<EditorExportPlatform> &p_export_platform) const;
virtual bool _should_update_export_options(const Ref<EditorExportPlatform> &p_export_platform) const;
virtual String _get_export_option_warning(const Ref<EditorExportPlatform> &p_export_platform, const String &p_option_name) const;
diff --git a/editor/export/editor_export_preset.cpp b/editor/export/editor_export_preset.cpp
index 478ef98037..8c3b6693e3 100644
--- a/editor/export/editor_export_preset.cpp
+++ b/editor/export/editor_export_preset.cpp
@@ -37,6 +37,7 @@ bool EditorExportPreset::_set(const StringName &p_name, const Variant &p_value)
EditorExport::singleton->save_presets();
if (update_visibility.has(p_name)) {
if (update_visibility[p_name]) {
+ update_value_overrides();
notify_property_list_changed();
}
return true;
@@ -46,6 +47,11 @@ bool EditorExportPreset::_set(const StringName &p_name, const Variant &p_value)
}
bool EditorExportPreset::_get(const StringName &p_name, Variant &r_ret) const {
+ if (value_overrides.has(p_name)) {
+ r_ret = value_overrides[p_name];
+ return true;
+ }
+
if (values.has(p_name)) {
r_ret = values[p_name];
return true;
@@ -59,6 +65,10 @@ void EditorExportPreset::_bind_methods() {
}
String EditorExportPreset::_get_property_warning(const StringName &p_name) const {
+ if (value_overrides.has(p_name)) {
+ return String();
+ }
+
String warning = platform->get_export_option_warning(this, p_name);
if (!warning.is_empty()) {
warning += "\n";
@@ -83,7 +93,7 @@ String EditorExportPreset::_get_property_warning(const StringName &p_name) const
void EditorExportPreset::_get_property_list(List<PropertyInfo> *p_list) const {
for (const KeyValue<StringName, PropertyInfo> &E : properties) {
- if (platform->get_export_option_visibility(this, E.key)) {
+ if (!value_overrides.has(E.key) && platform->get_export_option_visibility(this, E.key)) {
p_list->push_back(E.value);
}
}
@@ -119,6 +129,37 @@ void EditorExportPreset::update_files() {
}
}
+void EditorExportPreset::update_value_overrides() {
+ Vector<Ref<EditorExportPlugin>> export_plugins = EditorExport::get_singleton()->get_export_plugins();
+ HashMap<StringName, Variant> new_value_overrides;
+
+ value_overrides.clear();
+
+ for (int i = 0; i < export_plugins.size(); i++) {
+ if (!export_plugins[i]->supports_platform(platform)) {
+ continue;
+ }
+
+ export_plugins.write[i]->set_export_preset(Ref<EditorExportPreset>(this));
+
+ Dictionary plugin_overrides = export_plugins[i]->_get_export_options_overrides(platform);
+ if (!plugin_overrides.is_empty()) {
+ Array keys = plugin_overrides.keys();
+ for (int x = 0; x < keys.size(); x++) {
+ StringName key = keys[x];
+ Variant value = plugin_overrides[key];
+ if (new_value_overrides.has(key) && new_value_overrides[key] != value) {
+ WARN_PRINT_ED(vformat("Editor export plugin '%s' overrides pre-existing export option override '%s' with new value.", export_plugins[i]->get_name(), key));
+ }
+ new_value_overrides[key] = value;
+ }
+ }
+ }
+
+ value_overrides = new_value_overrides;
+ notify_property_list_changed();
+}
+
Vector<String> EditorExportPreset::get_files_to_export() const {
Vector<String> files;
for (const String &E : selected_files) {
diff --git a/editor/export/editor_export_preset.h b/editor/export/editor_export_preset.h
index effce48111..03ff75b467 100644
--- a/editor/export/editor_export_preset.h
+++ b/editor/export/editor_export_preset.h
@@ -78,6 +78,7 @@ private:
HashMap<StringName, PropertyInfo> properties;
HashMap<StringName, Variant> values;
+ HashMap<StringName, Variant> value_overrides;
HashMap<StringName, bool> update_visibility;
String name;
@@ -107,6 +108,7 @@ public:
bool has(const StringName &p_property) const { return values.has(p_property); }
void update_files();
+ void update_value_overrides();
Vector<String> get_files_to_export() const;
Dictionary get_customized_files() const;
diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp
index ff1fa3470e..4a066b3d3e 100644
--- a/editor/export/project_export.cpp
+++ b/editor/export/project_export.cpp
@@ -276,6 +276,9 @@ void ProjectExportDialog::_edit_preset(int p_index) {
export_path->update_property();
runnable->set_disabled(false);
runnable->set_pressed(current->is_runnable());
+ if (parameters->get_edited_object() != current.ptr()) {
+ current->update_value_overrides();
+ }
parameters->set_object_class(current->get_platform()->get_class_name());
parameters->edit(current.ptr());
@@ -1100,6 +1103,7 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) {
exporting = true;
platform->clear_messages();
+ current->update_value_overrides();
Error err = platform->export_project(current, export_debug->is_pressed(), current->get_export_path(), 0);
result_dialog_log->clear();
if (err != ERR_SKIP) {
@@ -1149,6 +1153,7 @@ void ProjectExportDialog::_export_all(bool p_debug) {
ep.step(preset->get_name(), i);
platform->clear_messages();
+ preset->update_value_overrides();
Error err = platform->export_project(preset, p_debug, preset->get_export_path(), 0);
if (err == ERR_SKIP) {
exporting = false;
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 88bd90be98..dde7ddd32d 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -2128,7 +2128,8 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
terminal_emulators.push_back(terminal_emulator_setting);
}
- String arguments = EDITOR_GET("filesystem/external_programs/terminal_emulator_flags");
+ String flags = EDITOR_GET("filesystem/external_programs/terminal_emulator_flags");
+ String arguments = flags;
if (arguments.is_empty()) {
// NOTE: This default value is ignored further below if the terminal executable is `powershell` or `cmd`,
// due to these terminals requiring nonstandard syntax to start in a specified folder.
@@ -2138,16 +2139,13 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
#ifdef LINUXBSD_ENABLED
String chosen_terminal_emulator;
for (const String &terminal_emulator : terminal_emulators) {
+ String pipe;
List<String> test_args; // Required for `execute()`, as it doesn't accept `Vector<String>`.
- test_args.push_back("-v");
- test_args.push_back(terminal_emulator);
- // Silence command name being printed when found. (stderr is already silenced by `OS::execute()` by default.)
- // FIXME: This doesn't appear to silence stdout.
- test_args.push_back(">");
- test_args.push_back("/dev/null");
- int exit_code = 0;
- const Error err = OS::get_singleton()->execute("command", test_args, nullptr, &exit_code);
- if (err == OK && exit_code == EXIT_SUCCESS) {
+ test_args.push_back("-cr");
+ test_args.push_back("command -v " + terminal_emulator);
+ const Error err = OS::get_singleton()->execute("bash", test_args, &pipe);
+ // Check if a path to the terminal executable exists.
+ if (err == OK && pipe.contains("/")) {
chosen_terminal_emulator = terminal_emulator;
break;
} else if (err == ERR_CANT_FORK) {
@@ -2164,8 +2162,14 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
// Prepend default arguments based on the terminal emulator name.
// Use `String.ends_with()` so that installations in non-default paths
// or `/usr/local/bin` are detected correctly.
- if (chosen_terminal_emulator.ends_with("konsole")) {
- terminal_emulator_args.push_back("--workdir");
+ if (flags.is_empty()) {
+ if (chosen_terminal_emulator.ends_with("konsole")) {
+ terminal_emulator_args.push_back("--workdir");
+ } else if (chosen_terminal_emulator.ends_with("gnome-terminal")) {
+ terminal_emulator_args.push_back("--working-directory");
+ } else if (chosen_terminal_emulator.ends_with("urxvt")) {
+ terminal_emulator_args.push_back("-cd");
+ }
}
#endif
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 987a28adc9..9d7305f9ae 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5811,10 +5811,12 @@ bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, cons
instantiated_scene->set_scene_file_path(ProjectSettings::get_singleton()->localize_path(path));
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
+ EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection();
undo_redo->add_do_method(parent, "add_child", instantiated_scene, true);
undo_redo->add_do_method(instantiated_scene, "set_owner", edited_scene);
undo_redo->add_do_reference(instantiated_scene);
undo_redo->add_undo_method(parent, "remove_child", instantiated_scene);
+ undo_redo->add_do_method(editor_selection, "add_node", instantiated_scene);
String new_name = parent->validate_child_name(instantiated_scene);
EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton();
@@ -5853,6 +5855,8 @@ void CanvasItemEditorViewport::_perform_drop_data() {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action_for_history(TTR("Create Node"), EditorNode::get_editor_data().get_current_edited_scene_history_id());
+ EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection();
+ undo_redo->add_do_method(editor_selection, "clear");
for (int i = 0; i < selected_files.size(); i++) {
String path = selected_files[i];
@@ -5879,6 +5883,7 @@ void CanvasItemEditorViewport::_perform_drop_data() {
if (texture != nullptr && texture.is_valid()) {
Node *child = Object::cast_to<Node>(ClassDB::instantiate(default_texture_node_type));
_create_nodes(target_node, child, path, drop_pos);
+ undo_redo->add_do_method(editor_selection, "add_node", child);
}
}
}
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 89035ca6c1..92c1b1be1d 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -4356,6 +4356,7 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
undo_redo->add_do_method(instantiated_scene, "set_owner", EditorNode::get_singleton()->get_edited_scene());
undo_redo->add_do_reference(instantiated_scene);
undo_redo->add_undo_method(parent, "remove_child", instantiated_scene);
+ undo_redo->add_do_method(editor_selection, "add_node", instantiated_scene);
String new_name = parent->validate_child_name(instantiated_scene);
EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton();
@@ -4405,7 +4406,8 @@ void Node3DEditorViewport::_perform_drop_data() {
Vector<String> error_files;
- undo_redo->create_action(TTR("Create Node"));
+ undo_redo->create_action(TTR("Create Node"), UndoRedo::MERGE_DISABLE, target_node);
+ undo_redo->add_do_method(editor_selection, "clear");
for (int i = 0; i < selected_files.size(); i++) {
String path = selected_files[i];
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index c8e65e98a7..335aa33c4a 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2726,6 +2726,10 @@ void ScriptEditor::_add_callback(Object *p_obj, const String &p_function, const
Ref<Script> scr = p_obj->get_script();
ERR_FAIL_COND(!scr.is_valid());
+ if (!scr->get_language()->can_make_function()) {
+ return;
+ }
+
EditorNode::get_singleton()->push_item(scr.ptr());
for (int i = 0; i < tab_container->get_tab_count(); i++) {
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 06aedecd0e..9fbeab494e 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -345,14 +345,19 @@ void ScriptTextEditor::reload_text() {
}
void ScriptTextEditor::add_callback(const String &p_function, PackedStringArray p_args) {
+ ScriptLanguage *language = script->get_language();
+ if (!language->can_make_function()) {
+ return;
+ }
+
String code = code_editor->get_text_editor()->get_text();
- int pos = script->get_language()->find_function(p_function, code);
+ int pos = language->find_function(p_function, code);
code_editor->get_text_editor()->remove_secondary_carets();
if (pos == -1) {
//does not exist
code_editor->get_text_editor()->deselect();
pos = code_editor->get_text_editor()->get_line_count() + 2;
- String func = script->get_language()->make_function("", p_function, p_args);
+ String func = language->make_function("", p_function, p_args);
//code=code+func;
code_editor->get_text_editor()->set_caret_line(pos + 1);
code_editor->get_text_editor()->set_caret_column(1000000); //none shall be that big
diff --git a/main/main.cpp b/main/main.cpp
index ceb2cbbae7..4c9c159f47 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -483,6 +483,7 @@ void Main::print_help(const char *p_binary) {
print_help_option("--version", "Display the version string.\n");
print_help_option("-v, --verbose", "Use verbose stdout mode.\n");
print_help_option("--quiet", "Quiet mode, silences stdout messages. Errors are still displayed.\n");
+ print_help_option("--no-header", "Do not print engine version and rendering method header on startup.\n");
print_help_title("Run options");
print_help_option("--, ++", "Separator for user-provided arguments. Following arguments are not used by the engine, but can be read from `OS.get_cmdline_user_args()`.\n");
@@ -1013,6 +1014,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
quiet_stdout = true;
+ } else if (I->get() == "--no-header") {
+ Engine::get_singleton()->_print_header = false;
+
} else if (I->get() == "--audio-driver") { // audio driver
if (I->next()) {
@@ -1833,6 +1837,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (bool(GLOBAL_GET("application/run/disable_stderr"))) {
CoreGlobals::print_error_enabled = false;
}
+ if (!bool(GLOBAL_GET("application/run/print_header"))) {
+ // --no-header option for project settings.
+ Engine::get_singleton()->_print_header = false;
+ }
if (quiet_stdout) {
CoreGlobals::print_line_enabled = false;
@@ -2449,7 +2457,7 @@ Error Main::setup2() {
set_current_thread_safe_for_nodes(true);
// Print engine name and version
- print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE));
+ Engine::get_singleton()->print_header(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE));
#ifdef TOOLS_ENABLED
if (editor || project_manager || cmdline_tool) {
@@ -2742,8 +2750,6 @@ Error Main::setup2() {
AudioDriverManager::initialize(audio_driver_idx);
- print_line(" "); // Add a blank line for readability.
-
// Right moment to create and initialize the audio server.
audio_server = memnew(AudioServer);
audio_server->init();
@@ -2763,6 +2769,9 @@ Error Main::setup2() {
OS::get_singleton()->benchmark_end_measure("Startup", "Servers");
+ // Add a blank line for readability.
+ Engine::get_singleton()->print_header("");
+
register_core_singletons();
/* Initialize the main window and boot screen */
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 604ad5e1e4..7c93fbf081 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -1826,11 +1826,13 @@ CSGBrush *CSGPolygon3D::_build_brush() {
if (path) {
path->disconnect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited));
path->disconnect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed));
+ path->set_update_callback(Callable());
}
path = current_path;
if (path) {
path->connect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited));
path->connect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed));
+ path->set_update_callback(callable_mp(this, &CSGPolygon3D::_path_changed));
}
}
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index 933bfba5ba..9982edfbd3 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -57,12 +57,11 @@
[/codeblock]
</description>
</method>
- <method name="convert" is_deprecated="true">
+ <method name="convert" deprecated="Use [method @GlobalScope.type_convert] instead.">
<return type="Variant" />
<param index="0" name="what" type="Variant" />
<param index="1" name="type" type="int" />
<description>
- [i]Deprecated.[/i] Use [method @GlobalScope.type_convert] instead.
Converts [param what] to [param type] in the best way possible. The [param type] uses the [enum Variant.Type] values.
[codeblock]
var a = [4, 2.5, 1.2]
diff --git a/modules/gdscript/editor/gdscript_docgen.cpp b/modules/gdscript/editor/gdscript_docgen.cpp
index 659140b9b1..601db5414b 100644
--- a/modules/gdscript/editor/gdscript_docgen.cpp
+++ b/modules/gdscript/editor/gdscript_docgen.cpp
@@ -268,7 +268,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
doc.tutorials.append(td);
}
doc.is_deprecated = p_class->doc_data.is_deprecated;
+ doc.deprecated_message = p_class->doc_data.deprecated_message;
doc.is_experimental = p_class->doc_data.is_experimental;
+ doc.experimental_message = p_class->doc_data.experimental_message;
for (const GDP::ClassNode::Member &member : p_class->members) {
switch (member.type) {
@@ -295,7 +297,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
const_doc.is_value_valid = true;
const_doc.description = m_const->doc_data.description;
const_doc.is_deprecated = m_const->doc_data.is_deprecated;
+ const_doc.deprecated_message = m_const->doc_data.deprecated_message;
const_doc.is_experimental = m_const->doc_data.is_experimental;
+ const_doc.experimental_message = m_const->doc_data.experimental_message;
doc.constants.push_back(const_doc);
} break;
@@ -309,7 +313,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
method_doc.name = func_name;
method_doc.description = m_func->doc_data.description;
method_doc.is_deprecated = m_func->doc_data.is_deprecated;
+ method_doc.deprecated_message = m_func->doc_data.deprecated_message;
method_doc.is_experimental = m_func->doc_data.is_experimental;
+ method_doc.experimental_message = m_func->doc_data.experimental_message;
method_doc.qualifiers = m_func->is_static ? "static" : "";
if (m_func->return_type) {
@@ -349,7 +355,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
signal_doc.name = signal_name;
signal_doc.description = m_signal->doc_data.description;
signal_doc.is_deprecated = m_signal->doc_data.is_deprecated;
+ signal_doc.deprecated_message = m_signal->doc_data.deprecated_message;
signal_doc.is_experimental = m_signal->doc_data.is_experimental;
+ signal_doc.experimental_message = m_signal->doc_data.experimental_message;
for (const GDScriptParser::ParameterNode *p : m_signal->parameters) {
DocData::ArgumentDoc arg_doc;
@@ -371,7 +379,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
prop_doc.name = var_name;
prop_doc.description = m_var->doc_data.description;
prop_doc.is_deprecated = m_var->doc_data.is_deprecated;
+ prop_doc.deprecated_message = m_var->doc_data.deprecated_message;
prop_doc.is_experimental = m_var->doc_data.is_experimental;
+ prop_doc.experimental_message = m_var->doc_data.experimental_message;
_doctype_from_gdtype(m_var->get_datatype(), prop_doc.type, prop_doc.enumeration);
switch (m_var->property) {
@@ -417,7 +427,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
DocData::EnumDoc enum_doc;
enum_doc.description = m_enum->doc_data.description;
enum_doc.is_deprecated = m_enum->doc_data.is_deprecated;
+ enum_doc.deprecated_message = m_enum->doc_data.deprecated_message;
enum_doc.is_experimental = m_enum->doc_data.is_experimental;
+ enum_doc.experimental_message = m_enum->doc_data.experimental_message;
doc.enums[name] = enum_doc;
for (const GDP::EnumNode::Value &val : m_enum->values) {
@@ -428,7 +440,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
const_doc.enumeration = name;
const_doc.description = val.doc_data.description;
const_doc.is_deprecated = val.doc_data.is_deprecated;
+ const_doc.deprecated_message = val.doc_data.deprecated_message;
const_doc.is_experimental = val.doc_data.is_experimental;
+ const_doc.experimental_message = val.doc_data.experimental_message;
doc.constants.push_back(const_doc);
}
@@ -448,7 +462,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
const_doc.enumeration = "@unnamed_enums";
const_doc.description = m_enum_val.doc_data.description;
const_doc.is_deprecated = m_enum_val.doc_data.is_deprecated;
+ const_doc.deprecated_message = m_enum_val.doc_data.deprecated_message;
const_doc.is_experimental = m_enum_val.doc_data.is_experimental;
+ const_doc.experimental_message = m_enum_val.doc_data.experimental_message;
doc.constants.push_back(const_doc);
} break;
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index d7aaf4ce10..e5ee1c0e39 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -2597,7 +2597,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
}
}
-bool GDScriptLanguage::is_control_flow_keyword(String p_keyword) const {
+bool GDScriptLanguage::is_control_flow_keyword(const String &p_keyword) const {
// Please keep alphabetical order.
return p_keyword == "break" ||
p_keyword == "continue" ||
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h
index 4ec97fa6b8..860b2350e2 100644
--- a/modules/gdscript/gdscript.h
+++ b/modules/gdscript/gdscript.h
@@ -540,7 +540,7 @@ public:
/* EDITOR FUNCTIONS */
virtual void get_reserved_words(List<String> *p_words) const override;
- virtual bool is_control_flow_keyword(String p_keywords) const override;
+ virtual bool is_control_flow_keyword(const String &p_keywords) const override;
virtual void get_comment_delimiters(List<String> *p_delimiters) const override;
virtual void get_doc_comment_delimiters(List<String> *p_delimiters) const override;
virtual void get_string_delimiters(List<String> *p_delimiters) const override;
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 649bd735c6..4625855329 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3609,11 +3609,17 @@ GDScriptParser::MemberDocData GDScriptParser::parse_doc_comment(int p_line, bool
if (state == DOC_LINE_NORMAL) {
String stripped_line = doc_line.strip_edges();
- if (stripped_line.begins_with("@deprecated")) {
+ if (stripped_line == "@deprecated" || stripped_line.begins_with("@deprecated:")) {
result.is_deprecated = true;
+ if (stripped_line.begins_with("@deprecated:")) {
+ result.deprecated_message = stripped_line.trim_prefix("@deprecated:").strip_edges();
+ }
continue;
- } else if (stripped_line.begins_with("@experimental")) {
+ } else if (stripped_line == "@experimental" || stripped_line.begins_with("@experimental:")) {
result.is_experimental = true;
+ if (stripped_line.begins_with("@experimental:")) {
+ result.experimental_message = stripped_line.trim_prefix("@experimental:").strip_edges();
+ }
continue;
}
}
@@ -3712,11 +3718,17 @@ GDScriptParser::ClassDocData GDScriptParser::parse_class_doc_comment(int p_line,
result.tutorials.append(Pair<String, String>(title, link));
continue;
- } else if (stripped_line.begins_with("@deprecated")) {
+ } else if (stripped_line == "@deprecated" || stripped_line.begins_with("@deprecated:")) {
result.is_deprecated = true;
+ if (stripped_line.begins_with("@deprecated:")) {
+ result.deprecated_message = stripped_line.trim_prefix("@deprecated:").strip_edges();
+ }
continue;
- } else if (stripped_line.begins_with("@experimental")) {
+ } else if (stripped_line == "@experimental" || stripped_line.begins_with("@experimental:")) {
result.is_experimental = true;
+ if (stripped_line.begins_with("@experimental:")) {
+ result.experimental_message = stripped_line.trim_prefix("@experimental:").strip_edges();
+ }
continue;
}
}
diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h
index c064a2d0f4..6664e6df04 100644
--- a/modules/gdscript/gdscript_parser.h
+++ b/modules/gdscript/gdscript_parser.h
@@ -274,13 +274,17 @@ public:
String description;
Vector<Pair<String, String>> tutorials;
bool is_deprecated = false;
+ String deprecated_message;
bool is_experimental = false;
+ String experimental_message;
};
struct MemberDocData {
String description;
bool is_deprecated = false;
+ String deprecated_message;
bool is_experimental = false;
+ String experimental_message;
};
#endif // TOOLS_ENABLED
diff --git a/modules/gltf/doc_classes/GLTFDocument.xml b/modules/gltf/doc_classes/GLTFDocument.xml
index 1b52a82298..1f172633da 100644
--- a/modules/gltf/doc_classes/GLTFDocument.xml
+++ b/modules/gltf/doc_classes/GLTFDocument.xml
@@ -10,7 +10,7 @@
</description>
<tutorials>
<link title="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link>
- <link title="glTF 'What the duck?' guide">https://www.khronos.org/files/gltf20-reference-guide.pdf</link>
+ <link title="glTF &apos;What the duck?&apos; guide">https://www.khronos.org/files/gltf20-reference-guide.pdf</link>
<link title="Khronos glTF specification">https://registry.khronos.org/glTF/</link>
</tutorials>
<methods>
diff --git a/modules/gltf/doc_classes/GLTFPhysicsBody.xml b/modules/gltf/doc_classes/GLTFPhysicsBody.xml
index ca66cd54b0..5cfc22f6b2 100644
--- a/modules/gltf/doc_classes/GLTFPhysicsBody.xml
+++ b/modules/gltf/doc_classes/GLTFPhysicsBody.xml
@@ -55,7 +55,7 @@
<member name="inertia_orientation" type="Quaternion" setter="set_inertia_orientation" getter="get_inertia_orientation" default="Quaternion(0, 0, 0, 1)">
The inertia orientation of the physics body. This defines the rotation of the inertia's principle axes relative to the object's local axes. This is only used when the body type is "rigid" or "vehicle" and [member inertia_diagonal] is set to a non-zero value.
</member>
- <member name="inertia_tensor" type="Basis" setter="set_inertia_tensor" getter="get_inertia_tensor" default="Basis(0, 0, 0, 0, 0, 0, 0, 0, 0)" is_deprecated="true">
+ <member name="inertia_tensor" type="Basis" setter="set_inertia_tensor" getter="get_inertia_tensor" default="Basis(0, 0, 0, 0, 0, 0, 0, 0, 0)" deprecated="">
The inertia tensor of the physics body, in kilogram meter squared (kg⋅m²). This is only used when the body type is "rigid" or "vehicle".
When converted to a Godot [RigidBody3D] node, if this value is zero, then the inertia will be calculated automatically.
</member>
diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml
index 3094a7bf80..da11cd216f 100644
--- a/modules/gridmap/doc_classes/GridMap.xml
+++ b/modules/gridmap/doc_classes/GridMap.xml
@@ -138,11 +138,11 @@
Returns the position of a grid cell in the GridMap's local coordinate space. To convert the returned value into global coordinates, use [method Node3D.to_global]. See also [method map_to_local].
</description>
</method>
- <method name="resource_changed" is_deprecated="true">
+ <method name="resource_changed" deprecated="Use [signal Resource.changed] instead.">
<return type="void" />
<param index="0" name="resource" type="Resource" />
<description>
- [i]Obsoleted.[/i] Use [signal Resource.changed] instead.
+ This method does nothing.
</description>
</method>
<method name="set_cell_item">
diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp
index 381ed42fe1..859278d65e 100644
--- a/modules/mbedtls/crypto_mbedtls.cpp
+++ b/modules/mbedtls/crypto_mbedtls.cpp
@@ -53,7 +53,7 @@ CryptoKey *CryptoKeyMbedTLS::create() {
return memnew(CryptoKeyMbedTLS);
}
-Error CryptoKeyMbedTLS::load(String p_path, bool p_public_only) {
+Error CryptoKeyMbedTLS::load(const String &p_path, bool p_public_only) {
ERR_FAIL_COND_V_MSG(locks, ERR_ALREADY_IN_USE, "Key is in use");
PackedByteArray out;
@@ -79,7 +79,7 @@ Error CryptoKeyMbedTLS::load(String p_path, bool p_public_only) {
return OK;
}
-Error CryptoKeyMbedTLS::save(String p_path, bool p_public_only) {
+Error CryptoKeyMbedTLS::save(const String &p_path, bool p_public_only) {
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::WRITE);
ERR_FAIL_COND_V_MSG(f.is_null(), ERR_INVALID_PARAMETER, "Cannot save CryptoKeyMbedTLS file '" + p_path + "'.");
@@ -103,7 +103,7 @@ Error CryptoKeyMbedTLS::save(String p_path, bool p_public_only) {
return OK;
}
-Error CryptoKeyMbedTLS::load_from_string(String p_string_key, bool p_public_only) {
+Error CryptoKeyMbedTLS::load_from_string(const String &p_string_key, bool p_public_only) {
int ret = 0;
if (p_public_only) {
ret = mbedtls_pk_parse_public_key(&pkey, (unsigned char *)p_string_key.utf8().get_data(), p_string_key.utf8().size());
@@ -138,7 +138,7 @@ X509Certificate *X509CertificateMbedTLS::create() {
return memnew(X509CertificateMbedTLS);
}
-Error X509CertificateMbedTLS::load(String p_path) {
+Error X509CertificateMbedTLS::load(const String &p_path) {
ERR_FAIL_COND_V_MSG(locks, ERR_ALREADY_IN_USE, "Certificate is already in use.");
PackedByteArray out;
@@ -170,7 +170,7 @@ Error X509CertificateMbedTLS::load_from_memory(const uint8_t *p_buffer, int p_le
return OK;
}
-Error X509CertificateMbedTLS::save(String p_path) {
+Error X509CertificateMbedTLS::save(const String &p_path) {
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::WRITE);
ERR_FAIL_COND_V_MSG(f.is_null(), ERR_INVALID_PARAMETER, vformat("Cannot save X509CertificateMbedTLS file '%s'.", p_path));
@@ -235,7 +235,7 @@ HMACContext *HMACContextMbedTLS::create() {
return memnew(HMACContextMbedTLS);
}
-Error HMACContextMbedTLS::start(HashingContext::HashType p_hash_type, PackedByteArray p_key) {
+Error HMACContextMbedTLS::start(HashingContext::HashType p_hash_type, const PackedByteArray &p_key) {
ERR_FAIL_COND_V_MSG(ctx != nullptr, ERR_FILE_ALREADY_IN_USE, "HMACContext already started.");
// HMAC keys can be any size.
@@ -255,7 +255,7 @@ Error HMACContextMbedTLS::start(HashingContext::HashType p_hash_type, PackedByte
return ret ? FAILED : OK;
}
-Error HMACContextMbedTLS::update(PackedByteArray p_data) {
+Error HMACContextMbedTLS::update(const PackedByteArray &p_data) {
ERR_FAIL_NULL_V_MSG(ctx, ERR_INVALID_DATA, "Start must be called before update.");
ERR_FAIL_COND_V_MSG(p_data.is_empty(), ERR_INVALID_PARAMETER, "Src must not be empty.");
@@ -338,7 +338,7 @@ X509CertificateMbedTLS *CryptoMbedTLS::get_default_certificates() {
return default_certs;
}
-void CryptoMbedTLS::load_default_certificates(String p_path) {
+void CryptoMbedTLS::load_default_certificates(const String &p_path) {
ERR_FAIL_COND(default_certs != nullptr);
default_certs = memnew(X509CertificateMbedTLS);
@@ -380,7 +380,7 @@ Ref<CryptoKey> CryptoMbedTLS::generate_rsa(int p_bytes) {
return out;
}
-Ref<X509Certificate> CryptoMbedTLS::generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after) {
+Ref<X509Certificate> CryptoMbedTLS::generate_self_signed_certificate(Ref<CryptoKey> p_key, const String &p_issuer_name, const String &p_not_before, const String &p_not_after) {
Ref<CryptoKeyMbedTLS> key = static_cast<Ref<CryptoKeyMbedTLS>>(p_key);
ERR_FAIL_COND_V_MSG(key.is_null(), nullptr, "Invalid private key argument.");
mbedtls_x509write_cert crt;
@@ -452,7 +452,7 @@ mbedtls_md_type_t CryptoMbedTLS::md_type_from_hashtype(HashingContext::HashType
}
}
-Vector<uint8_t> CryptoMbedTLS::sign(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Ref<CryptoKey> p_key) {
+Vector<uint8_t> CryptoMbedTLS::sign(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, Ref<CryptoKey> p_key) {
int size;
mbedtls_md_type_t type = CryptoMbedTLS::md_type_from_hashtype(p_hash_type, size);
ERR_FAIL_COND_V_MSG(type == MBEDTLS_MD_NONE, Vector<uint8_t>(), "Invalid hash type.");
@@ -470,7 +470,7 @@ Vector<uint8_t> CryptoMbedTLS::sign(HashingContext::HashType p_hash_type, Vector
return out;
}
-bool CryptoMbedTLS::verify(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Vector<uint8_t> p_signature, Ref<CryptoKey> p_key) {
+bool CryptoMbedTLS::verify(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, const Vector<uint8_t> &p_signature, Ref<CryptoKey> p_key) {
int size;
mbedtls_md_type_t type = CryptoMbedTLS::md_type_from_hashtype(p_hash_type, size);
ERR_FAIL_COND_V_MSG(type == MBEDTLS_MD_NONE, false, "Invalid hash type.");
@@ -480,7 +480,7 @@ bool CryptoMbedTLS::verify(HashingContext::HashType p_hash_type, Vector<uint8_t>
return mbedtls_pk_verify(&(key->pkey), type, p_hash.ptr(), size, p_signature.ptr(), p_signature.size()) == 0;
}
-Vector<uint8_t> CryptoMbedTLS::encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_plaintext) {
+Vector<uint8_t> CryptoMbedTLS::encrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_plaintext) {
Ref<CryptoKeyMbedTLS> key = static_cast<Ref<CryptoKeyMbedTLS>>(p_key);
ERR_FAIL_COND_V_MSG(!key.is_valid(), Vector<uint8_t>(), "Invalid key provided.");
uint8_t buf[1024];
@@ -493,7 +493,7 @@ Vector<uint8_t> CryptoMbedTLS::encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_p
return out;
}
-Vector<uint8_t> CryptoMbedTLS::decrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_ciphertext) {
+Vector<uint8_t> CryptoMbedTLS::decrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_ciphertext) {
Ref<CryptoKeyMbedTLS> key = static_cast<Ref<CryptoKeyMbedTLS>>(p_key);
ERR_FAIL_COND_V_MSG(!key.is_valid(), Vector<uint8_t>(), "Invalid key provided.");
ERR_FAIL_COND_V_MSG(key->is_public_only(), Vector<uint8_t>(), "Invalid key provided. Cannot decrypt using a public_only key.");
diff --git a/modules/mbedtls/crypto_mbedtls.h b/modules/mbedtls/crypto_mbedtls.h
index 0168e1f663..60a413ed7c 100644
--- a/modules/mbedtls/crypto_mbedtls.h
+++ b/modules/mbedtls/crypto_mbedtls.h
@@ -51,10 +51,10 @@ public:
static void make_default() { CryptoKey::_create = create; }
static void finalize() { CryptoKey::_create = nullptr; }
- virtual Error load(String p_path, bool p_public_only);
- virtual Error save(String p_path, bool p_public_only);
+ virtual Error load(const String &p_path, bool p_public_only);
+ virtual Error save(const String &p_path, bool p_public_only);
virtual String save_to_string(bool p_public_only);
- virtual Error load_from_string(String p_string_key, bool p_public_only);
+ virtual Error load_from_string(const String &p_string_key, bool p_public_only);
virtual bool is_public_only() const { return public_only; };
CryptoKeyMbedTLS() {
@@ -82,9 +82,9 @@ public:
static void make_default() { X509Certificate::_create = create; }
static void finalize() { X509Certificate::_create = nullptr; }
- virtual Error load(String p_path);
+ virtual Error load(const String &p_path);
virtual Error load_from_memory(const uint8_t *p_buffer, int p_len);
- virtual Error save(String p_path);
+ virtual Error save(const String &p_path);
virtual String save_to_string();
virtual Error load_from_string(const String &p_string_key);
@@ -116,8 +116,8 @@ public:
static bool is_md_type_allowed(mbedtls_md_type_t p_md_type);
- virtual Error start(HashingContext::HashType p_hash_type, PackedByteArray p_key);
- virtual Error update(PackedByteArray p_data);
+ virtual Error start(HashingContext::HashType p_hash_type, const PackedByteArray &p_key);
+ virtual Error update(const PackedByteArray &p_data);
virtual PackedByteArray finish();
HMACContextMbedTLS() {}
@@ -135,16 +135,16 @@ public:
static void initialize_crypto();
static void finalize_crypto();
static X509CertificateMbedTLS *get_default_certificates();
- static void load_default_certificates(String p_path);
+ static void load_default_certificates(const String &p_path);
static mbedtls_md_type_t md_type_from_hashtype(HashingContext::HashType p_hash_type, int &r_size);
virtual PackedByteArray generate_random_bytes(int p_bytes);
virtual Ref<CryptoKey> generate_rsa(int p_bytes);
- virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after);
- virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Ref<CryptoKey> p_key);
- virtual bool verify(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Vector<uint8_t> p_signature, Ref<CryptoKey> p_key);
- virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_plaintext);
- virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_ciphertext);
+ virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, const String &p_issuer_name, const String &p_not_before, const String &p_not_after);
+ virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, Ref<CryptoKey> p_key);
+ virtual bool verify(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, const Vector<uint8_t> &p_signature, Ref<CryptoKey> p_key);
+ virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_plaintext);
+ virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_ciphertext);
CryptoMbedTLS();
~CryptoMbedTLS();
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index e08491729b..0345eebef6 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -307,7 +307,7 @@ void CSharpLanguage::get_reserved_words(List<String> *p_words) const {
}
}
-bool CSharpLanguage::is_control_flow_keyword(String p_keyword) const {
+bool CSharpLanguage::is_control_flow_keyword(const String &p_keyword) const {
return p_keyword == "break" ||
p_keyword == "case" ||
p_keyword == "catch" ||
@@ -516,22 +516,11 @@ static String variant_type_to_managed_name(const String &p_var_type_name) {
}
String CSharpLanguage::make_function(const String &, const String &p_name, const PackedStringArray &p_args) const {
- // FIXME
- // - Due to Godot's API limitation this just appends the function to the end of the file
- // - Use fully qualified name if there is ambiguity
- String s = "private void " + p_name + "(";
- for (int i = 0; i < p_args.size(); i++) {
- const String &arg = p_args[i];
-
- if (i > 0) {
- s += ", ";
- }
-
- s += variant_type_to_managed_name(arg.get_slice(":", 1)) + " " + escape_csharp_keyword(arg.get_slice(":", 0));
- }
- s += ")\n{\n // Replace with function body.\n}\n";
-
- return s;
+ // The make_function() API does not work for C# scripts.
+ // It will always append the generated function at the very end of the script. In C#, it will break compilation by
+ // appending code after the final closing bracket (either the class' or the namespace's).
+ // To prevent issues, we have can_make_function() returning false, and make_function() is never implemented.
+ return String();
}
#else
String CSharpLanguage::make_function(const String &, const String &, const PackedStringArray &) const {
diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h
index 14a9dc2850..99e6ebf2e3 100644
--- a/modules/mono/csharp_script.h
+++ b/modules/mono/csharp_script.h
@@ -493,7 +493,7 @@ public:
/* EDITOR FUNCTIONS */
void get_reserved_words(List<String> *p_words) const override;
- bool is_control_flow_keyword(String p_keyword) const override;
+ bool is_control_flow_keyword(const String &p_keyword) const override;
void get_comment_delimiters(List<String> *p_delimiters) const override;
void get_doc_comment_delimiters(List<String> *p_delimiters) const override;
void get_string_delimiters(List<String> *p_delimiters) const override;
@@ -514,6 +514,7 @@ public:
return -1;
}
String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const override;
+ virtual bool can_make_function() const override { return false; }
virtual String _get_indentation() const;
/* TODO? */ void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const override {}
/* TODO */ void add_global_constant(const StringName &p_variable, const Variant &p_value) override {}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs
index d6d8a93e03..625a6f9921 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs
@@ -55,8 +55,8 @@ namespace Godot.SourceGenerators
.Where(x =>
// Ignore classes whose name is not the same as the file name
Path.GetFileNameWithoutExtension(x.cds.SyntaxTree.FilePath) == x.symbol.Name)
- .GroupBy(x => x.symbol)
- .ToDictionary(g => g.Key, g => g.Select(x => x.cds));
+ .GroupBy<(ClassDeclarationSyntax cds, INamedTypeSymbol symbol), INamedTypeSymbol>(x => x.symbol, SymbolEqualityComparer.Default)
+ .ToDictionary<IGrouping<INamedTypeSymbol, (ClassDeclarationSyntax cds, INamedTypeSymbol symbol)>, INamedTypeSymbol, IEnumerable<ClassDeclarationSyntax>>(g => g.Key, g => g.Select(x => x.cds), SymbolEqualityComparer.Default);
foreach (var godotClass in godotClasses)
{
diff --git a/modules/multiplayer/doc_classes/SceneReplicationConfig.xml b/modules/multiplayer/doc_classes/SceneReplicationConfig.xml
index 1a51e4b6e9..8b9203d316 100644
--- a/modules/multiplayer/doc_classes/SceneReplicationConfig.xml
+++ b/modules/multiplayer/doc_classes/SceneReplicationConfig.xml
@@ -51,20 +51,18 @@
Returns whether the property identified by the given [param path] is configured to be synchronized on spawn.
</description>
</method>
- <method name="property_get_sync" is_deprecated="true">
+ <method name="property_get_sync" deprecated="Use [method property_get_replication_mode] instead.">
<return type="bool" />
<param index="0" name="path" type="NodePath" />
<description>
Returns whether the property identified by the given [param path] is configured to be synchronized on process.
- [i]Deprecated.[/i] Use [method property_get_replication_mode] instead.
</description>
</method>
- <method name="property_get_watch" is_deprecated="true">
+ <method name="property_get_watch" deprecated="Use [method property_get_replication_mode] instead.">
<return type="bool" />
<param index="0" name="path" type="NodePath" />
<description>
Returns whether the property identified by the given [param path] is configured to be reliably synchronized when changes are detected on process.
- [i]Deprecated.[/i] Use [method property_get_replication_mode] instead.
</description>
</method>
<method name="property_set_replication_mode">
@@ -83,22 +81,20 @@
Sets whether the property identified by the given [param path] is configured to be synchronized on spawn.
</description>
</method>
- <method name="property_set_sync" is_deprecated="true">
+ <method name="property_set_sync" deprecated="Use [method property_set_replication_mode] with [constant REPLICATION_MODE_ALWAYS] instead.">
<return type="void" />
<param index="0" name="path" type="NodePath" />
<param index="1" name="enabled" type="bool" />
<description>
Sets whether the property identified by the given [param path] is configured to be synchronized on process.
- [i]Deprecated.[/i] Use [method property_set_replication_mode] with [constant REPLICATION_MODE_ALWAYS] instead.
</description>
</method>
- <method name="property_set_watch" is_deprecated="true">
+ <method name="property_set_watch" deprecated="Use [method property_set_replication_mode] with [constant REPLICATION_MODE_ON_CHANGE] instead.">
<return type="void" />
<param index="0" name="path" type="NodePath" />
<param index="1" name="enabled" type="bool" />
<description>
Sets whether the property identified by the given [param path] is configured to be reliably synchronized when changes are detected on process.
- [i]Deprecated.[/i] Use [method property_set_replication_mode] with [constant REPLICATION_MODE_ON_CHANGE] instead.
</description>
</method>
<method name="remove_property">
diff --git a/modules/multiplayer/scene_multiplayer.h b/modules/multiplayer/scene_multiplayer.h
index e799abeb48..725cb9dbb6 100644
--- a/modules/multiplayer/scene_multiplayer.h
+++ b/modules/multiplayer/scene_multiplayer.h
@@ -98,7 +98,7 @@ public:
// This is the mask that will be used to extract the command.
enum {
- CMD_MASK = 7, // 0x7 -> 0b00001111
+ CMD_MASK = 7, // 0x7 -> 0b00000111
};
private:
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 8976e218b3..98b3ecdeff 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -6,7 +6,7 @@ import subprocess
from typing import TYPE_CHECKING
if TYPE_CHECKING:
- from SCons import Environment
+ from SCons.Script.SConscript import SConsEnvironment
def get_name():
@@ -51,7 +51,7 @@ def get_min_sdk_version(platform):
return int(platform.split("-")[1])
-def get_android_ndk_root(env):
+def get_android_ndk_root(env: "SConsEnvironment"):
return env["ANDROID_HOME"] + "/ndk/" + get_ndk_version()
@@ -74,7 +74,7 @@ def get_flags():
# Check if Android NDK version is installed
# If not, install it.
-def install_ndk_if_needed(env):
+def install_ndk_if_needed(env: "SConsEnvironment"):
print("Checking for Android NDK...")
sdk_root = env["ANDROID_HOME"]
if not os.path.exists(get_android_ndk_root(env)):
@@ -96,7 +96,7 @@ def install_ndk_if_needed(env):
env["ANDROID_NDK_ROOT"] = get_android_ndk_root(env)
-def configure(env: "Environment"):
+def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["x86_32", "x86_64", "arm32", "arm64"]
if env["arch"] not in supported_arches:
diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp
index d24d3fa389..972a7dbe6a 100644
--- a/platform/android/dir_access_jandroid.cpp
+++ b/platform/android/dir_access_jandroid.cpp
@@ -218,7 +218,7 @@ bool DirAccessJAndroid::dir_exists(String p_dir) {
}
}
-Error DirAccessJAndroid::make_dir_recursive(String p_dir) {
+Error DirAccessJAndroid::make_dir_recursive(const String &p_dir) {
// Check if the directory exists already
if (dir_exists(p_dir)) {
return ERR_ALREADY_EXISTS;
diff --git a/platform/android/dir_access_jandroid.h b/platform/android/dir_access_jandroid.h
index 5ee4c85659..9aaa78f38c 100644
--- a/platform/android/dir_access_jandroid.h
+++ b/platform/android/dir_access_jandroid.h
@@ -77,7 +77,7 @@ public:
virtual bool dir_exists(String p_dir) override;
virtual Error make_dir(String p_dir) override;
- virtual Error make_dir_recursive(String p_dir) override;
+ virtual Error make_dir_recursive(const String &p_dir) override;
virtual Error rename(String p_from, String p_to) override;
virtual Error remove(String p_name) override;
diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
index a0e020b55e..e2e77e7796 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
+++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
@@ -37,6 +37,7 @@ import android.content.*
import android.content.pm.PackageManager
import android.content.res.Configuration
import android.content.res.Resources
+import android.graphics.Color
import android.graphics.Rect
import android.hardware.Sensor
import android.hardware.SensorEvent
@@ -379,6 +380,8 @@ class Godot(private val context: Context) : SensorEventListener {
ViewGroup.LayoutParams.MATCH_PARENT,
activity.resources.getDimension(R.dimen.text_edit_height).toInt()
)
+ // Prevent GodotEditText from showing on splash screen on devices with Android 14 or newer.
+ editText.setBackgroundColor(Color.TRANSPARENT)
// ...add to FrameLayout
containerLayout?.addView(editText)
renderView = if (usesVulkan()) {
diff --git a/platform/android/net_socket_android.cpp b/platform/android/net_socket_android.cpp
index 1299ad032a..a2befdc9be 100644
--- a/platform/android/net_socket_android.cpp
+++ b/platform/android/net_socket_android.cpp
@@ -106,7 +106,7 @@ Error NetSocketAndroid::set_broadcasting_enabled(bool p_enabled) {
return OK;
}
-Error NetSocketAndroid::join_multicast_group(const IPAddress &p_multi_address, String p_if_name) {
+Error NetSocketAndroid::join_multicast_group(const IPAddress &p_multi_address, const String &p_if_name) {
Error err = NetSocketPosix::join_multicast_group(p_multi_address, p_if_name);
if (err != OK) {
return err;
@@ -120,7 +120,7 @@ Error NetSocketAndroid::join_multicast_group(const IPAddress &p_multi_address, S
return OK;
}
-Error NetSocketAndroid::leave_multicast_group(const IPAddress &p_multi_address, String p_if_name) {
+Error NetSocketAndroid::leave_multicast_group(const IPAddress &p_multi_address, const String &p_if_name) {
Error err = NetSocketPosix::leave_multicast_group(p_multi_address, p_if_name);
if (err != OK) {
return err;
diff --git a/platform/android/net_socket_android.h b/platform/android/net_socket_android.h
index f0c2b70529..e5f46d3236 100644
--- a/platform/android/net_socket_android.h
+++ b/platform/android/net_socket_android.h
@@ -67,8 +67,8 @@ public:
virtual void close();
virtual Error set_broadcasting_enabled(bool p_enabled);
- virtual Error join_multicast_group(const IPAddress &p_multi_address, String p_if_name);
- virtual Error leave_multicast_group(const IPAddress &p_multi_address, String p_if_name);
+ virtual Error join_multicast_group(const IPAddress &p_multi_address, const String &p_if_name);
+ virtual Error leave_multicast_group(const IPAddress &p_multi_address, const String &p_if_name);
NetSocketAndroid() {}
~NetSocketAndroid();
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index a86cf43042..82e7fdb320 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -162,7 +162,7 @@ Vector<String> OS_Android::get_granted_permissions() const {
return godot_java->get_granted_permissions();
}
-Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
+Error OS_Android::open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
String path = p_path;
bool so_file_exists = true;
if (!FileAccess::exists(path)) {
@@ -338,7 +338,7 @@ void OS_Android::main_loop_focusin() {
audio_driver_android.set_pause(false);
}
-Error OS_Android::shell_open(String p_uri) {
+Error OS_Android::shell_open(const String &p_uri) {
return godot_io_java->open_uri(p_uri);
}
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index 837ef8bad5..31ee7389df 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -113,7 +113,7 @@ public:
virtual void alert(const String &p_alert, const String &p_title) override;
- virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
+ virtual Error open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
virtual String get_name() const override;
virtual String get_distribution_name() const override;
@@ -134,7 +134,7 @@ public:
void set_native_window(ANativeWindow *p_native_window);
ANativeWindow *get_native_window() const;
- virtual Error shell_open(String p_uri) override;
+ virtual Error shell_open(const String &p_uri) override;
virtual Vector<String> get_system_fonts() const override;
virtual String get_system_font_path(const String &p_font_name, int p_weight = 400, int p_stretch = 100, bool p_italic = false) const override;
diff --git a/platform/ios/detect.py b/platform/ios/detect.py
index f8468e3d9e..9f929ddf0a 100644
--- a/platform/ios/detect.py
+++ b/platform/ios/detect.py
@@ -5,7 +5,7 @@ from methods import detect_darwin_sdk_path
from typing import TYPE_CHECKING
if TYPE_CHECKING:
- from SCons import Environment
+ from SCons.Script.SConscript import SConsEnvironment
def get_name():
@@ -54,7 +54,7 @@ def get_flags():
]
-def configure(env: "Environment"):
+def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["x86_64", "arm64"]
if env["arch"] not in supported_arches:
diff --git a/platform/ios/os_ios.h b/platform/ios/os_ios.h
index 445623f587..10ecd08a89 100644
--- a/platform/ios/os_ios.h
+++ b/platform/ios/os_ios.h
@@ -103,16 +103,16 @@ public:
virtual Vector<String> get_system_font_path_for_text(const String &p_font_name, const String &p_text, const String &p_locale = String(), const String &p_script = String(), int p_weight = 400, int p_stretch = 100, bool p_italic = false) const override;
virtual String get_system_font_path(const String &p_font_name, int p_weight = 400, int p_stretch = 100, bool p_italic = false) const override;
- virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
+ virtual Error open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
virtual Error close_dynamic_library(void *p_library_handle) override;
- virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) override;
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String &p_name, void *&p_symbol_handle, bool p_optional = false) override;
virtual String get_name() const override;
virtual String get_distribution_name() const override;
virtual String get_version() const override;
virtual String get_model_name() const override;
- virtual Error shell_open(String p_uri) override;
+ virtual Error shell_open(const String &p_uri) override;
virtual String get_user_data_dir() const override;
diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm
index 078f8e8494..23614af366 100644
--- a/platform/ios/os_ios.mm
+++ b/platform/ios/os_ios.mm
@@ -219,7 +219,7 @@ _FORCE_INLINE_ String OS_IOS::get_framework_executable(const String &p_path) {
return p_path;
}
-Error OS_IOS::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
+Error OS_IOS::open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
if (p_path.length() == 0) {
// Static xcframework.
p_library_handle = RTLD_SELF;
@@ -272,7 +272,7 @@ Error OS_IOS::close_dynamic_library(void *p_library_handle) {
return OS_Unix::close_dynamic_library(p_library_handle);
}
-Error OS_IOS::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional) {
+Error OS_IOS::get_dynamic_library_symbol_handle(void *p_library_handle, const String &p_name, void *&p_symbol_handle, bool p_optional) {
if (p_library_handle == RTLD_SELF) {
void **ptr = OS_IOS::dynamic_symbol_lookup_table.getptr(p_name);
if (ptr) {
@@ -305,7 +305,7 @@ String OS_IOS::get_model_name() const {
return OS_Unix::get_model_name();
}
-Error OS_IOS::shell_open(String p_uri) {
+Error OS_IOS::shell_open(const String &p_uri) {
NSString *urlPath = [[NSString alloc] initWithUTF8String:p_uri.utf8().get_data()];
NSURL *url = [NSURL URLWithString:urlPath];
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 94784f2da9..8fbd8b10b1 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -7,7 +7,7 @@ from platform_methods import detect_arch
from typing import TYPE_CHECKING
if TYPE_CHECKING:
- from SCons import Environment
+ from SCons.Script.SConscript import SConsEnvironment
def get_name():
@@ -70,7 +70,7 @@ def get_flags():
]
-def configure(env: "Environment"):
+def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64"]
if env["arch"] not in supported_arches:
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index f9e1aca742..4e87dd42dd 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -486,7 +486,7 @@ Vector<String> OS_LinuxBSD::lspci_get_device_value(Vector<String> vendor_device_
return values;
}
-Error OS_LinuxBSD::shell_open(String p_uri) {
+Error OS_LinuxBSD::shell_open(const String &p_uri) {
Error ok;
int err_code;
List<String> args;
diff --git a/platform/linuxbsd/os_linuxbsd.h b/platform/linuxbsd/os_linuxbsd.h
index 6ea2fc8e94..d4ffc0e9b4 100644
--- a/platform/linuxbsd/os_linuxbsd.h
+++ b/platform/linuxbsd/os_linuxbsd.h
@@ -118,7 +118,7 @@ public:
virtual String get_system_dir(SystemDir p_dir, bool p_shared_storage = true) const override;
- virtual Error shell_open(String p_uri) override;
+ virtual Error shell_open(const String &p_uri) override;
virtual String get_unique_id() const override;
virtual String get_processor_name() const override;
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index 54eeb833fa..cfbe9a8ee7 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -6,7 +6,7 @@ from platform_methods import detect_arch, detect_mvk
from typing import TYPE_CHECKING
if TYPE_CHECKING:
- from SCons import Environment
+ from SCons.Script.SConscript import SConsEnvironment
def get_name():
@@ -59,7 +59,7 @@ def get_flags():
]
-def configure(env: "Environment"):
+def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["x86_64", "arm64"]
if env["arch"] not in supported_arches:
diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm
index 344dc1a8f7..165b1e4fbf 100644
--- a/platform/macos/display_server_macos.mm
+++ b/platform/macos/display_server_macos.mm
@@ -699,10 +699,12 @@ DisplayServerMacOS::WindowData &DisplayServerMacOS::get_window(WindowID p_window
}
void DisplayServerMacOS::send_event(NSEvent *p_event) {
- // Special case handling of command-period, which is traditionally a special
- // shortcut in macOS and doesn't arrive at our regular keyDown handler.
+ // Special case handling of shortcuts that don't arrive at the regular keyDown handler
if ([p_event type] == NSEventTypeKeyDown) {
- if ((([p_event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask) == NSEventModifierFlagCommand) && [p_event keyCode] == 0x2f) {
+ NSEventModifierFlags flags = [p_event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask;
+
+ // Command-period
+ if ((flags == NSEventModifierFlagCommand) && [p_event keyCode] == 0x2f) {
Ref<InputEventKey> k;
k.instantiate();
@@ -715,6 +717,24 @@ void DisplayServerMacOS::send_event(NSEvent *p_event) {
k->set_echo([p_event isARepeat]);
Input::get_singleton()->parse_input_event(k);
+ return;
+ }
+
+ // Ctrl+Tab and Ctrl+Shift+Tab
+ if (((flags == NSEventModifierFlagControl) || (flags == (NSEventModifierFlagControl | NSEventModifierFlagShift))) && [p_event keyCode] == 0x30) {
+ Ref<InputEventKey> k;
+ k.instantiate();
+
+ get_key_modifier_state([p_event modifierFlags], k);
+ k->set_window_id(DisplayServerMacOS::INVALID_WINDOW_ID);
+ k->set_pressed(true);
+ k->set_keycode(Key::TAB);
+ k->set_physical_keycode(Key::TAB);
+ k->set_key_label(Key::TAB);
+ k->set_echo([p_event isARepeat]);
+
+ Input::get_singleton()->parse_input_event(k);
+ return;
}
}
}
diff --git a/platform/macos/os_macos.h b/platform/macos/os_macos.h
index ae94b6296d..9b20e51f47 100644
--- a/platform/macos/os_macos.h
+++ b/platform/macos/os_macos.h
@@ -85,7 +85,7 @@ public:
virtual void alert(const String &p_alert, const String &p_title = "ALERT!") override;
- virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
+ virtual Error open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
virtual MainLoop *get_main_loop() const override;
@@ -98,7 +98,7 @@ public:
virtual String get_system_dir(SystemDir p_dir, bool p_shared_storage = true) const override;
- virtual Error shell_open(String p_uri) override;
+ virtual Error shell_open(const String &p_uri) override;
virtual Error shell_show_in_file_manager(String p_path, bool p_open_folder) override;
virtual String get_locale() const override;
diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm
index 80c9f1b422..934767db74 100644
--- a/platform/macos/os_macos.mm
+++ b/platform/macos/os_macos.mm
@@ -217,7 +217,7 @@ _FORCE_INLINE_ String OS_MacOS::get_framework_executable(const String &p_path) {
return p_path;
}
-Error OS_MacOS::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
+Error OS_MacOS::open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
String path = get_framework_executable(p_path);
if (!FileAccess::exists(path)) {
@@ -353,7 +353,7 @@ Error OS_MacOS::shell_show_in_file_manager(String p_path, bool p_open_folder) {
return OK;
}
-Error OS_MacOS::shell_open(String p_uri) {
+Error OS_MacOS::shell_open(const String &p_uri) {
NSString *string = [NSString stringWithUTF8String:p_uri.utf8().get_data()];
NSURL *uri = [[NSURL alloc] initWithString:string];
if (!uri || !uri.scheme || [uri.scheme isEqual:@"file"]) {
diff --git a/platform/web/detect.py b/platform/web/detect.py
index bbe1634dfa..7d9b1de6b7 100644
--- a/platform/web/detect.py
+++ b/platform/web/detect.py
@@ -15,7 +15,7 @@ from SCons.Util import WhereIs
from typing import TYPE_CHECKING
if TYPE_CHECKING:
- from SCons import Environment
+ from SCons.Script.SConscript import SConsEnvironment
def get_name():
@@ -81,7 +81,7 @@ def get_flags():
]
-def configure(env: "Environment"):
+def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["wasm32"]
if env["arch"] not in supported_arches:
diff --git a/platform/web/os_web.cpp b/platform/web/os_web.cpp
index cbdcbf565d..45671ca491 100644
--- a/platform/web/os_web.cpp
+++ b/platform/web/os_web.cpp
@@ -150,7 +150,7 @@ String OS_Web::get_executable_path() const {
return OS::get_executable_path();
}
-Error OS_Web::shell_open(String p_uri) {
+Error OS_Web::shell_open(const String &p_uri) {
// Open URI in a new tab, browser will deal with it by protocol.
godot_js_os_shell_open(p_uri.utf8().get_data());
return OK;
@@ -239,7 +239,7 @@ bool OS_Web::is_userfs_persistent() const {
return idb_available;
}
-Error OS_Web::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
+Error OS_Web::open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
String path = p_path.get_file();
p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW);
ERR_FAIL_NULL_V_MSG(p_library_handle, ERR_CANT_OPEN, vformat("Can't open dynamic library: %s. Error: %s.", p_path, dlerror()));
diff --git a/platform/web/os_web.h b/platform/web/os_web.h
index 5a48997c17..e578c93925 100644
--- a/platform/web/os_web.h
+++ b/platform/web/os_web.h
@@ -89,7 +89,7 @@ public:
int get_default_thread_pool_size() const override { return 1; }
String get_executable_path() const override;
- Error shell_open(String p_uri) override;
+ Error shell_open(const String &p_uri) override;
String get_name() const override;
// Override default OS implementation which would block the main thread with delay_usec.
@@ -107,7 +107,7 @@ public:
void alert(const String &p_alert, const String &p_title = "ALERT!") override;
- Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
+ Error open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
void resume_audio();
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 0619e62563..f536c1ac27 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -7,7 +7,7 @@ from platform_methods import detect_arch
from typing import TYPE_CHECKING
if TYPE_CHECKING:
- from SCons import Environment
+ from SCons.Script.SConscript import SConsEnvironment
# To match other platforms
STACK_SIZE = 8388608
@@ -251,7 +251,7 @@ def get_flags():
]
-def build_res_file(target, source, env):
+def build_res_file(target, source, env: "SConsEnvironment"):
arch_aliases = {
"x86_32": "pe-i386",
"x86_64": "pe-x86-64",
@@ -286,7 +286,7 @@ def build_res_file(target, source, env):
return 0
-def setup_msvc_manual(env):
+def setup_msvc_manual(env: "SConsEnvironment"):
"""Running from VCVARS environment"""
env_arch = detect_build_env_arch()
@@ -303,7 +303,7 @@ def setup_msvc_manual(env):
print("Found MSVC, arch %s" % (env_arch))
-def setup_msvc_auto(env):
+def setup_msvc_auto(env: "SConsEnvironment"):
"""Set up MSVC using SCons's auto-detection logic"""
# If MSVC_VERSION is set by SCons, we know MSVC is installed.
@@ -339,7 +339,7 @@ def setup_msvc_auto(env):
print("Found MSVC version %s, arch %s" % (env["MSVC_VERSION"], env["arch"]))
-def setup_mingw(env):
+def setup_mingw(env: "SConsEnvironment"):
"""Set up env for use with mingw"""
env_arch = detect_build_env_arch()
@@ -374,7 +374,7 @@ def setup_mingw(env):
print("Using MinGW, arch %s" % (env["arch"]))
-def configure_msvc(env, vcvars_msvc_config):
+def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
"""Configure env to work with MSVC"""
## Build type
@@ -417,7 +417,7 @@ def configure_msvc(env, vcvars_msvc_config):
if vcvars_msvc_config: # should be automatic if SCons found it
if os.getenv("WindowsSdkDir") is not None:
- env.Prepend(CPPPATH=[os.getenv("WindowsSdkDir") + "/Include"])
+ env.Prepend(CPPPATH=[str(os.getenv("WindowsSdkDir")) + "/Include"])
else:
print("Missing environment variable: WindowsSdkDir")
@@ -522,7 +522,7 @@ def configure_msvc(env, vcvars_msvc_config):
if vcvars_msvc_config:
if os.getenv("WindowsSdkDir") is not None:
- env.Append(LIBPATH=[os.getenv("WindowsSdkDir") + "/Lib"])
+ env.Append(LIBPATH=[str(os.getenv("WindowsSdkDir")) + "/Lib"])
else:
print("Missing environment variable: WindowsSdkDir")
@@ -543,8 +543,8 @@ def configure_msvc(env, vcvars_msvc_config):
env.AppendUnique(LINKFLAGS=["/LTCG"])
if vcvars_msvc_config:
- env.Prepend(CPPPATH=[p for p in os.getenv("INCLUDE").split(";")])
- env.Append(LIBPATH=[p for p in os.getenv("LIB").split(";")])
+ env.Prepend(CPPPATH=[p for p in str(os.getenv("INCLUDE")).split(";")])
+ env.Append(LIBPATH=[p for p in str(os.getenv("LIB")).split(";")])
# Sanitizers
if env["use_asan"]:
@@ -560,7 +560,7 @@ def configure_msvc(env, vcvars_msvc_config):
env.AppendUnique(LINKFLAGS=["/STACK:" + str(STACK_SIZE)])
-def configure_mingw(env):
+def configure_mingw(env: "SConsEnvironment"):
# Workaround for MinGW. See:
# https://www.scons.org/wiki/LongCmdLinesOnWin32
env.use_windows_spawn_fix()
@@ -747,7 +747,7 @@ def configure_mingw(env):
env.Append(BUILDERS={"RES": env.Builder(action=build_res_file, suffix=".o", src_suffix=".rc")})
-def configure(env: "Environment"):
+def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["x86_32", "x86_64", "arm32", "arm64"]
if env["arch"] not in supported_arches:
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 7d96bded14..72c07c3337 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -3452,6 +3452,10 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
}
if (wParam != WA_INACTIVE) {
track_mouse_leave_event(hWnd);
+
+ if (!IsIconic(hWnd)) {
+ SetFocus(hWnd);
+ }
}
return 0; // Return to the message loop.
} break;
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 6ad616da85..93d1ffeac1 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -352,7 +352,7 @@ void debug_dynamic_library_check_dependencies(const String &p_root_path, const S
}
#endif
-Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
+Error OS_Windows::open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
String path = p_path.replace("/", "\\");
if (!FileAccess::exists(path)) {
@@ -418,7 +418,7 @@ Error OS_Windows::close_dynamic_library(void *p_library_handle) {
return OK;
}
-Error OS_Windows::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional) {
+Error OS_Windows::get_dynamic_library_symbol_handle(void *p_library_handle, const String &p_name, void *&p_symbol_handle, bool p_optional) {
p_symbol_handle = (void *)GetProcAddress((HMODULE)p_library_handle, p_name.utf8().get_data());
if (!p_symbol_handle) {
if (!p_optional) {
@@ -1333,7 +1333,7 @@ String OS_Windows::get_stdin_string() {
return String();
}
-Error OS_Windows::shell_open(String p_uri) {
+Error OS_Windows::shell_open(const String &p_uri) {
INT_PTR ret = (INT_PTR)ShellExecuteW(nullptr, nullptr, (LPCWSTR)(p_uri.utf16().get_data()), nullptr, nullptr, SW_SHOWNORMAL);
if (ret > 32) {
return OK;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 056696ae2f..7e7d23a2a8 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -155,9 +155,9 @@ public:
virtual Error get_entropy(uint8_t *r_buffer, int p_bytes) override;
- virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
+ virtual Error open_dynamic_library(const String &p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr) override;
virtual Error close_dynamic_library(void *p_library_handle) override;
- virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) override;
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String &p_name, void *&p_symbol_handle, bool p_optional = false) override;
virtual MainLoop *get_main_loop() const override;
@@ -213,7 +213,7 @@ public:
virtual String get_unique_id() const override;
- virtual Error shell_open(String p_uri) override;
+ virtual Error shell_open(const String &p_uri) override;
virtual Error shell_show_in_file_manager(String p_path, bool p_open_folder) override;
void run();
diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp
index 76bd8c5413..12e0123242 100644
--- a/scene/3d/path_3d.cpp
+++ b/scene/3d/path_3d.cpp
@@ -50,6 +50,10 @@ Path3D::~Path3D() {
}
}
+void Path3D::set_update_callback(Callable p_callback) {
+ update_callback = p_callback;
+}
+
void Path3D::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
@@ -67,8 +71,12 @@ void Path3D::_notification(int p_what) {
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
- if (is_inside_tree() && debug_instance.is_valid()) {
- RS::get_singleton()->instance_set_transform(debug_instance, get_global_transform());
+ if (is_inside_tree()) {
+ if (debug_instance.is_valid()) {
+ RS::get_singleton()->instance_set_transform(debug_instance, get_global_transform());
+ }
+
+ update_callback.call();
}
} break;
}
diff --git a/scene/3d/path_3d.h b/scene/3d/path_3d.h
index 076af95ebc..82fbf60bb6 100644
--- a/scene/3d/path_3d.h
+++ b/scene/3d/path_3d.h
@@ -37,15 +37,15 @@
class Path3D : public Node3D {
GDCLASS(Path3D, Node3D);
+private:
Ref<Curve3D> curve;
-
- void _curve_changed();
-
RID debug_instance;
Ref<ArrayMesh> debug_mesh;
-private:
+ Callable update_callback; // Used only by CSG currently.
+
void _update_debug_mesh();
+ void _curve_changed();
protected:
void _notification(int p_what);
@@ -53,6 +53,8 @@ protected:
static void _bind_methods();
public:
+ void set_update_callback(Callable p_callback);
+
void set_curve(const Ref<Curve3D> &p_curve);
Ref<Curve3D> get_curve() const;
diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp
index 3290738b40..3b51f5274a 100644
--- a/servers/rendering/rendering_device.cpp
+++ b/servers/rendering/rendering_device.cpp
@@ -4983,7 +4983,7 @@ Error RenderingDevice::initialize(RenderingContextDriver *p_context, DisplayServ
}
// Output our device version.
- print_line(vformat("%s %s - %s - Using Device #%d: %s - %s", get_device_api_name(), get_device_api_version(), rendering_method, device_index, _get_device_vendor_name(device), device.name));
+ Engine::get_singleton()->print_header(vformat("%s %s - %s - Using Device #%d: %s - %s", get_device_api_name(), get_device_api_version(), rendering_method, device_index, _get_device_vendor_name(device), device.name));
}
// Pick the main queue family. It is worth noting we explicitly do not request the transfer bit, as apparently the specification defines
diff --git a/tests/core/test_crypto.h b/tests/core/test_crypto.h
index 2fd26c3d6b..a7c2fce589 100644
--- a/tests/core/test_crypto.h
+++ b/tests/core/test_crypto.h
@@ -39,13 +39,13 @@ namespace TestCrypto {
class _MockCrypto : public Crypto {
virtual PackedByteArray generate_random_bytes(int p_bytes) { return PackedByteArray(); }
virtual Ref<CryptoKey> generate_rsa(int p_bytes) { return nullptr; }
- virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after) { return nullptr; }
+ virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, const String &p_issuer_name, const String &p_not_before, const String &p_not_after) { return nullptr; }
- virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Ref<CryptoKey> p_key) { return Vector<uint8_t>(); }
- virtual bool verify(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Vector<uint8_t> p_signature, Ref<CryptoKey> p_key) { return false; }
- virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_plaintext) { return Vector<uint8_t>(); }
- virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_ciphertext) { return Vector<uint8_t>(); }
- virtual PackedByteArray hmac_digest(HashingContext::HashType p_hash_type, PackedByteArray p_key, PackedByteArray p_msg) { return PackedByteArray(); }
+ virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, Ref<CryptoKey> p_key) { return Vector<uint8_t>(); }
+ virtual bool verify(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, const Vector<uint8_t> &p_signature, Ref<CryptoKey> p_key) { return false; }
+ virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_plaintext) { return Vector<uint8_t>(); }
+ virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_ciphertext) { return Vector<uint8_t>(); }
+ virtual PackedByteArray hmac_digest(HashingContext::HashType p_hash_type, const PackedByteArray &p_key, const PackedByteArray &p_msg) { return PackedByteArray(); }
};
PackedByteArray raw_to_pba(const uint8_t *arr, size_t len) {