pir-serious-game-ethics/addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.gd

25 lines
812 B
GDScript

tool
extends MenuButton
var current_piece
func _ready():
# Gotta love the nodes system some times
# Praise the paths (っ´ω`c)♡
current_piece = get_parent().get_parent().get_parent().get_parent()
var popup = get_popup()
popup.connect("index_pressed", self, "_on_OptionSelected")
func _on_OptionSelected(index):
if index == 0:
# Moving this up
current_piece.editor_reference.get_node('MainPanel/TimelineEditor').move_block(current_piece, 'up')
elif index == 1:
# Moving piece down
current_piece.editor_reference.get_node('MainPanel/TimelineEditor').move_block(current_piece, 'down')
elif index == 3:
# Removing a piece
# TODO: Add a warning here if the event has changes
current_piece.queue_free()
current_piece.editor_reference.get_node('MainPanel/TimelineEditor').indent_events()