mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 21:14:42 -04:00
Removed remove_frame() from FrameButton.gd
Use _on_DeleteFrame_pressed() on AnimationTimeline.gd instead
This commit is contained in:
parent
feea931e22
commit
4e539e5e29
2 changed files with 11 additions and 33 deletions
|
@ -51,10 +51,13 @@ func add_frame() -> void:
|
|||
Global.undo_redo.commit_action()
|
||||
|
||||
|
||||
func _on_DeleteFrame_pressed() -> void:
|
||||
func _on_DeleteFrame_pressed(frame := -1) -> void:
|
||||
if Global.canvases.size() == 1:
|
||||
return
|
||||
var canvas : Canvas = Global.canvases[Global.current_frame]
|
||||
if frame == -1:
|
||||
frame = Global.current_frame
|
||||
|
||||
var canvas : Canvas = Global.canvases[frame]
|
||||
var new_canvases := Global.canvases.duplicate()
|
||||
new_canvases.erase(canvas)
|
||||
var current_frame := Global.current_frame
|
||||
|
@ -68,7 +71,7 @@ func _on_DeleteFrame_pressed() -> void:
|
|||
Global.undo_redo.add_do_property(Global, "canvas", new_canvases[current_frame])
|
||||
Global.undo_redo.add_do_property(Global, "current_frame", current_frame)
|
||||
|
||||
for i in range(Global.current_frame, new_canvases.size()):
|
||||
for i in range(frame, new_canvases.size()):
|
||||
var c : Canvas = new_canvases[i]
|
||||
Global.undo_redo.add_do_property(c, "frame", i)
|
||||
Global.undo_redo.add_undo_property(c, "frame", c.frame)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue