diff --git a/src/Classes/ImageEffect.gd b/src/Classes/ImageEffect.gd index 5efec7fe0..05abe63df 100644 --- a/src/Classes/ImageEffect.gd +++ b/src/Classes/ImageEffect.gd @@ -157,7 +157,10 @@ func display_animate_dialog() -> void: func _commit_undo(action: String, undo_data: Dictionary, project: Project) -> void: - project.update_tilemaps(undo_data) + var tile_editing_mode := TileSetPanel.tile_editing_mode + if tile_editing_mode == TileSetPanel.TileEditingMode.MANUAL: + tile_editing_mode = TileSetPanel.TileEditingMode.AUTO + project.update_tilemaps(undo_data, tile_editing_mode) var redo_data := _get_undo_data(project) project.undos += 1 project.undo_redo.create_action(action) diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index 387883113..d8cb9d59d 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -1015,7 +1015,9 @@ func add_tileset(tileset: TileSetCustom) -> void: ## Loops through all cels in [param cel_dictionary], and for [CelTileMap]s, ## it calls [method CelTileMap.update_tilemap]. -func update_tilemaps(cel_dictionary: Dictionary) -> void: +func update_tilemaps( + cel_dictionary: Dictionary, tile_editing_mode := TileSetPanel.tile_editing_mode +) -> void: for cel in cel_dictionary: if cel is CelTileMap: - (cel as CelTileMap).update_tilemap() + (cel as CelTileMap).update_tilemap(tile_editing_mode) diff --git a/src/Tools/UtilityTools/Move.gd b/src/Tools/UtilityTools/Move.gd index 437c2484a..4cb8f73a2 100644 --- a/src/Tools/UtilityTools/Move.gd +++ b/src/Tools/UtilityTools/Move.gd @@ -131,7 +131,7 @@ func _snap_position(pos: Vector2) -> Vector2: func _commit_undo(action: String) -> void: var project := Global.current_project - project.update_tilemaps(_undo_data) + project.update_tilemaps(_undo_data, TileSetPanel.TileEditingMode.AUTO) var redo_data := _get_undo_data() var frame := -1 var layer := -1 diff --git a/src/UI/Canvas/Selection.gd b/src/UI/Canvas/Selection.gd index e602ffaad..97fbec396 100644 --- a/src/UI/Canvas/Selection.gd +++ b/src/UI/Canvas/Selection.gd @@ -629,7 +629,7 @@ func commit_undo(action: String, undo_data_tmp: Dictionary) -> void: print("No undo data found!") return var project := Global.current_project - project.update_tilemaps(undo_data_tmp) + project.update_tilemaps(undo_data_tmp, TileSetPanel.TileEditingMode.AUTO) var redo_data := get_undo_data(undo_data_tmp["undo_image"]) project.undos += 1 project.undo_redo.create_action(action) diff --git a/src/UI/Dialogs/ImageEffects/FlipImageDialog.gd b/src/UI/Dialogs/ImageEffects/FlipImageDialog.gd index 51aee6e2e..592273867 100644 --- a/src/UI/Dialogs/ImageEffects/FlipImageDialog.gd +++ b/src/UI/Dialogs/ImageEffects/FlipImageDialog.gd @@ -47,7 +47,10 @@ func _flip_image(cel: Image, affect_selection: bool, project: Project) -> void: func _commit_undo(action: String, undo_data: Dictionary, project: Project) -> void: _flip_selection(project) - project.update_tilemaps(undo_data) + var tile_editing_mode := TileSetPanel.tile_editing_mode + if tile_editing_mode == TileSetPanel.TileEditingMode.MANUAL: + tile_editing_mode = TileSetPanel.TileEditingMode.AUTO + project.update_tilemaps(undo_data, tile_editing_mode) var redo_data := _get_undo_data(project) project.undos += 1 project.undo_redo.create_action(action) diff --git a/src/UI/Timeline/LayerEffects/LayerEffectsSettings.gd b/src/UI/Timeline/LayerEffects/LayerEffectsSettings.gd index 802509522..7aac6ca81 100644 --- a/src/UI/Timeline/LayerEffects/LayerEffectsSettings.gd +++ b/src/UI/Timeline/LayerEffects/LayerEffectsSettings.gd @@ -165,7 +165,10 @@ func _apply_effect(layer: BaseLayer, effect: LayerEffect) -> void: var shader_image_effect := ShaderImageEffect.new() shader_image_effect.generate_image(cel_image, effect.shader, effect.params, image_size) - project.update_tilemaps(undo_data) + var tile_editing_mode := TileSetPanel.tile_editing_mode + if tile_editing_mode == TileSetPanel.TileEditingMode.MANUAL: + tile_editing_mode = TileSetPanel.TileEditingMode.AUTO + project.update_tilemaps(undo_data, tile_editing_mode) for frame in project.frames: var cel := frame.cels[layer.index] var cel_image := cel.get_image() diff --git a/src/UI/TopMenuContainer/TopMenuContainer.gd b/src/UI/TopMenuContainer/TopMenuContainer.gd index 7f78eba23..f0867343b 100644 --- a/src/UI/TopMenuContainer/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer/TopMenuContainer.gd @@ -734,7 +734,7 @@ func _color_mode_submenu_id_pressed(id: ColorModes) -> void: project.color_mode = Image.FORMAT_RGBA8 else: project.color_mode = Project.INDEXED_MODE - project.update_tilemaps(undo_data) + project.update_tilemaps(undo_data, TileSetPanel.TileEditingMode.AUTO) project.serialize_cel_undo_data(pixel_cels, redo_data) project.undo_redo.create_action("Change color mode") project.undos += 1