No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PieceExtraSettings.gd 797B

123456789101112131415161718192021222324252627
  1. tool
  2. extends MenuButton
  3. var current_piece
  4. func _ready():
  5. # Gotta love the nodes system some times
  6. # Praise the paths (っ´ω`c)♡
  7. current_piece = get_parent().get_parent().get_parent().get_parent()
  8. var popup = get_popup()
  9. popup.connect("index_pressed", self, "_on_OptionSelected")
  10. func _on_OptionSelected(index):
  11. var timeline_editor = current_piece.editor_reference.get_node('MainPanel/TimelineEditor')
  12. if index == 0:
  13. # Moving this up
  14. timeline_editor.move_block(current_piece, 'up')
  15. elif index == 1:
  16. # Moving piece down
  17. timeline_editor.move_block(current_piece, 'down')
  18. elif index == 3:
  19. # Removing a piece
  20. if timeline_editor.selected_item != current_piece:
  21. timeline_editor._select_item(current_piece)
  22. timeline_editor.delete_event()
  23. timeline_editor.indent_events()