summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/BakedLightmap.xml2
-rw-r--r--doc/classes/TileMap.xml12
-rw-r--r--editor/filesystem_dock.cpp10
3 files changed, 13 insertions, 11 deletions
diff --git a/doc/classes/BakedLightmap.xml b/doc/classes/BakedLightmap.xml
index 571a6fde80..4baf3a6bb2 100644
--- a/doc/classes/BakedLightmap.xml
+++ b/doc/classes/BakedLightmap.xml
@@ -31,6 +31,8 @@
<member name="bake_cell_size" type="float" setter="set_bake_cell_size" getter="get_bake_cell_size" default="0.25">
Grid subdivision size for lightmapper calculation. The default value will work for most cases. Increase for better lighting on small details or if your scene is very large.
</member>
+ <member name="bake_default_texels_per_unit" type="float" setter="set_bake_default_texels_per_unit" getter="get_bake_default_texels_per_unit" default="20.0">
+ </member>
<member name="bake_energy" type="float" setter="set_energy" getter="get_energy" default="1.0">
</member>
<member name="bake_extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 10, 10, 10 )">
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index a0111d3262..3f9c2e8647 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -274,12 +274,7 @@
<member name="cell_y_sort" type="bool" setter="set_y_sort_mode" getter="is_y_sort_mode_enabled" default="false">
If [code]true[/code], the TileMap's children will be drawn in order of their Y coordinate.
</member>
- <member name="compatibility_mode" type="bool" setter="set_compatibility_mode" getter="is_compatibility_mode_enabled">
- If [code]true[/code], the compatibility with the tilemaps made in Godot 3.1 or earlier is maintained (textures move when the tile origin changes and rotate if the texture size is not homogeneous). This mode presents problems when doing [code]flip_h[/code], [code]flip_v[/code] and [code]transpose[/code] tile operations on non-homogeneous isometric tiles (e.g. 2:1), in which the texture could not coincide with the collision, thus it is not recommended for isometric or non-square tiles.
- If [code]false[/code], the textures do not move when doing [code]flip_h[/code], [code]flip_v[/code] operations if no offset is used, nor when changing the tile origin.
- The compatibility mode doesn't work with the [member centered_textures] option, because displacing textures with the [member cell_tile_origin] option or in irregular tiles is not relevant when centering those textures.
- </member>
- <member name="centered_textures" type="bool" setter="set_centered_textures" getter="is_centered_textures_enabled">
+ <member name="centered_textures" type="bool" setter="set_centered_textures" getter="is_centered_textures_enabled" default="false">
If [code]true[/code], the textures will be centered in the middle of each tile. This is useful for certain isometric or top-down modes when textures are made larger or smaller than the tiles (e.g. to avoid flickering on tile edges). The offset is still applied, but from the center of the tile. If used, [member compatibility_mode] is ignored.
If [code]false[/code], the texture position start in the top-left corner unless [member compatibility_mode] is enabled.
</member>
@@ -300,6 +295,11 @@
</member>
<member name="collision_use_parent" type="bool" setter="set_collision_use_parent" getter="get_collision_use_parent" default="false">
</member>
+ <member name="compatibility_mode" type="bool" setter="set_compatibility_mode" getter="is_compatibility_mode_enabled" default="false">
+ If [code]true[/code], the compatibility with the tilemaps made in Godot 3.1 or earlier is maintained (textures move when the tile origin changes and rotate if the texture size is not homogeneous). This mode presents problems when doing [code]flip_h[/code], [code]flip_v[/code] and [code]transpose[/code] tile operations on non-homogeneous isometric tiles (e.g. 2:1), in which the texture could not coincide with the collision, thus it is not recommended for isometric or non-square tiles.
+ If [code]false[/code], the textures do not move when doing [code]flip_h[/code], [code]flip_v[/code] operations if no offset is used, nor when changing the tile origin.
+ The compatibility mode doesn't work with the [member centered_textures] option, because displacing textures with the [member cell_tile_origin] option or in irregular tiles is not relevant when centering those textures.
+ </member>
<member name="mode" type="int" setter="set_mode" getter="get_mode" enum="TileMap.Mode" default="0">
The TileMap orientation mode. See [enum Mode] for possible values.
</member>
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 9301d8c1a4..b74350c98b 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1324,14 +1324,14 @@ void FileSystemDock::_duplicate_operation_confirm() {
return;
}
- String new_path;
String base_dir = to_duplicate.path.get_base_dir();
- if (to_duplicate.is_file) {
- new_path = base_dir.plus_file(new_name);
- } else {
- new_path = base_dir.substr(0, base_dir.find_last("/")).plus_file(new_name);
+ // get_base_dir() returns "some/path" if the original path was "some/path/", so work it around.
+ if (to_duplicate.path.ends_with("/")) {
+ base_dir = base_dir.get_base_dir();
}
+ String new_path = base_dir.plus_file(new_name);
+
//Present a more user friendly warning for name conflict
DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
if (da->file_exists(new_path) || da->dir_exists(new_path)) {