2020-10-19 14:57:40 +00:00
|
|
|
extends ConfirmationDialog
|
|
|
|
|
|
|
|
onready var frame_num = $VBoxContainer/GridContainer/FrameNum
|
|
|
|
onready var frame_dur = $VBoxContainer/GridContainer/FrameTime
|
|
|
|
|
|
|
|
func set_frame_label(frame : int) -> void:
|
|
|
|
frame_num.set_text(str(frame + 1))
|
|
|
|
|
|
|
|
func set_frame_dur(duration : float) -> void:
|
2020-12-10 18:39:29 +00:00
|
|
|
frame_dur.set_value(duration)
|
2020-10-19 14:57:40 +00:00
|
|
|
|
|
|
|
func _on_FrameProperties_popup_hide() -> void:
|
|
|
|
Global.dialog_open(false)
|
|
|
|
|
|
|
|
func _on_FrameProperties_confirmed():
|
2020-12-16 20:54:08 +00:00
|
|
|
var frame : int = int(frame_num.get_text()) - 1
|
2020-10-19 14:57:40 +00:00
|
|
|
var duration : float = frame_dur.get_value()
|
2020-12-16 20:54:08 +00:00
|
|
|
var new_duration = Global.current_project.frames[frame].duration
|
|
|
|
new_duration = duration
|
2020-10-19 14:57:40 +00:00
|
|
|
|
|
|
|
Global.current_project.undos += 1
|
|
|
|
Global.current_project.undo_redo.create_action("Change frame duration")
|
|
|
|
|
2020-12-16 20:54:08 +00:00
|
|
|
Global.current_project.undo_redo.add_do_property(Global.current_project.frames[frame], "duration", new_duration)
|
|
|
|
Global.current_project.undo_redo.add_undo_property(Global.current_project.frames[frame], "duration", Global.current_project.frames[frame].duration)
|
2020-10-19 14:57:40 +00:00
|
|
|
|
|
|
|
Global.current_project.undo_redo.add_do_method(Global, "redo")
|
|
|
|
Global.current_project.undo_redo.add_undo_method(Global, "undo")
|
|
|
|
Global.current_project.undo_redo.commit_action()
|