Plant spawn
This commit is contained in:
parent
32453f2e9d
commit
941912d7f1
25 changed files with 281 additions and 40 deletions
5
scripts/gui/plant_pick/go_button.gd
Normal file
5
scripts/gui/plant_pick/go_button.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends Button
|
||||
|
||||
|
||||
func _pressed() -> void:
|
||||
LevelEventBus.state_advance_requested.emit()
|
||||
1
scripts/gui/plant_pick/go_button.gd.uid
Normal file
1
scripts/gui/plant_pick/go_button.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://60lwfjb634kd
|
||||
|
|
@ -29,4 +29,4 @@ func on_level_state_changed(state : LevelData.LevelStates):
|
|||
|
||||
func on_sun_count_updated(to : float):
|
||||
enough_sun = to >= seedpacket.held_resource.cost
|
||||
|
||||
seedpacket.update_contents()
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ class_name Seedpacket
|
|||
var held_resource : SeedpacketResource
|
||||
var handler : SeedpacketHandler
|
||||
|
||||
func _ready() -> void:
|
||||
focus_exited.connect(on_focus_exited)
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
button.disabled = recharge_timer.time_left > 0 or handler.is_avaiable() == false
|
||||
|
||||
|
|
@ -45,3 +48,6 @@ func on_packet_placed(packet : SeedpacketResource):
|
|||
func disconnect_placement():
|
||||
LevelEventBus.packet_placed.disconnect(on_packet_placed)
|
||||
focus_exited.disconnect(disconnect_placement)
|
||||
|
||||
func on_focus_exited():
|
||||
LevelEventBus.packet_deselected.emit(held_resource)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue