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 840B

12345678910111213141516171819202122232425262728
  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.selected_item = null
  22. # TODO: Add a warning here if the event has changes
  23. current_piece.queue_free()
  24. timeline_editor.indent_events()