summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/classes/Dictionary.xml36
-rw-r--r--doc/classes/Time.xml4
-rw-r--r--editor/filesystem_dock.cpp4
-rw-r--r--servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler_raster.glsl2
4 files changed, 43 insertions, 3 deletions
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index b39c5c9699..955d80fcb7 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -294,6 +294,42 @@
<param index="1" name="overwrite" type="bool" default="false" />
<description>
Adds entries from [param dictionary] to this dictionary. By default, duplicate keys are not copied over, unless [param overwrite] is [code]true[/code].
+ [codeblocks]
+ [gdscript]
+ var dict = { "item": "sword", "quantity": 2 }
+ var other_dict = { "quantity": 15, "color": "silver" }
+
+ # Overwriting of existing keys is disabled by default.
+ dict.merge(other_dict)
+ print(dict) # { "item": "sword", "quantity": 2, "color": "silver" }
+
+ # With overwriting of existing keys enabled.
+ dict.merge(other_dict, true)
+ print(dict) # { "item": "sword", "quantity": 15, "color": "silver" }
+ [/gdscript]
+ [csharp]
+ var dict = new Godot.Collections.Dictionary
+ {
+ ["item"] = "sword",
+ ["quantity"] = 2,
+ };
+
+ var otherDict = new Godot.Collections.Dictionary
+ {
+ ["quantity"] = 15,
+ ["color"] = "silver",
+ };
+
+ // Overwriting of existing keys is disabled by default.
+ dict.Merge(otherDict);
+ GD.Print(dict); // { "item": "sword", "quantity": 2, "color": "silver" }
+
+ // With overwriting of existing keys enabled.
+ dict.Merge(otherDict, true);
+ GD.Print(dict); // { "item": "sword", "quantity": 15, "color": "silver" }
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] [method merge] is [i]not[/i] recursive. Nested dictionaries are considered as keys that can be overwritten or not depending on the value of [param overwrite], but they will never be merged together.
</description>
</method>
<method name="size" qualifiers="const">
diff --git a/doc/classes/Time.xml b/doc/classes/Time.xml
index 9dc567562a..0313381ff0 100644
--- a/doc/classes/Time.xml
+++ b/doc/classes/Time.xml
@@ -152,7 +152,9 @@
<method name="get_time_zone_from_system" qualifiers="const">
<return type="Dictionary" />
<description>
- Returns the current time zone as a dictionary of keys: [code]bias[/code] and [code]name[/code]. The [code]bias[/code] value is the offset from UTC in minutes, since not all time zones are multiples of an hour from UTC.
+ Returns the current time zone as a dictionary of keys: [code]bias[/code] and [code]name[/code].
+ - [code]bias[/code] is the offset from UTC in minutes, since not all time zones are multiples of an hour from UTC.
+ - [code]name[/code] is localized according to the current user default UI language.
</description>
</method>
<method name="get_unix_time_from_datetime_dict" qualifiers="const">
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index ea043b42d1..0aa8ef66e7 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1790,7 +1790,9 @@ void FileSystemDock::_rename_operation_confirm() {
}
if (new_exist) {
EditorNode::get_singleton()->show_warning(TTR("A file or folder with this name already exists."));
- ti->set_text(col_index, old_name);
+ if (ti) {
+ ti->set_text(col_index, old_name);
+ }
return;
}
diff --git a/servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler_raster.glsl b/servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler_raster.glsl
index 7b3c2f1c3b..6c77ab4a91 100644
--- a/servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler_raster.glsl
+++ b/servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler_raster.glsl
@@ -33,7 +33,7 @@ layout(location = 0) out vec2 uv_interp;
void main() {
vec2 base_arr[3] = vec2[](vec2(-1.0, -1.0), vec2(-1.0, 3.0), vec2(3.0, -1.0));
gl_Position = vec4(base_arr[gl_VertexIndex], 0.0, 1.0);
- uv_interp = clamp(gl_Position.xy, vec2(0.0, 0.0), vec2(1.0, 1.0)) * 2.0; // saturate(x) * 2.0
+ uv_interp = clamp(gl_Position.xy, vec2(0.0, 0.0), vec2(1.0, 1.0)) * 2.0 * float(params.face_size); // saturate(x) * 2.0
}
/* clang-format off */