Proper swap, generic mouse confinment and win
This commit is contained in:
parent
cba43ee477
commit
5df5633c27
16 changed files with 136 additions and 96 deletions
|
|
@ -6,24 +6,13 @@ func _ready() -> void:
|
|||
func on_round_state_changed(state: int) -> void:
|
||||
if state != Session.ROUND_STATES.BUY:
|
||||
visible = false
|
||||
if visible:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
else:
|
||||
if Session.session_started_flag:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
else:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
MouseConfiner.stop_borrow()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("plr_buy"):
|
||||
if Session.round_state == Session.ROUND_STATES.BUY:
|
||||
visible = not visible
|
||||
else:
|
||||
MouseConfiner.borrow()
|
||||
elif visible:
|
||||
visible = false
|
||||
if visible:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
else:
|
||||
if Session.session_started_flag:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
else:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
MouseConfiner.stop_borrow()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue