Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Scripts/SinkClick.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ func on_click():
print("hey")
ConveyerController.destination.append(get_parent().get_position())
transfer_box()

# Enable START button now that a route is connected
var start_button = get_tree().get_root().find_child("Control", true, false)
if start_button and start_button.has_method("enable_start"):
start_button.enable_start()

func transfer_box():
print("sending")
Expand Down
9 changes: 8 additions & 1 deletion Scripts/event_button.gd
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
extends Control

@onready var button = $Button

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Disable START button initially - needs route to be connected first
button.disabled = true
button.modulate = Color(0.5, 0.5, 0.5, 1.0) # Gray out when disabled


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

# Called by SinkClick when a route is connected
func enable_start() -> void:
button.disabled = false
button.modulate = Color(1.0, 1.0, 1.0, 1.0) # Normal color when enabled

func _on_button_pressed() -> void:
Level.initialise()
Expand Down