aboutsummaryrefslogtreecommitdiff
path: root/game/src/LobbyMenu/LobbyMenu.gd
blob: 4fc06c9e2169a045e6343f49f06508868a13ef7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
extends HBoxContainer

# REQUIREMENTS:
# * 1.4 Game Lobby Menu
# * SS-12

signal back_button_pressed
signal save_game_selected

@export
var start_button : BaseButton

# REQUIREMENTS:
# * SS-16
# * UIFUN-40
func _on_back_button_button_down():
   print("Returning to Main Menu.")
   back_button_pressed.emit()


# REQUIREMENTS:
# * SS-21
func _on_start_button_button_down():
   print("Starting new game.")
   get_tree().change_scene_to_file("res://src/GameSession/GameSession.tscn")


# REQUIREMENTS:
# * SS-19
func _on_game_select_list_item_selected(index):
   print("Selected save game: ", index)
   save_game_selected.emit(index)


func _on_save_game_selected(_index):
   start_button.disabled = false

# If the date is double-clicked, start the game!
func _on_game_select_list_item_activated(index):
   _on_game_select_list_item_selected(index)
   _on_start_button_button_down()