Expand contextual actions horizontally
This commit is contained in:
parent
d79c756d5b
commit
d20a62a26f
2 changed files with 10 additions and 5 deletions
|
|
@ -64,8 +64,8 @@ func _process(delta: float) -> bool:
|
|||
return true
|
||||
|
||||
# Context actions are compact until expanded. A mothership has three
|
||||
# choices: research, transfer cargo and hangar, which must receive
|
||||
# their own non-overlapping berth only after expansion.
|
||||
# choices: research, transfer cargo and hangar, which unfold in their
|
||||
# own non-overlapping berths to the right only after expansion.
|
||||
var mothership: Node2D = load("res://Building.tscn").instantiate()
|
||||
mothership.set("building_type", GameState.BUILDING_MOTHERSHIP)
|
||||
controller.current_building = mothership
|
||||
|
|
@ -73,7 +73,7 @@ func _process(delta: float) -> bool:
|
|||
controller._layout_context_buttons()
|
||||
var buttons: Array = [controller.building_action_button, controller.transfer_button, controller.hangar_button]
|
||||
for i in range(buttons.size() - 1):
|
||||
if buttons[i].offset_bottom > buttons[i + 1].offset_top:
|
||||
if buttons[i].offset_right > buttons[i + 1].offset_left:
|
||||
_fail("context buttons %d and %d overlap" % [i, i + 1])
|
||||
return true
|
||||
controller._collapse_context_actions()
|
||||
|
|
|
|||
Loading…
Reference in a new issue