fixed interaction bar
tweaking resource_manager.gd
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user