1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Cel unlinking now works properly

Undo/redo can have some weird behavior right now
This commit is contained in:
OverloadedOrama 2020-03-21 22:55:36 +02:00
parent 0ec3af30f4
commit 9ca564cfe1
3 changed files with 18 additions and 7 deletions

View file

@ -6,10 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [v0.7] - Unreleased
### Added
- Cels are now in the timeline. Each cel refers to a specific layer AND a frame. Frames are a collection of cels for every layer.
- Cel linking is now possible. This way, layers can be "shared" in multiple frames.
- Importing .pngs as palettes is now possible - thanks to Martin Novák (novhack)!
- A confirmation message now appears when the user quits Pixelorama, if there are unsaved changes - thanks to Schweini07!
- Locking layers is now possible. When a layer is locked, no changes can be made to it. Layers are unlocked by default.
- Ability to get color for palette buttons, when editing a palette, from the currently selected left and right colors
- Ability to get color for palette buttons, when editing a palette, from the currently selected left and right colors.
- Esperanto translation - thanks to Teashrock!
### Changed
- The timeline has been revamped!

View file

@ -35,7 +35,7 @@ __meta__ = {
margin_right = 20.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
items = [ "Remove Frame", null, 0, false, true, -1, 0, null, "", false, "Clone Frame", null, 0, false, false, -1, 0, null, "", false, "Move Left", null, 0, false, true, -1, 0, null, "", false, "Move Right", null, 0, false, true, -1, 0, null, "", false, "Unlink Cell", null, 0, false, true, 4, 0, null, "", false ]
items = [ "Remove Frame", null, 0, false, true, -1, 0, null, "", false, "Clone Frame", null, 0, false, false, -1, 0, null, "", false, "Move Left", null, 0, false, true, -1, 0, null, "", false, "Move Right", null, 0, false, true, -1, 0, null, "", false, "Unlink Cel", null, 0, false, true, 4, 0, null, "", false ]
[node name="LinkedIndicator" type="Polygon2D" parent="."]
visible = false

View file

@ -9,10 +9,10 @@ func _ready() -> void:
hint_tooltip = "Frame: %s, Layer: %s" % [frame, layer]
if Global.canvases[frame] in Global.layers[layer][5]:
get_node("LinkedIndicator").visible = true
popup_menu.set_item_disabled(4, false) # Unlink cell
popup_menu.set_item_disabled(4, false) # Unlink cel
else:
get_node("LinkedIndicator").visible = false
popup_menu.set_item_disabled(4, true) # Unlink cell
popup_menu.set_item_disabled(4, true) # Unlink cel
func _on_FrameButton_pressed() -> void:
if Input.is_action_just_released("left_mouse"):
@ -87,11 +87,19 @@ func _on_PopupMenu_id_pressed(ID : int) -> void:
change_frame_order(-1)
3: # Move Right
change_frame_order(1)
4: # Unlink Cell
var cell_index : int = Global.layers[layer][5].find(Global.canvases[frame])
Global.layers[layer][5].remove(cell_index)
4: # Unlink Cel
var cel_index : int = Global.layers[layer][5].find(Global.canvases[frame])
Global.layers[layer][5].remove(cel_index)
_ready()
var sprite := Image.new()
sprite.copy_from(Global.canvases[frame].layers[layer][0])
sprite.lock()
Global.canvases[frame].layers[layer][0] = sprite
var tex := ImageTexture.new()
tex.create_from_image(sprite, 0)
Global.canvases[frame].layers[layer][1] = tex
func remove_frame() -> void:
var canvas : Canvas = Global.canvases[frame]
var new_canvases := Global.canvases.duplicate()