Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
incredibleLeitman authored Jan 23, 2022
1 parent 0e8e503 commit fc13b7c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 0 additions & 1 deletion recursio-client/UI/Menus/GameRoomLobby.gd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func _ready():
for level_name in _level_names:
_level_list.add_item(level_name)


_error = _level_list.connect("item_selected", self, "_on_level_selected")
_error = _fog_of_war.connect("pressed", self, "_on_fog_of_war_pressed")

Expand Down
8 changes: 8 additions & 0 deletions recursio-client/UI/Menus/GameplayMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ func _ready():
_err = _settings.connect("visibility_changed", self, "_on_settings_visibility_changed")


func _process(_delta: float) -> void:
if Input.is_action_just_pressed("ui_cancel"):
if _settings.visible:
_settings.hide()
else:
_on_resume_pressed()


func _on_visibility_changed() -> void:
if visible:
_btn_resume.grab_focus()
Expand Down
16 changes: 15 additions & 1 deletion recursio-client/UI/Menus/StartMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@ func _ready():

func _process(_delta):
if not _in_game:
# handling back facebutton in ui
if Input.is_action_just_pressed("ui_cancel"):
if _game_room_search.visible:
_on_search_back_pressed()
elif _game_room_lobby.visible:
# calling internal method because sending info to server
# that game room is to be deleted if empty
_game_room_lobby._on_leave_pressed()
elif _tutorial.visible:
_tutorial.hide()
_start_menu_buttons.show()
_btn_play_tutorial.grab_focus()
elif _settings.visible:
_settings.hide()
_start_menu_buttons.show()
return

if Input.is_action_just_pressed("gameplay_menu"):
Expand Down Expand Up @@ -400,4 +415,3 @@ func _on_level_selected_received(level_index) -> void:
func _on_fog_of_war_toggled(is_fog_of_war_enabled) -> void:
_game_room_lobby.set_fog_of_war(is_fog_of_war_enabled)
_game_room_lobby.enable_ready_button()

0 comments on commit fc13b7c

Please sign in to comment.