ActionBox.gd 934 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. extends Control
  2. @onready var slots : Array[CellTile] = [
  3. $TouchScreenButton/CellSlot,
  4. $TouchScreenButton2/CellSlot2,
  5. $TouchScreenButton3/CellSlot3,
  6. $TouchScreenButton4/CellSlot4,
  7. $TouchScreenButton5/CellSlot5,
  8. $TouchScreenButton6/CellSlot6,
  9. $TouchScreenButton7/CellSlot7,
  10. $TouchScreenButton8/CellSlot8,
  11. $TouchScreenButton9/CellSlot9,
  12. $TouchScreenButton10/CellSlot10,
  13. ]
  14. @onready var labels : Array[Label] = [
  15. $TouchScreenButton/ButtonLabel,
  16. $TouchScreenButton2/ButtonLabel,
  17. $TouchScreenButton3/ButtonLabel,
  18. $TouchScreenButton4/ButtonLabel,
  19. $TouchScreenButton5/ButtonLabel,
  20. $TouchScreenButton6/ButtonLabel,
  21. $TouchScreenButton7/ButtonLabel,
  22. $TouchScreenButton8/ButtonLabel,
  23. $TouchScreenButton9/ButtonLabel,
  24. $TouchScreenButton10/ButtonLabel,
  25. ]
  26. #
  27. func Trigger(idx : int):
  28. if idx < slots.size():
  29. slots[idx].UseCell()
  30. func _ready():
  31. if LauncherCommons.isMobile:
  32. for label in labels:
  33. label.set_visible(false)