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:
parent
0ec3af30f4
commit
9ca564cfe1
|
@ -6,10 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
## [v0.7] - Unreleased
|
## [v0.7] - Unreleased
|
||||||
|
|
||||||
### Added
|
### 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)!
|
- 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!
|
- 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.
|
- 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
|
### Changed
|
||||||
- The timeline has been revamped!
|
- The timeline has been revamped!
|
||||||
|
|
|
@ -35,7 +35,7 @@ __meta__ = {
|
||||||
margin_right = 20.0
|
margin_right = 20.0
|
||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
mouse_default_cursor_shape = 2
|
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="."]
|
[node name="LinkedIndicator" type="Polygon2D" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
|
@ -9,10 +9,10 @@ func _ready() -> void:
|
||||||
hint_tooltip = "Frame: %s, Layer: %s" % [frame, layer]
|
hint_tooltip = "Frame: %s, Layer: %s" % [frame, layer]
|
||||||
if Global.canvases[frame] in Global.layers[layer][5]:
|
if Global.canvases[frame] in Global.layers[layer][5]:
|
||||||
get_node("LinkedIndicator").visible = true
|
get_node("LinkedIndicator").visible = true
|
||||||
popup_menu.set_item_disabled(4, false) # Unlink cell
|
popup_menu.set_item_disabled(4, false) # Unlink cel
|
||||||
else:
|
else:
|
||||||
get_node("LinkedIndicator").visible = false
|
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:
|
func _on_FrameButton_pressed() -> void:
|
||||||
if Input.is_action_just_released("left_mouse"):
|
if Input.is_action_just_released("left_mouse"):
|
||||||
|
@ -87,11 +87,19 @@ func _on_PopupMenu_id_pressed(ID : int) -> void:
|
||||||
change_frame_order(-1)
|
change_frame_order(-1)
|
||||||
3: # Move Right
|
3: # Move Right
|
||||||
change_frame_order(1)
|
change_frame_order(1)
|
||||||
4: # Unlink Cell
|
4: # Unlink Cel
|
||||||
var cell_index : int = Global.layers[layer][5].find(Global.canvases[frame])
|
var cel_index : int = Global.layers[layer][5].find(Global.canvases[frame])
|
||||||
Global.layers[layer][5].remove(cell_index)
|
Global.layers[layer][5].remove(cel_index)
|
||||||
_ready()
|
_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:
|
func remove_frame() -> void:
|
||||||
var canvas : Canvas = Global.canvases[frame]
|
var canvas : Canvas = Global.canvases[frame]
|
||||||
var new_canvases := Global.canvases.duplicate()
|
var new_canvases := Global.canvases.duplicate()
|
||||||
|
|
Loading…
Reference in a new issue