mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 17:14:42 -04:00
[EXPERIMENTAL] Re-making the timeline
Trying to merge layers into the timeline, and eventually add more features like "share layer with all frames", among others. THIS IS NOT FINISHED, IT WILL *NOT* WORK PROPERLY. Once it is finished, this branch will be merged onto master. So far only add layer and add frame work, and even they may have some issues. Undoing also does not work properly yet. The UI is also not finished, as it currently has problems with the scroll containers.
This commit is contained in:
parent
7c408731b8
commit
953d002d91
12 changed files with 758 additions and 710 deletions
|
@ -1,12 +1,15 @@
|
|||
extends Button
|
||||
|
||||
var frame := 0
|
||||
var layer := 0
|
||||
|
||||
onready var popup_menu := $PopupMenu
|
||||
|
||||
func _on_FrameButton_pressed() -> void:
|
||||
if Input.is_action_just_released("left_mouse"):
|
||||
Global.current_frame = frame
|
||||
Global.current_layer = layer
|
||||
print(str(frame), str(layer))
|
||||
elif Input.is_action_just_released("right_mouse"):
|
||||
if Global.canvases.size() == 1:
|
||||
popup_menu.set_item_disabled(0, true)
|
||||
|
@ -30,7 +33,7 @@ func _on_PopupMenu_id_pressed(ID : int) -> void:
|
|||
0: #Remove Frame
|
||||
remove_frame()
|
||||
|
||||
1: #Clone Layer
|
||||
1: # Clone Layer
|
||||
var canvas : Canvas = Global.canvases[frame]
|
||||
var new_canvas : Canvas = load("res://Prefabs/Canvas.tscn").instance()
|
||||
new_canvas.size = Global.canvas.size
|
||||
|
@ -58,7 +61,7 @@ func _on_PopupMenu_id_pressed(ID : int) -> void:
|
|||
Global.undo_redo.add_do_property(Global, "hidden_canvases", Global.hidden_canvases)
|
||||
Global.undo_redo.add_do_property(Global, "canvas", new_canvas)
|
||||
Global.undo_redo.add_do_property(Global, "current_frame", new_canvases.size() - 1)
|
||||
for child in Global.frame_container.get_children():
|
||||
for child in Global.frame_containers.get_children():
|
||||
var frame_button = child.get_node("FrameButton")
|
||||
Global.undo_redo.add_do_property(frame_button, "pressed", false)
|
||||
Global.undo_redo.add_undo_property(frame_button, "pressed", frame_button.pressed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue