From 5488fef3af3b43a2693f4ed9d9b2c2c38d408100 Mon Sep 17 00:00:00 2001 From: Adriaan de Jongh <5611323+AdriaandeJongh@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:18:42 +0200 Subject: [PATCH] Clarify that Resource.duplicate(true) doesn't duplicate subresources inside Array or Dictionary properties --- doc/classes/Resource.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index cec936ac3e6..74d083594f2 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -40,8 +40,11 @@ Duplicates this resource, returning a new resource with its [code]export[/code]ed or [constant PROPERTY_USAGE_STORAGE] properties copied from the original. - If [param subresources] is [code]false[/code], a shallow copy is returned; nested resources within subresources are not duplicated and are shared from the original resource. If [param subresources] is [code]true[/code], a deep copy is returned; nested subresources will be duplicated and are not shared. - Subresource properties with the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag are always duplicated even with [param subresources] set to [code]false[/code], and properties with the [constant PROPERTY_USAGE_NEVER_DUPLICATE] flag are never duplicated even with [param subresources] set to [code]true[/code]. + If [param subresources] is [code]false[/code], a shallow copy is returned; nested resources within subresources are not duplicated and are shared with the original resource (with one exception; see below). If [param subresources] is [code]true[/code], a deep copy is returned; nested subresources will be duplicated and are not shared (with two exceptions; see below). + [param subresources] is usually respected, with the following exceptions: + - Subresource properties with the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag are always duplicated. + - Subresource properties with the [constant PROPERTY_USAGE_NEVER_DUPLICATE] flag are never duplicated. + - Subresources inside [Array] and [Dictionary] properties are never duplicated. [b]Note:[/b] For custom resources, this method will fail if [method Object._init] has been defined with required parameters.