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
|
||||
14
scripts/gui/plant_pick/hotbar.gd
Normal file
14
scripts/gui/plant_pick/hotbar.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
extends Node
|
||||
|
||||
func _ready() -> void:
|
||||
LevelEventBus.hotbar_packets_update.connect(on_hotbar_updated)
|
||||
|
||||
func on_hotbar_updated(hotbar : Array[SeedpacketResource]):
|
||||
for child in get_children():
|
||||
child.queue_free()
|
||||
|
||||
for seedpacket in hotbar:
|
||||
var packet = preload("res://scenes/gui/seedpacket.tscn").instantiate()
|
||||
packet.held_resource = seedpacket
|
||||
add_child(packet)
|
||||
packet.set_handler(HotbarHandler.new(packet))
|
||||
1
scripts/gui/plant_pick/hotbar.gd.uid
Normal file
1
scripts/gui/plant_pick/hotbar.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cbrhnb4tp4pem
|
||||
Loading…
Add table
Add a link
Reference in a new issue