Skip to content

Commit

Permalink
Prevent showing structure-specific HUD when under construction
Browse files Browse the repository at this point in the history
  • Loading branch information
Scony committed Jul 22, 2023
1 parent 22e3507 commit 60d62b6
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions source/match/hud/UnitMenus.gd
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,27 @@ func _try_showing_any_menu():
var selected_controlled_units = get_tree().get_nodes_in_group("selected_units").filter(
func(unit): return unit.is_in_group("controlled_units")
)
if selected_controlled_units.size() == 1 and selected_controlled_units[0] is CommandCenter:
if (
selected_controlled_units.size() == 1
and selected_controlled_units[0] is CommandCenter
and selected_controlled_units[0].is_constructed()
):
_command_center_menu.unit = selected_controlled_units[0]
_command_center_menu.show()
return true
if selected_controlled_units.size() == 1 and selected_controlled_units[0] is VehicleFactory:
if (
selected_controlled_units.size() == 1
and selected_controlled_units[0] is VehicleFactory
and selected_controlled_units[0].is_constructed()
):
_vehicle_factory_menu.unit = selected_controlled_units[0]
_vehicle_factory_menu.show()
return true
if selected_controlled_units.size() == 1 and selected_controlled_units[0] is AircraftFactory:
if (
selected_controlled_units.size() == 1
and selected_controlled_units[0] is AircraftFactory
and selected_controlled_units[0].is_constructed()
):
_aircraft_factory_menu.unit = selected_controlled_units[0]
_aircraft_factory_menu.show()
return true
Expand Down

0 comments on commit 60d62b6

Please sign in to comment.