13 lines
472 B
GDScript
13 lines
472 B
GDScript
extends Control
|
|
|
|
|
|
func on_slots_changed(current_slot: StringName, slots_data: Dictionary[StringName,StringName]):
|
|
for indicator in get_tree().get_nodes_in_group("weapon_indicator"):
|
|
var slot_accessed_data = slots_data[indicator.lookup_slot]
|
|
if slot_accessed_data == "":
|
|
indicator.hide()
|
|
continue
|
|
indicator.show()
|
|
var weapon = Registry.weapons[slot_accessed_data]
|
|
indicator.set_weapon(weapon)
|
|
indicator.set_current(current_slot == indicator.lookup_slot)
|