fixed interaction bar

tweaking resource_manager.gd
This commit is contained in:
2024-03-07 09:46:41 -06:00
parent ca8cfee1e8
commit 856b6a0400
11 changed files with 59 additions and 34 deletions

View File

@@ -42,9 +42,10 @@ func _input(event: InputEvent) -> void:
var build: BuildingBase = BUILDING_BASE.instantiate()
build.initialize(_attempting_build, interaction_location)
add_sibling(build)
if not _interacting and Grid.get_location_data(interaction_location).is_interactable():
elif not _interacting and Grid.get_location_data(interaction_location).is_interactable():
var interaction = INTERACTION_BAR.instantiate()
interaction.position = Grid.grid_to_world_center(interaction_location) - Vector2(30,10)
interaction.interaction_finished.connect(_on_interaction_finished)
interaction.grid_position = interaction_location
_interacting = true
add_sibling(interaction)
if event.is_action_pressed("build"):
@@ -52,6 +53,9 @@ func _input(event: InputEvent) -> void:
build_menu.build.connect(_on_build_menu_build)
add_sibling(build_menu)
func _on_interaction_finished() -> void:
_interacting = false
func _on_build_menu_build(building: Building) -> void:
print("Building: %s" % building.name)
_attempting_build = building