mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Compare commits
1 commit
a993d7b1be
...
63d6703687
Author | SHA1 | Date | |
---|---|---|---|
63d6703687 |
|
@ -10,7 +10,7 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Language-Team: Spanish\n"
|
"Language-Team: Spanish\n"
|
||||||
"Language: es_ES\n"
|
"Language: es_ES\n"
|
||||||
"PO-Revision-Date: 2024-12-10 15:24\n"
|
"PO-Revision-Date: 2024-12-05 02:11\n"
|
||||||
|
|
||||||
msgid "OK"
|
msgid "OK"
|
||||||
msgstr "OK"
|
msgstr "OK"
|
||||||
|
@ -2314,7 +2314,7 @@ msgstr "Agrupar"
|
||||||
|
|
||||||
#. A tilemap is a type of layer, which is divided by grid cells, the size of which is determined by the tileset it uses. Each grid cell is mapped to a tile in the tileset. Tilemaps can be used to create game levels and layouts.
|
#. A tilemap is a type of layer, which is divided by grid cells, the size of which is determined by the tileset it uses. Each grid cell is mapped to a tile in the tileset. Tilemaps can be used to create game levels and layouts.
|
||||||
msgid "Tilemap"
|
msgid "Tilemap"
|
||||||
msgstr "Tilemap"
|
msgstr ""
|
||||||
|
|
||||||
msgid "Layers"
|
msgid "Layers"
|
||||||
msgstr "Capas"
|
msgstr "Capas"
|
||||||
|
@ -2346,7 +2346,7 @@ msgstr "Agregar nueva capa 3D"
|
||||||
#. One of the options of the create new layer button.
|
#. One of the options of the create new layer button.
|
||||||
#: src/UI/Timeline/AnimationTimeline.tscn
|
#: src/UI/Timeline/AnimationTimeline.tscn
|
||||||
msgid "Add Tilemap Layer"
|
msgid "Add Tilemap Layer"
|
||||||
msgstr "Añadir capa de Tilemap"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/Timeline/AnimationTimeline.tscn
|
#: src/UI/Timeline/AnimationTimeline.tscn
|
||||||
msgid "Remove current layer"
|
msgid "Remove current layer"
|
||||||
|
@ -3056,7 +3056,7 @@ msgstr "Grabador"
|
||||||
|
|
||||||
#. Tiles are images of a specific shape, usually rectangular, that are laid out in a grid. They are used in tile-based video games. https://en.wikipedia.org/wiki/Tile-based_video_game
|
#. Tiles are images of a specific shape, usually rectangular, that are laid out in a grid. They are used in tile-based video games. https://en.wikipedia.org/wiki/Tile-based_video_game
|
||||||
msgid "Tiles"
|
msgid "Tiles"
|
||||||
msgstr "Mosaicos"
|
msgstr ""
|
||||||
|
|
||||||
msgid "Crop"
|
msgid "Crop"
|
||||||
msgstr "Recortar"
|
msgstr "Recortar"
|
||||||
|
@ -3467,47 +3467,47 @@ msgstr "¿Deseas descargar la imagen desde %s?"
|
||||||
#: src/Classes/TileSetCustom.gd
|
#: src/Classes/TileSetCustom.gd
|
||||||
#: src/UI/Dialogs/ImportPreviewDialog.gd
|
#: src/UI/Dialogs/ImportPreviewDialog.gd
|
||||||
msgid "Tileset"
|
msgid "Tileset"
|
||||||
msgstr "Set de mosaicos"
|
msgstr ""
|
||||||
|
|
||||||
#. A tileset is a collection of tiles.
|
#. A tileset is a collection of tiles.
|
||||||
#: src/UI/Timeline/NewTileMapLayerDialog.tscn
|
#: src/UI/Timeline/NewTileMapLayerDialog.tscn
|
||||||
msgid "Tileset:"
|
msgid "Tileset:"
|
||||||
msgstr "Tileset:"
|
msgstr ""
|
||||||
|
|
||||||
#. A tileset is a collection of tiles.
|
#. A tileset is a collection of tiles.
|
||||||
#: src/UI/Dialogs/ProjectProperties.tscn
|
#: src/UI/Dialogs/ProjectProperties.tscn
|
||||||
msgid "Tilesets"
|
msgid "Tilesets"
|
||||||
msgstr "Tilesets"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/Timeline/NewTileMapLayerDialog.tscn
|
#: src/UI/Timeline/NewTileMapLayerDialog.tscn
|
||||||
msgid "New tileset"
|
msgid "New tileset"
|
||||||
msgstr "Nuevo tileset"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/Timeline/NewTileMapLayerDialog.tscn
|
#: src/UI/Timeline/NewTileMapLayerDialog.tscn
|
||||||
msgid "Tileset name:"
|
msgid "Tileset name:"
|
||||||
msgstr "Nombre del tileset:"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/Timeline/NewTileMapLayerDialog.tscn
|
#: src/UI/Timeline/NewTileMapLayerDialog.tscn
|
||||||
msgid "Tile size:"
|
msgid "Tile size:"
|
||||||
msgstr "Tamaño de mosaico:"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/TilesPanel.tscn
|
#: src/UI/TilesPanel.tscn
|
||||||
msgid "Draw tiles"
|
msgid "Draw tiles"
|
||||||
msgstr "Dibujar mosaicos"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/TilesPanel.tscn
|
#: src/UI/TilesPanel.tscn
|
||||||
msgid "Rotate tile left (counterclockwise)"
|
msgid "Rotate tile left (counterclockwise)"
|
||||||
msgstr "Rotar mosaico a la izquierda (en sentido antihorario)"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/TilesPanel.tscn
|
#: src/UI/TilesPanel.tscn
|
||||||
msgid "Rotate tile right (clockwise)"
|
msgid "Rotate tile right (clockwise)"
|
||||||
msgstr "Rotar mosaico a la derecha (en sentido horario)"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/TilesPanel.tscn
|
#: src/UI/TilesPanel.tscn
|
||||||
msgid "Flip tile horizontally"
|
msgid "Flip tile horizontally"
|
||||||
msgstr "Voltar mosaico horizontalmente"
|
msgstr ""
|
||||||
|
|
||||||
#: src/UI/TilesPanel.tscn
|
#: src/UI/TilesPanel.tscn
|
||||||
msgid "Flip tile vertically"
|
msgid "Flip tile vertically"
|
||||||
msgstr "Voltear mosaico verticalmente"
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -325,8 +325,6 @@ func _calculate_frames(project := Global.current_project) -> Array[Frame]:
|
||||||
var inverted_frames := frames.duplicate()
|
var inverted_frames := frames.duplicate()
|
||||||
inverted_frames.reverse()
|
inverted_frames.reverse()
|
||||||
inverted_frames.remove_at(0)
|
inverted_frames.remove_at(0)
|
||||||
if inverted_frames.size() > 0:
|
|
||||||
inverted_frames.remove_at(inverted_frames.size() - 1)
|
|
||||||
frames.append_array(inverted_frames)
|
frames.append_array(inverted_frames)
|
||||||
return frames
|
return frames
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,6 @@ func update_tilemap(
|
||||||
if _tiles_equal(i, image_portion, tile.image):
|
if _tiles_equal(i, image_portion, tile.image):
|
||||||
if cells[i].index != j:
|
if cells[i].index != j:
|
||||||
cells[i].index = j
|
cells[i].index = j
|
||||||
tileset.tiles[j].times_used += 1
|
|
||||||
cells[i].remove_transformations()
|
cells[i].remove_transformations()
|
||||||
found_tile = true
|
found_tile = true
|
||||||
break
|
break
|
||||||
|
@ -657,21 +656,6 @@ func update_texture(undo := false) -> void:
|
||||||
var tile_size := current_tile.image.get_size()
|
var tile_size := current_tile.image.get_size()
|
||||||
image.blit_rect(current_tile.image, Rect2i(Vector2i.ZERO, tile_size), coords)
|
image.blit_rect(current_tile.image, Rect2i(Vector2i.ZERO, tile_size), coords)
|
||||||
continue
|
continue
|
||||||
if not editing_images.has(index):
|
|
||||||
if not _tiles_equal(i, image_portion, current_tile.image):
|
|
||||||
var transformed_image := transform_tile(
|
|
||||||
image_portion, cell_data.flip_h, cell_data.flip_v, cell_data.transpose, true
|
|
||||||
)
|
|
||||||
editing_images[index] = [i, transformed_image]
|
|
||||||
|
|
||||||
for i in cells.size():
|
|
||||||
var cell_data := cells[i]
|
|
||||||
var index := cell_data.index
|
|
||||||
if index >= tileset.tiles.size():
|
|
||||||
index = 0
|
|
||||||
var coords := get_cell_coords_in_image(i)
|
|
||||||
var rect := Rect2i(coords, tileset.tile_size)
|
|
||||||
var image_portion := image.get_region(rect)
|
|
||||||
if editing_images.has(index):
|
if editing_images.has(index):
|
||||||
var editing_portion := editing_images[index][0] as int
|
var editing_portion := editing_images[index][0] as int
|
||||||
if i == editing_portion:
|
if i == editing_portion:
|
||||||
|
@ -686,6 +670,12 @@ func update_texture(undo := false) -> void:
|
||||||
if not image_portion.get_data() == transformed_editing_image.get_data():
|
if not image_portion.get_data() == transformed_editing_image.get_data():
|
||||||
var tile_size := image_portion.get_size()
|
var tile_size := image_portion.get_size()
|
||||||
image.blit_rect(transformed_editing_image, Rect2i(Vector2i.ZERO, tile_size), coords)
|
image.blit_rect(transformed_editing_image, Rect2i(Vector2i.ZERO, tile_size), coords)
|
||||||
|
else:
|
||||||
|
if not _tiles_equal(i, image_portion, current_tile.image):
|
||||||
|
var transformed_image := transform_tile(
|
||||||
|
image_portion, cell_data.flip_h, cell_data.flip_v, cell_data.transpose, true
|
||||||
|
)
|
||||||
|
editing_images[index] = [i, transformed_image]
|
||||||
super.update_texture(undo)
|
super.update_texture(undo)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -157,10 +157,7 @@ func display_animate_dialog() -> void:
|
||||||
|
|
||||||
|
|
||||||
func _commit_undo(action: String, undo_data: Dictionary, project: Project) -> void:
|
func _commit_undo(action: String, undo_data: Dictionary, project: Project) -> void:
|
||||||
var tile_editing_mode := TileSetPanel.tile_editing_mode
|
project.update_tilemaps(undo_data)
|
||||||
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)
|
var redo_data := _get_undo_data(project)
|
||||||
project.undos += 1
|
project.undos += 1
|
||||||
project.undo_redo.create_action(action)
|
project.undo_redo.create_action(action)
|
||||||
|
|
|
@ -16,7 +16,7 @@ var tileset: TileSetCustom
|
||||||
func _init(_project: Project, _tileset: TileSetCustom, _name := "") -> void:
|
func _init(_project: Project, _tileset: TileSetCustom, _name := "") -> void:
|
||||||
super._init(_project, _name)
|
super._init(_project, _name)
|
||||||
tileset = _tileset
|
tileset = _tileset
|
||||||
if not project.tilesets.has(tileset) and is_instance_valid(tileset):
|
if not project.tilesets.has(tileset):
|
||||||
project.add_tileset(tileset)
|
project.add_tileset(tileset)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -352,7 +352,7 @@ func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAcces
|
||||||
if dict.has("tilesets"):
|
if dict.has("tilesets"):
|
||||||
for saved_tileset in dict["tilesets"]:
|
for saved_tileset in dict["tilesets"]:
|
||||||
var tile_size = str_to_var("Vector2i" + saved_tileset.get("tile_size"))
|
var tile_size = str_to_var("Vector2i" + saved_tileset.get("tile_size"))
|
||||||
var tileset := TileSetCustom.new(tile_size, "", false)
|
var tileset := TileSetCustom.new(tile_size)
|
||||||
tileset.deserialize(saved_tileset)
|
tileset.deserialize(saved_tileset)
|
||||||
tilesets.append(tileset)
|
tilesets.append(tileset)
|
||||||
if dict.has("frames") and dict.has("layers"):
|
if dict.has("frames") and dict.has("layers"):
|
||||||
|
@ -367,6 +367,21 @@ func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAcces
|
||||||
Global.LayerTypes.TILEMAP:
|
Global.LayerTypes.TILEMAP:
|
||||||
layers.append(LayerTileMap.new(self, null))
|
layers.append(LayerTileMap.new(self, null))
|
||||||
|
|
||||||
|
# Parent references to other layers are created when deserializing
|
||||||
|
# a layer, so loop again after creating them:
|
||||||
|
for layer_i in dict.layers.size():
|
||||||
|
layers[layer_i].index = layer_i
|
||||||
|
var layer_dict: Dictionary = dict.layers[layer_i]
|
||||||
|
# Ensure that loaded pxo files from v1.0-v1.0.3 have the correct
|
||||||
|
# blend mode, after the addition of the Erase mode in v1.0.4.
|
||||||
|
if pxo_version < 4 and layer_dict.has("blend_mode"):
|
||||||
|
var blend_mode: int = layer_dict.get("blend_mode")
|
||||||
|
if blend_mode >= BaseLayer.BlendModes.ERASE:
|
||||||
|
blend_mode += 1
|
||||||
|
layer_dict["blend_mode"] = blend_mode
|
||||||
|
layers[layer_i].deserialize(layer_dict)
|
||||||
|
_deserialize_metadata(layers[layer_i], dict.layers[layer_i])
|
||||||
|
|
||||||
var frame_i := 0
|
var frame_i := 0
|
||||||
for frame in dict.frames:
|
for frame in dict.frames:
|
||||||
var cels: Array[BaseCel] = []
|
var cels: Array[BaseCel] = []
|
||||||
|
@ -386,9 +401,7 @@ func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAcces
|
||||||
cels.append(Cel3D.new(size, true))
|
cels.append(Cel3D.new(size, true))
|
||||||
Global.LayerTypes.TILEMAP:
|
Global.LayerTypes.TILEMAP:
|
||||||
var image := _load_image_from_pxo(frame_i, cel_i, zip_reader, file)
|
var image := _load_image_from_pxo(frame_i, cel_i, zip_reader, file)
|
||||||
var tileset_index = dict.layers[cel_i].tileset_index
|
var new_cel := (layer as LayerTileMap).new_cel_from_image(image)
|
||||||
var tileset := tilesets[tileset_index]
|
|
||||||
var new_cel := CelTileMap.new(tileset, image)
|
|
||||||
cels.append(new_cel)
|
cels.append(new_cel)
|
||||||
cel["pxo_version"] = pxo_version
|
cel["pxo_version"] = pxo_version
|
||||||
cels[cel_i].deserialize(cel)
|
cels[cel_i].deserialize(cel)
|
||||||
|
@ -405,21 +418,6 @@ func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAcces
|
||||||
_deserialize_metadata(frame_class, frame)
|
_deserialize_metadata(frame_class, frame)
|
||||||
frames.append(frame_class)
|
frames.append(frame_class)
|
||||||
frame_i += 1
|
frame_i += 1
|
||||||
|
|
||||||
# Parent references to other layers are created when deserializing
|
|
||||||
# a layer, so loop again after creating them:
|
|
||||||
for layer_i in dict.layers.size():
|
|
||||||
layers[layer_i].index = layer_i
|
|
||||||
var layer_dict: Dictionary = dict.layers[layer_i]
|
|
||||||
# Ensure that loaded pxo files from v1.0-v1.0.3 have the correct
|
|
||||||
# blend mode, after the addition of the Erase mode in v1.0.4.
|
|
||||||
if pxo_version < 4 and layer_dict.has("blend_mode"):
|
|
||||||
var blend_mode: int = layer_dict.get("blend_mode")
|
|
||||||
if blend_mode >= BaseLayer.BlendModes.ERASE:
|
|
||||||
blend_mode += 1
|
|
||||||
layer_dict["blend_mode"] = blend_mode
|
|
||||||
layers[layer_i].deserialize(layer_dict)
|
|
||||||
_deserialize_metadata(layers[layer_i], dict.layers[layer_i])
|
|
||||||
if dict.has("tags"):
|
if dict.has("tags"):
|
||||||
for tag in dict.tags:
|
for tag in dict.tags:
|
||||||
var new_tag := AnimationTag.new(tag.name, Color(tag.color), tag.from, tag.to)
|
var new_tag := AnimationTag.new(tag.name, Color(tag.color), tag.from, tag.to)
|
||||||
|
@ -1017,9 +1015,7 @@ func add_tileset(tileset: TileSetCustom) -> void:
|
||||||
|
|
||||||
## Loops through all cels in [param cel_dictionary], and for [CelTileMap]s,
|
## Loops through all cels in [param cel_dictionary], and for [CelTileMap]s,
|
||||||
## it calls [method CelTileMap.update_tilemap].
|
## it calls [method CelTileMap.update_tilemap].
|
||||||
func update_tilemaps(
|
func update_tilemaps(cel_dictionary: Dictionary) -> void:
|
||||||
cel_dictionary: Dictionary, tile_editing_mode := TileSetPanel.tile_editing_mode
|
|
||||||
) -> void:
|
|
||||||
for cel in cel_dictionary:
|
for cel in cel_dictionary:
|
||||||
if cel is CelTileMap:
|
if cel is CelTileMap:
|
||||||
(cel as CelTileMap).update_tilemap(tile_editing_mode)
|
(cel as CelTileMap).update_tilemap()
|
||||||
|
|
|
@ -39,10 +39,9 @@ class Tile:
|
||||||
return times_used <= 0
|
return times_used <= 0
|
||||||
|
|
||||||
|
|
||||||
func _init(_tile_size: Vector2i, _name := "", add_empty_tile := true) -> void:
|
func _init(_tile_size: Vector2i, _name := "") -> void:
|
||||||
tile_size = _tile_size
|
tile_size = _tile_size
|
||||||
name = _name
|
name = _name
|
||||||
if add_empty_tile:
|
|
||||||
var empty_image := Image.create_empty(tile_size.x, tile_size.y, false, Image.FORMAT_RGBA8)
|
var empty_image := Image.create_empty(tile_size.x, tile_size.y, false, Image.FORMAT_RGBA8)
|
||||||
tiles.append(Tile.new(empty_image))
|
tiles.append(Tile.new(empty_image))
|
||||||
|
|
||||||
|
|
12
src/Main.gd
12
src/Main.gd
|
@ -184,6 +184,13 @@ func _ready() -> void:
|
||||||
Import.import_patterns(Global.path_join_array(Global.data_directories, "Patterns"))
|
Import.import_patterns(Global.path_join_array(Global.data_directories, "Patterns"))
|
||||||
|
|
||||||
quit_and_save_dialog.add_button("Exit without saving", false, "ExitWithoutSaving")
|
quit_and_save_dialog.add_button("Exit without saving", false, "ExitWithoutSaving")
|
||||||
|
|
||||||
|
open_sprite_dialog.current_dir = Global.config_cache.get_value(
|
||||||
|
"data", "current_dir", OS.get_system_dir(OS.SYSTEM_DIR_DESKTOP)
|
||||||
|
)
|
||||||
|
save_sprite_dialog.current_dir = Global.config_cache.get_value(
|
||||||
|
"data", "current_dir", OS.get_system_dir(OS.SYSTEM_DIR_DESKTOP)
|
||||||
|
)
|
||||||
_handle_cmdline_arguments()
|
_handle_cmdline_arguments()
|
||||||
get_tree().root.files_dropped.connect(_on_files_dropped)
|
get_tree().root.files_dropped.connect(_on_files_dropped)
|
||||||
if OS.get_name() == "Android":
|
if OS.get_name() == "Android":
|
||||||
|
@ -208,8 +215,8 @@ func _input(event: InputEvent) -> void:
|
||||||
|
|
||||||
func _project_switched() -> void:
|
func _project_switched() -> void:
|
||||||
if Global.current_project.export_directory_path != "":
|
if Global.current_project.export_directory_path != "":
|
||||||
open_sprite_dialog.current_dir = Global.current_project.export_directory_path
|
open_sprite_dialog.current_path = Global.current_project.export_directory_path
|
||||||
save_sprite_dialog.current_dir = Global.current_project.export_directory_path
|
save_sprite_dialog.current_path = Global.current_project.export_directory_path
|
||||||
|
|
||||||
|
|
||||||
# Taken from https://github.com/godotengine/godot/blob/3.x/editor/editor_settings.cpp#L1474
|
# Taken from https://github.com/godotengine/godot/blob/3.x/editor/editor_settings.cpp#L1474
|
||||||
|
@ -420,7 +427,6 @@ func load_last_project() -> void:
|
||||||
# Check if file still exists on disk
|
# Check if file still exists on disk
|
||||||
var file_path = Global.config_cache.get_value("data", "last_project_path")
|
var file_path = Global.config_cache.get_value("data", "last_project_path")
|
||||||
load_recent_project_file(file_path)
|
load_recent_project_file(file_path)
|
||||||
(func(): Global.cel_switched.emit()).call_deferred()
|
|
||||||
|
|
||||||
|
|
||||||
func load_recent_project_file(path: String) -> void:
|
func load_recent_project_file(path: String) -> void:
|
||||||
|
|
|
@ -1473,7 +1473,6 @@ text = "Pixelorama must be restarted for changes to take effect."
|
||||||
mode = 1
|
mode = 1
|
||||||
title = "Open File(s)"
|
title = "Open File(s)"
|
||||||
size = Vector2i(560, 400)
|
size = Vector2i(560, 400)
|
||||||
always_on_top = true
|
|
||||||
ok_button_text = "Open"
|
ok_button_text = "Open"
|
||||||
file_mode = 1
|
file_mode = 1
|
||||||
access = 2
|
access = 2
|
||||||
|
@ -1485,7 +1484,6 @@ transient = true
|
||||||
|
|
||||||
[node name="EnableExtensionConfirmation" type="ConfirmationDialog" parent="."]
|
[node name="EnableExtensionConfirmation" type="ConfirmationDialog" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
always_on_top = true
|
|
||||||
dialog_text = "Are you sure you want to enable this extension? Make sure to only enable extensions from sources that you trust."
|
dialog_text = "Are you sure you want to enable this extension? Make sure to only enable extensions from sources that you trust."
|
||||||
dialog_autowrap = true
|
dialog_autowrap = true
|
||||||
|
|
||||||
|
@ -1493,13 +1491,11 @@ dialog_autowrap = true
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
position = Vector2i(0, 36)
|
position = Vector2i(0, 36)
|
||||||
size = Vector2i(400, 100)
|
size = Vector2i(400, 100)
|
||||||
always_on_top = true
|
|
||||||
ok_button_text = "Delete Permanently"
|
ok_button_text = "Delete Permanently"
|
||||||
dialog_text = "Are you sure you want to delete this extension?"
|
dialog_text = "Are you sure you want to delete this extension?"
|
||||||
dialog_autowrap = true
|
dialog_autowrap = true
|
||||||
|
|
||||||
[node name="ResetOptionsConfirmation" type="ConfirmationDialog" parent="."]
|
[node name="ResetOptionsConfirmation" type="ConfirmationDialog" parent="."]
|
||||||
always_on_top = true
|
|
||||||
dialog_text = "Are you sure you want to reset the selected options? There will be no way to undo this."
|
dialog_text = "Are you sure you want to reset the selected options? There will be no way to undo this."
|
||||||
|
|
||||||
[connection signal="about_to_popup" from="." to="." method="_on_PreferencesDialog_about_to_show"]
|
[connection signal="about_to_popup" from="." to="." method="_on_PreferencesDialog_about_to_show"]
|
||||||
|
|
|
@ -212,8 +212,6 @@ func update_brush() -> void:
|
||||||
$DensityValueSlider.visible = _brush.type not in IMAGE_BRUSHES
|
$DensityValueSlider.visible = _brush.type not in IMAGE_BRUSHES
|
||||||
$ColorInterpolation.visible = _brush.type in IMAGE_BRUSHES
|
$ColorInterpolation.visible = _brush.type in IMAGE_BRUSHES
|
||||||
$RotationOptions.visible = _brush.type in IMAGE_BRUSHES
|
$RotationOptions.visible = _brush.type in IMAGE_BRUSHES
|
||||||
var canvas_indicators := Global.canvas.indicators
|
|
||||||
canvas_indicators.queue_redraw()
|
|
||||||
|
|
||||||
|
|
||||||
func update_random_image() -> void:
|
func update_random_image() -> void:
|
||||||
|
@ -276,7 +274,6 @@ func prepare_undo(action: String) -> void:
|
||||||
|
|
||||||
func commit_undo() -> void:
|
func commit_undo() -> void:
|
||||||
var project := Global.current_project
|
var project := Global.current_project
|
||||||
Global.canvas.update_selected_cels_textures(project)
|
|
||||||
project.update_tilemaps(_undo_data)
|
project.update_tilemaps(_undo_data)
|
||||||
var redo_data := _get_undo_data()
|
var redo_data := _get_undo_data()
|
||||||
var frame := -1
|
var frame := -1
|
||||||
|
|
|
@ -395,4 +395,3 @@ func _exit_tree() -> void:
|
||||||
if is_moving:
|
if is_moving:
|
||||||
draw_end(Global.canvas.current_pixel.floor())
|
draw_end(Global.canvas.current_pixel.floor())
|
||||||
Global.canvas.previews_sprite.texture = null
|
Global.canvas.previews_sprite.texture = null
|
||||||
Global.canvas.indicators.queue_redraw()
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ func _snap_position(pos: Vector2) -> Vector2:
|
||||||
|
|
||||||
func _commit_undo(action: String) -> void:
|
func _commit_undo(action: String) -> void:
|
||||||
var project := Global.current_project
|
var project := Global.current_project
|
||||||
project.update_tilemaps(_undo_data, TileSetPanel.TileEditingMode.AUTO)
|
project.update_tilemaps(_undo_data)
|
||||||
var redo_data := _get_undo_data()
|
var redo_data := _get_undo_data()
|
||||||
var frame := -1
|
var frame := -1
|
||||||
var layer := -1
|
var layer := -1
|
||||||
|
|
|
@ -163,7 +163,6 @@ func text_to_pixels() -> void:
|
||||||
|
|
||||||
func commit_undo(action: String, undo_data: Dictionary) -> void:
|
func commit_undo(action: String, undo_data: Dictionary) -> void:
|
||||||
var project := Global.current_project
|
var project := Global.current_project
|
||||||
Global.canvas.update_selected_cels_textures(project)
|
|
||||||
project.update_tilemaps(undo_data)
|
project.update_tilemaps(undo_data)
|
||||||
var redo_data := _get_undo_data()
|
var redo_data := _get_undo_data()
|
||||||
var frame := -1
|
var frame := -1
|
||||||
|
|
|
@ -629,7 +629,7 @@ func commit_undo(action: String, undo_data_tmp: Dictionary) -> void:
|
||||||
print("No undo data found!")
|
print("No undo data found!")
|
||||||
return
|
return
|
||||||
var project := Global.current_project
|
var project := Global.current_project
|
||||||
project.update_tilemaps(undo_data_tmp, TileSetPanel.TileEditingMode.AUTO)
|
project.update_tilemaps(undo_data_tmp)
|
||||||
var redo_data := get_undo_data(undo_data_tmp["undo_image"])
|
var redo_data := get_undo_data(undo_data_tmp["undo_image"])
|
||||||
project.undos += 1
|
project.undos += 1
|
||||||
project.undo_redo.create_action(action)
|
project.undo_redo.create_action(action)
|
||||||
|
@ -823,23 +823,8 @@ func paste(in_place := false) -> void:
|
||||||
else:
|
else:
|
||||||
camera_center.y = 0
|
camera_center.y = 0
|
||||||
big_bounding_rectangle.position = Vector2i(camera_center.floor())
|
big_bounding_rectangle.position = Vector2i(camera_center.floor())
|
||||||
if Tools.is_placing_tiles():
|
|
||||||
var tileset := (Global.current_project.get_current_cel() as CelTileMap).tileset
|
|
||||||
var grid_size := tileset.tile_size
|
|
||||||
big_bounding_rectangle.position = Vector2i(
|
|
||||||
Tools.snap_to_rectangular_grid_boundary(big_bounding_rectangle.position, grid_size)
|
|
||||||
)
|
|
||||||
project.selection_map.move_bitmap_values(Global.current_project, false)
|
project.selection_map.move_bitmap_values(Global.current_project, false)
|
||||||
else:
|
|
||||||
if Tools.is_placing_tiles():
|
|
||||||
var tileset := (Global.current_project.get_current_cel() as CelTileMap).tileset
|
|
||||||
var grid_size := tileset.tile_size
|
|
||||||
project.selection_offset = Tools.snap_to_rectangular_grid_boundary(
|
|
||||||
project.selection_offset, grid_size
|
|
||||||
)
|
|
||||||
big_bounding_rectangle.position = Vector2i(
|
|
||||||
Tools.snap_to_rectangular_grid_boundary(big_bounding_rectangle.position, grid_size)
|
|
||||||
)
|
|
||||||
big_bounding_rectangle = big_bounding_rectangle
|
big_bounding_rectangle = big_bounding_rectangle
|
||||||
temp_rect = big_bounding_rectangle
|
temp_rect = big_bounding_rectangle
|
||||||
is_moving_content = true
|
is_moving_content = true
|
||||||
|
|
|
@ -47,10 +47,7 @@ func _flip_image(cel: Image, affect_selection: bool, project: Project) -> void:
|
||||||
|
|
||||||
func _commit_undo(action: String, undo_data: Dictionary, project: Project) -> void:
|
func _commit_undo(action: String, undo_data: Dictionary, project: Project) -> void:
|
||||||
_flip_selection(project)
|
_flip_selection(project)
|
||||||
var tile_editing_mode := TileSetPanel.tile_editing_mode
|
project.update_tilemaps(undo_data)
|
||||||
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)
|
var redo_data := _get_undo_data(project)
|
||||||
project.undos += 1
|
project.undos += 1
|
||||||
project.undo_redo.create_action(action)
|
project.undo_redo.create_action(action)
|
||||||
|
|
|
@ -16,7 +16,6 @@ resource_name = "Layout"
|
||||||
script = ExtResource("3")
|
script = ExtResource("3")
|
||||||
root = SubResource("1")
|
root = SubResource("1")
|
||||||
hidden_tabs = {}
|
hidden_tabs = {}
|
||||||
windows = {}
|
|
||||||
save_on_change = false
|
save_on_change = false
|
||||||
|
|
||||||
[node name="ManageLayouts" type="AcceptDialog"]
|
[node name="ManageLayouts" type="AcceptDialog"]
|
||||||
|
@ -111,7 +110,6 @@ disabled = true
|
||||||
text = "Delete"
|
text = "Delete"
|
||||||
|
|
||||||
[node name="LayoutSettings" type="ConfirmationDialog" parent="."]
|
[node name="LayoutSettings" type="ConfirmationDialog" parent="."]
|
||||||
always_on_top = true
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="LayoutSettings"]
|
[node name="VBoxContainer" type="VBoxContainer" parent="LayoutSettings"]
|
||||||
offset_right = 40.0
|
offset_right = 40.0
|
||||||
|
@ -133,12 +131,12 @@ text = "Copy from"
|
||||||
[node name="LayoutFrom" type="OptionButton" parent="LayoutSettings/VBoxContainer/HBoxContainer"]
|
[node name="LayoutFrom" type="OptionButton" parent="LayoutSettings/VBoxContainer/HBoxContainer"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
selected = 0
|
|
||||||
item_count = 1
|
item_count = 1
|
||||||
|
selected = 0
|
||||||
popup/item_0/text = "Current layout"
|
popup/item_0/text = "Current layout"
|
||||||
|
popup/item_0/id = 0
|
||||||
|
|
||||||
[node name="DeleteConfirmation" type="ConfirmationDialog" parent="."]
|
[node name="DeleteConfirmation" type="ConfirmationDialog" parent="."]
|
||||||
always_on_top = true
|
|
||||||
dialog_text = "Are you sure you want to delete this layout?"
|
dialog_text = "Are you sure you want to delete this layout?"
|
||||||
|
|
||||||
[connection signal="about_to_popup" from="." to="." method="_on_ManageLayouts_about_to_show"]
|
[connection signal="about_to_popup" from="." to="." method="_on_ManageLayouts_about_to_show"]
|
||||||
|
|
|
@ -12,7 +12,6 @@ size = Vector2i(760, 470)
|
||||||
visible = false
|
visible = false
|
||||||
wrap_controls = true
|
wrap_controls = true
|
||||||
exclusive = true
|
exclusive = true
|
||||||
always_on_top = true
|
|
||||||
script = ExtResource("1_pwcwi")
|
script = ExtResource("1_pwcwi")
|
||||||
|
|
||||||
[node name="TabContainer" type="TabContainer" parent="."]
|
[node name="TabContainer" type="TabContainer" parent="."]
|
||||||
|
@ -25,11 +24,9 @@ offset_left = 7.0
|
||||||
offset_top = 8.0
|
offset_top = 8.0
|
||||||
offset_right = -7.0
|
offset_right = -7.0
|
||||||
offset_bottom = -8.0
|
offset_bottom = -8.0
|
||||||
current_tab = 0
|
|
||||||
|
|
||||||
[node name="Store" type="MarginContainer" parent="TabContainer"]
|
[node name="Store" type="MarginContainer" parent="TabContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
metadata/_tab_index = 0
|
|
||||||
|
|
||||||
[node name="StoreMainContainer" type="HSplitContainer" parent="TabContainer/Store"]
|
[node name="StoreMainContainer" type="HSplitContainer" parent="TabContainer/Store"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
@ -71,7 +68,6 @@ size_flags_horizontal = 3
|
||||||
[node name="Options" type="MarginContainer" parent="TabContainer"]
|
[node name="Options" type="MarginContainer" parent="TabContainer"]
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
metadata/_tab_index = 1
|
|
||||||
|
|
||||||
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Options"]
|
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Options"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
@ -157,7 +153,6 @@ unique_name_in_owner = true
|
||||||
position = Vector2i(0, 36)
|
position = Vector2i(0, 36)
|
||||||
size = Vector2i(511, 326)
|
size = Vector2i(511, 326)
|
||||||
unresizable = true
|
unresizable = true
|
||||||
always_on_top = true
|
|
||||||
popup_window = true
|
popup_window = true
|
||||||
|
|
||||||
[node name="Content" type="VBoxContainer" parent="Error"]
|
[node name="Content" type="VBoxContainer" parent="Error"]
|
||||||
|
@ -205,7 +200,6 @@ autowrap_mode = 3
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
position = Vector2i(0, 36)
|
position = Vector2i(0, 36)
|
||||||
size = Vector2i(357, 110)
|
size = Vector2i(357, 110)
|
||||||
always_on_top = true
|
|
||||||
popup_window = true
|
popup_window = true
|
||||||
|
|
||||||
[node name="Content" type="VBoxContainer" parent="ErrorCustom"]
|
[node name="Content" type="VBoxContainer" parent="ErrorCustom"]
|
||||||
|
|
|
@ -165,10 +165,7 @@ func _apply_effect(layer: BaseLayer, effect: LayerEffect) -> void:
|
||||||
var shader_image_effect := ShaderImageEffect.new()
|
var shader_image_effect := ShaderImageEffect.new()
|
||||||
shader_image_effect.generate_image(cel_image, effect.shader, effect.params, image_size)
|
shader_image_effect.generate_image(cel_image, effect.shader, effect.params, image_size)
|
||||||
|
|
||||||
var tile_editing_mode := TileSetPanel.tile_editing_mode
|
project.update_tilemaps(undo_data)
|
||||||
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:
|
for frame in project.frames:
|
||||||
var cel := frame.cels[layer.index]
|
var cel := frame.cels[layer.index]
|
||||||
var cel_image := cel.get_image()
|
var cel_image := cel.get_image()
|
||||||
|
|
|
@ -734,7 +734,7 @@ func _color_mode_submenu_id_pressed(id: ColorModes) -> void:
|
||||||
project.color_mode = Image.FORMAT_RGBA8
|
project.color_mode = Image.FORMAT_RGBA8
|
||||||
else:
|
else:
|
||||||
project.color_mode = Project.INDEXED_MODE
|
project.color_mode = Project.INDEXED_MODE
|
||||||
project.update_tilemaps(undo_data, TileSetPanel.TileEditingMode.AUTO)
|
project.update_tilemaps(undo_data)
|
||||||
project.serialize_cel_undo_data(pixel_cels, redo_data)
|
project.serialize_cel_undo_data(pixel_cels, redo_data)
|
||||||
project.undo_redo.create_action("Change color mode")
|
project.undo_redo.create_action("Change color mode")
|
||||||
project.undos += 1
|
project.undos += 1
|
||||||
|
|
Loading…
Reference in a new issue