Compare commits

..

No commits in common. "aefc236baa540cf5242933e356c31c33d8d12936" and "f8293f6974cb97490f15b99d20952a7eb62f1a3f" have entirely different histories.

26 changed files with 65 additions and 75 deletions

View File

@ -5,5 +5,5 @@ func _ready() -> void:
$MarkdownLabel.display_file("res://addons/markdownlabel/README.md") $MarkdownLabel.display_file("res://addons/markdownlabel/README.md")
$MarkdownLabel.task_checkbox_clicked.connect( $MarkdownLabel.task_checkbox_clicked.connect(
func(id: int, line: int, checked: bool, text: String) -> void: func(id: int, line: int, checked: bool, text: String) -> void:
print_debug("%s task #%d on line %d: %s" % ["Checked" if checked else "Unchecked", id, line, text]) print("%s task #%d on line %d: %s" % ["Checked" if checked else "Unchecked", id, line, text])
) )

View File

@ -640,7 +640,7 @@ func _reset_escaped_chars(_text: String,code:=false) -> String:
func _debug(string: String) -> void: func _debug(string: String) -> void:
if not _debug_mode: if not _debug_mode:
return return
print_debug(string) print(string)
func _denotes_fenced_code_block(line: String, character: String) -> bool: func _denotes_fenced_code_block(line: String, character: String) -> bool:
var stripped_line := line.strip_edges() var stripped_line := line.strip_edges()

View File

@ -196,7 +196,7 @@ func scene_finished(id: Scenes.id, _repeat: bool):
queue(\"RESET\") queue(\"RESET\")
func play(anin_name: StringName = \"\", a: float = -1, b: float = 1, c: bool = false) -> void: func play(anin_name: StringName = \"\", a: float = -1, b: float = 1, c: bool = false) -> void:
print_debug(\"anim player accessed!\") print(\"anim player accessed!\")
super.play(anin_name, a, b, c) super.play(anin_name, a, b, c)
func on_autism_done(): func on_autism_done():

View File

@ -44,7 +44,7 @@ func _on_mouse_exited():
has_mouse = false has_mouse = false
func try_reveal(for_player: Player) -> bool: func try_reveal(for_player: Player) -> bool:
print_debug("reveal ui!") print("reveal ui!")
revealed = ui.try_reveal() revealed = ui.try_reveal()
if revealed: if revealed:
call_deferred("wait_for_ui_exit", for_player) call_deferred("wait_for_ui_exit", for_player)

View File

@ -5,7 +5,7 @@ func ready():
body_exited.connect(notify_player_exit) body_exited.connect(notify_player_exit)
func notify_player_entry(body: RigidBody3D): func notify_player_entry(body: RigidBody3D):
print_debug("Player entered Crouch area.") print("Player entered Crouch area.")
if body is Player: if body is Player:
body.inside_crouch_volume.append(self) body.inside_crouch_volume.append(self)

View File

@ -96,12 +96,12 @@ func _rebuild():
func try_scroll(): func try_scroll():
var forward_target: int var forward_target: int
#print_debug( "max lines: " + str(max_lines)) #print( "max lines: " + str(max_lines))
#print_debug( "current lines: " + str(label.get_character_line(label.visible_characters))) #print( "current lines: " + str(label.get_character_line(label.visible_characters)))
var visible_ratio: float = float(label.get_character_line(label.visible_characters)) / max_lines var visible_ratio: float = float(label.get_character_line(label.visible_characters)) / max_lines
#print_debug("Tried scrolling with ratio of %f. Comparing %f against %f" % [visible_ratio, label.size.y * visible_ratio - scroll_container.scroll_vertical, scroll_container.size.y * 0.9]) #print("Tried scrolling with ratio of %f. Comparing %f against %f" % [visible_ratio, label.size.y * visible_ratio - scroll_container.scroll_vertical, scroll_container.size.y * 0.9])
if label.size.y * visible_ratio + scroll_container.scroll_vertical > scroll_container.size.y * 0.9: if label.size.y * visible_ratio + scroll_container.scroll_vertical > scroll_container.size.y * 0.9:
if scroll_container.scroll_vertical + scroll_container.size.y * 0.9 < label.size.y: if scroll_container.scroll_vertical + scroll_container.size.y * 0.9 < label.size.y:

View File

@ -975,7 +975,7 @@ func scene_finished(id: Scenes.id, _repeat: bool):
queue(\"RESET\") queue(\"RESET\")
func play(anin_name: StringName = \"\", a: float = -1, b: float = 1, c: bool = false) -> void: func play(anin_name: StringName = \"\", a: float = -1, b: float = 1, c: bool = false) -> void:
print_debug(\"anim player accessed!\") print(\"anim player accessed!\")
super.play(anin_name, a, b, c) super.play(anin_name, a, b, c)
" "

View File

@ -6,7 +6,7 @@ class_name ThemedButton extends Button
@onready var lower_corner_decor := load("res://import/interface-elements/lower_corner.png") @onready var lower_corner_decor := load("res://import/interface-elements/lower_corner.png")
func _ready() -> void: func _ready() -> void:
print_debug(owner) print(owner)
rebuild() rebuild()
theme_changed.connect(rebuild) theme_changed.connect(rebuild)
resized.connect(rebuild) resized.connect(rebuild)

View File

@ -34,7 +34,7 @@ func _process(delta: float) -> void:
_on_beat() _on_beat()
_last_beat_timing = sync_to.get_playback_position() _last_beat_timing = sync_to.get_playback_position()
else: else:
if not Engine.is_editor_hint(): print_debug(time_left) if not Engine.is_editor_hint(): print(time_left)
func start(time_sec: float = 0, starting_beat: int = 0, starting_bar: int = 0, sync_to_playback:AudioStreamPlayback = null) -> void: func start(time_sec: float = 0, starting_beat: int = 0, starting_bar: int = 0, sync_to_playback:AudioStreamPlayback = null) -> void:
if starting_bar == 0 and starting_beat > 0: starting_bar = starting_beat / beats_per_bar if starting_bar == 0 and starting_beat > 0: starting_bar = starting_beat / beats_per_bar

View File

@ -26,4 +26,4 @@ func create_bug_report():
DisplayServer.clipboard_set(debug_text) DisplayServer.clipboard_set(debug_text)
#print_debug("mailto:support@polynormal.games?subject=Frame%20of%20Mind%20Demo%20-%20Bug%20Report&body=" + debug_text) #print("mailto:support@polynormal.games?subject=Frame%20of%20Mind%20Demo%20-%20Bug%20Report&body=" + debug_text)

View File

@ -16,7 +16,7 @@ func _process(_delta):
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if event is InputEventAction: if event is InputEventAction:
print_debug(event.action) print(event.action)
#func _unhandled_input(event): #func _unhandled_input(event):
# viewport.push_input(event) # viewport.push_input(event)
@ -38,7 +38,7 @@ func _on_input_event(_camera: Camera3D, event: InputEvent, pos: Vector3, _normal
viewport.push_input(e) viewport.push_input(e)
func _on_button_pressed(): func _on_button_pressed():
print_debug("Button pressed") print("Button pressed")
func _on_line_edit_text_submitted(new_text): func _on_line_edit_text_submitted(new_text):
print_debug("Text submitted: ", new_text) print("Text submitted: ", new_text)

View File

@ -56,7 +56,7 @@ func _ready() -> void:
stream = AudioStreamPolyphonic.new() stream = AudioStreamPolyphonic.new()
func play(from_position: float = 0.0): func play(from_position: float = 0.0):
print_debug("got called") print("got called")
super.play(from_position) super.play(from_position)
self._play(from_position) self._play(from_position)

View File

@ -10,7 +10,7 @@ var has_stage: bool:
start_room() start_room()
var save_game:SaveGame = null @export var save_game:SaveGame = null
signal proceed(next_scene_path: String) signal proceed(next_scene_path: String)

View File

@ -8,13 +8,13 @@ var current_room_path: String:
@export var filepath: String: @export var filepath: String:
set(value): set(value):
print_debug("Savegame: setting filepath: %s" % value) print("Savegame: setting filepath: %s" % value)
filepath = value filepath = value
if _is_initialised: if _is_initialised:
changed.emit() changed.emit()
@export var unique_save_name: String = "frame_of_mind_%s_%s" % [Time.get_date_string_from_system(), Time.get_time_string_from_system().replace(":", "-")] + "-" + str(randi()): @export var unique_save_name: String = "frame_of_mind_%s_%s" % [Time.get_date_string_from_system(), Time.get_time_string_from_system().replace(":", "-")]:
set(value): set(value):
unique_save_name = value unique_save_name = value
if _is_initialised: changed.emit() if _is_initialised: changed.emit()
@ -75,25 +75,24 @@ func _init(initial_filepath = "") -> void:
else: else:
filepath = initial_filepath filepath = initial_filepath
unique_save_name = initial_filepath.get_file() unique_save_name = initial_filepath.get_file()
read_save_file() read_save_file()
_is_initialised = true _is_initialised = true
func read_save_file() -> void:
if not DirAccess.dir_exists_absolute(filepath.get_base_dir()): if not DirAccess.dir_exists_absolute(filepath.get_base_dir()):
DirAccess.make_dir_absolute(filepath.get_base_dir()) DirAccess.make_dir_absolute(filepath.get_base_dir())
func read_save_file() -> void:
if filepath == "DEBUG": if filepath == "DEBUG":
if OS.has_feature("debug") or OS.has_feature("demo"): if OS.has_feature("debug") or OS.has_feature("demo"):
push_warning("Created DEBUG savegame. Progress will not be stored!") push_warning("Created DEBUG savegame. Progress will not be stored!")
else: else:
print_debug(get_stack()) print(get_stack())
push_error("Created DEBUG savegame outside of demo or debug environment. This is unintentional and will lead to data loss. Please contact support and attatch the stack above.") push_error("Created DEBUG savegame outside of demo or debug environment. This is unintentional and will lead to data loss. Please contact support and attatch the stack above.")
#TODO maybe cause a crash here? #TODO maybe cause a crash here?
return return
if FileAccess.file_exists(filepath): if FileAccess.file_exists(filepath):
print_debug("Savegame: Reading from: %s" % filepath) print("Opening existing Savegame: %s" % filepath)
var file := FileAccess.open(filepath, FileAccess.READ) var file := FileAccess.open(filepath, FileAccess.READ)
var raw_json := FileAccess.get_file_as_string(filepath) var raw_json := FileAccess.get_file_as_string(filepath)
file.close() file.close()
@ -153,7 +152,7 @@ func read_save_file() -> void:
thumbnail = ImageTexture.create_from_image(tmp_img) thumbnail = ImageTexture.create_from_image(tmp_img)
is_empty = false is_empty = false
else: else:
print_debug("Savegame: Creating (in memory) for path: %s" % filepath) print("Creating empty Savegame: %s" % filepath)
is_valid = true is_valid = true
func _get_save_dict() -> Dictionary: func _get_save_dict() -> Dictionary:
@ -170,14 +169,12 @@ func _get_save_dict() -> Dictionary:
} }
func save_to_file(screen_shot: Texture) -> void: func save_to_file(screen_shot: Texture) -> void:
print_debug("Savegame: Saving to file: %s" % filepath)
if filepath == "DEBUG": if filepath == "DEBUG":
push_warning("Savegame: Saving DEBUG save skipped. This is intentional.") push_warning("Saving DEBUG save skipped. This is intentional.")
return return
if current_room == State.rooms.NULL: if current_room == State.rooms.NULL:
push_warning("Savegame: Not saving empty savegame.") print("Not saving empty savegame.")
return return
last_saved = int(Time.get_unix_time_from_system()) last_saved = int(Time.get_unix_time_from_system())
@ -193,7 +190,7 @@ func save_to_file(screen_shot: Texture) -> void:
var thumbnail_path: String = "%s/thumbnails/%s.png" % [filepath.get_base_dir(), unique_save_name] var thumbnail_path: String = "%s/thumbnails/%s.png" % [filepath.get_base_dir(), unique_save_name]
thumbnail_image.save_png(thumbnail_path) thumbnail_image.save_png(thumbnail_path)
print_debug(filepath.get_base_dir()) print(filepath.get_base_dir())
var file := FileAccess.open(filepath, FileAccess.WRITE) var file := FileAccess.open(filepath, FileAccess.WRITE)
file.store_string(JSON.stringify(_get_save_dict())) file.store_string(JSON.stringify(_get_save_dict()))
file.close() file.close()

View File

@ -17,7 +17,7 @@ func _process(delta):
func _on_scene_actors_animation_finished(anim_name): func _on_scene_actors_animation_finished(anim_name):
print_debug(\"yay\") print(\"yay\")
" "
[sub_resource type="Shader" id="Shader_tcvor"] [sub_resource type="Shader" id="Shader_tcvor"]

View File

@ -19,10 +19,10 @@ func _on_pressed() -> void:
script/source = "extends MenuButton script/source = "extends MenuButton
func _ready() -> void: func _ready() -> void:
mouse_entered.connect(func(id): print_debug(\"mouse_entered\")) mouse_entered.connect(func(id): print(\"mouse_entered\"))
get_popup().id_pressed.connect(func(id): print_debug(\"id_pressed\")) get_popup().id_pressed.connect(func(id): print(\"id_pressed\"))
get_popup().index_pressed.connect(func(id): print_debug(\"id_pressed\")) get_popup().index_pressed.connect(func(id): print(\"id_pressed\"))
get_popup().id_focused.connect(func(id): print_debug(\"id_focused\")) get_popup().id_focused.connect(func(id): print(\"id_focused\"))
" "

View File

@ -454,7 +454,7 @@ func _input(event):
get_viewport().set_input_as_handled() get_viewport().set_input_as_handled()
elif event.is_action_pressed("ui_left"): # right to switch context to the right elif event.is_action_pressed("ui_left"): # right to switch context to the right
print_debug(try_select_nearest_card(selection_position, Vector2.LEFT)) print(try_select_nearest_card(selection_position, Vector2.LEFT))
if focus_stickies: if focus_stickies:
if current_context == NAVIGATE: if current_context == NAVIGATE:
focus_stickies = false focus_stickies = false

View File

@ -114,7 +114,7 @@ signal has_burned
burn_tween.tween_property(self, "burn_progress", 2.0, 2) burn_tween.tween_property(self, "burn_progress", 2.0, 2)
burn_tween.tween_callback(_torch).set_delay(1.0) burn_tween.tween_callback(_torch).set_delay(1.0)
burned.TORCHED: burned.TORCHED:
print_debug("Card %s has been burned." % HardCards.get_obscure_name(name)) print("Card %s has been burned." % HardCards.get_obscure_name(name))
has_burned.emit() has_burned.emit()
burn_state = burning burn_state = burning

View File

@ -27,7 +27,7 @@ var has_stage = false:
var _input_locked = true var _input_locked = true
var selection_state = INI: var selection_state = INI:
set(state): set(state):
print_debug("Setting picker state to %s" % ["INI","CARDS","CARDS_SELECTED","TRANSITION","POSTS","POSTS_SELECTED","DONE"][state]) print("Setting picker state to %s" % ["INI","CARDS","CARDS_SELECTED","TRANSITION","POSTS","POSTS_SELECTED","DONE"][state])
selection_state = state selection_state = state
_input_locked = !(state == CARDS or state == POSTS) _input_locked = !(state == CARDS or state == POSTS)
@ -173,7 +173,7 @@ func _input(event):
func pick(id: int): func pick(id: int):
print_debug("%s picked card %s at id %d" % [name, options[id].text, id]) print("%s picked card %s at id %d" % [name, options[id].text, id])
if id == -1: if id == -1:
curr_selection_id = 0 curr_selection_id = 0
return return
@ -200,11 +200,11 @@ func pick(id: int):
options.erase(option) options.erase(option)
anim_players[i].play("unshuffle") anim_players[i].play("unshuffle")
anim_players.remove_at(i) anim_players.remove_at(i)
print_debug("Removed StickyNote %s from options pool" % HardCards.get_obscure_name(option.name)) print("Removed StickyNote %s from options pool" % HardCards.get_obscure_name(option.name))
i += 1 i += 1
var winning_id var winning_id
print_debug("Randomly selected card %s" % HardCards.get_obscure_name(options[1].name)) print("Randomly selected card %s" % HardCards.get_obscure_name(options[1].name))
if not (current_scene_id == Scenes.id.YOUTH_JUI_JUTSU and selection_state == CARDS_SELECTED): if not (current_scene_id == Scenes.id.YOUTH_JUI_JUTSU and selection_state == CARDS_SELECTED):
randomize() randomize()
# investigate if this fixes error on line 197 # investigate if this fixes error on line 197
@ -269,7 +269,7 @@ func handle_mouse_button(button_event: InputEventMouseButton, new_selection: Nod
var current_scene_id var current_scene_id
func pick_cards(id: int, repeat: bool): func pick_cards(id: int, repeat: bool):
current_scene_id = id current_scene_id = id
print_debug("Reached actor %s in sequence %s. Is%s repeating." % [name, Scenes.id.keys()[id], " not" if repeat else ""]) print("Reached actor %s in sequence %s. Is%s repeating." % [name, Scenes.id.keys()[id], " not" if repeat else ""])
if not repeat: if not repeat:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
fill_card_slots(id) fill_card_slots(id)

View File

@ -29,7 +29,7 @@ class_name Collectable_Ui
$Panel/Content/Buttons/VBoxContainer/collect_or_listen.text = "Collect Memento" $Panel/Content/Buttons/VBoxContainer/collect_or_listen.text = "Collect Memento"
@export var has_stage: bool = false: @export var has_stage: bool = false:
set(focused): set(focused):
print_debug("set focus of card to ", focused) print("set focus of card to ", focused)
if has_stage == focused: return if has_stage == focused: return
@ -127,7 +127,7 @@ func _yoink_focus():
State.transition_stage_to(self) State.transition_stage_to(self)
func _on_pick_button_pressed(): func _on_pick_button_pressed():
print_debug("card collected!") print("card collected!")
if not is_board: if not is_board:
Scenes.start_sequence(scene) Scenes.start_sequence(scene)
State.leave_stage(self) State.leave_stage(self)
@ -140,7 +140,7 @@ func _on_pick_button_pressed():
func _on_skip_pressed(): func _on_skip_pressed():
print_debug("Scene skipped!") print("Scene skipped!")
if scene != null: if scene != null:
emit_signal("scene_skipped", 1) emit_signal("scene_skipped", 1)
skipped = true skipped = true

View File

@ -232,7 +232,7 @@ func collect_memento():
is_collected = true is_collected = true
func _on_skip_pressed(): func _on_skip_pressed():
print_debug("Scene skipped!") print("Scene skipped!")
if scene != null: if scene != null:
scene_skipped.emit(1) scene_skipped.emit(1)
was_skipped = true was_skipped = true

View File

@ -2,7 +2,7 @@ class_name Player extends RigidBody3D
var has_stage: bool = false: var has_stage: bool = false:
set(on_stage): set(on_stage):
print_debug("%s player controller take stage" % "True: " if on_stage else "false") print("%s player controller take stage" % "True: " if on_stage else "false")
if has_stage != on_stage: if has_stage != on_stage:
if on_stage: if on_stage:
has_stage = true has_stage = true
@ -26,7 +26,7 @@ var has_stage: bool = false:
else: else:
jitter_strength = 0 jitter_strength = 0
has_stage = false has_stage = false
print_debug("player controller %s take stage" % "did" if has_stage else "didn't") print("player controller %s take stage" % "did" if has_stage else "didn't")
sleeping = has_stage sleeping = has_stage
@export var mouse_sensitivity: Vector2 = Vector2(6, 5) @export var mouse_sensitivity: Vector2 = Vector2(6, 5)
@ -145,7 +145,7 @@ func _on_ray_entered(_area):
else: else:
has_entered = false has_entered = false
else: else:
print_debug("You are standing in front of a wall") print("You are standing in front of a wall")
func _on_ray_exited(area): func _on_ray_exited(area):
if delay_passed and area is InteractiveSprite: if delay_passed and area is InteractiveSprite:

View File

@ -10,7 +10,7 @@ script/source = "extends Panel
@export var is_in_startup: bool @export var is_in_startup: bool
@onready var show_navigation_buttons = $\"SettingsContainer/PanelContainer/VBoxContainer/TabContainer/physical Accessibility/Container2/margin/show nav ui\" @onready var show_navigation_buttons = $\"CenterContainer/PanelContainer/VBoxContainer/TabContainer/physical Accessibility/Container2/margin/show nav ui\"
func _ready(): func _ready():
theme = State.current_main_theme theme = State.current_main_theme

View File

@ -19,7 +19,7 @@ extends Control
} }
func _ready() -> void: func _ready() -> void:
print_debug("main.gd: ready()") print("main.gd: ready()")
if State.room == null: if State.room == null:
_open() _open()
var path := await main_menu.execute() var path := await main_menu.execute()
@ -101,7 +101,7 @@ func _close() -> void:
# current_room.queue_free() # current_room.queue_free()
# State.onready_room = get_room_id_from_path(currently_loading_room) # State.onready_room = get_room_id_from_path(currently_loading_room)
# current_room = ResourceLoader.load_threaded_get(currently_loading_room).instantiate() # current_room = ResourceLoader.load_threaded_get(currently_loading_room).instantiate()
# print_debug("add room") # print("add room")
# add_child(current_room) # add_child(current_room)
# State.onready_room = State.rooms.NULL # State.onready_room = State.rooms.NULL
# move_child(current_room, 0) # move_child(current_room, 0)
@ -118,7 +118,7 @@ func _unhandled_input(event: InputEvent) -> void:
toggle_pause_menu() toggle_pause_menu()
func toggle_pause_menu(): func toggle_pause_menu():
print_debug("Toggling pause menu") print("Toggling pause menu")
pass pass
# if not get_tree().paused: # if not get_tree().paused:
@ -205,7 +205,7 @@ func toggle_pause_menu():
# in_game = true # in_game = true
# #
#func pause_mode_changed(): #func pause_mode_changed():
# print_debug(get_tree().paused) # print(get_tree().paused)
# #
#var await_swap: bool = false #var await_swap: bool = false
#func prepare_transition(scene_id: Scenes.id, _repeat): #func prepare_transition(scene_id: Scenes.id, _repeat):

View File

@ -58,7 +58,7 @@ func continue_sequence(former_actor: Object):
current_sequence_index += 1 current_sequence_index += 1
State.stage_list[0] = sequence_actors[current_sequence][current_sequence_index].get_object() State.stage_list[0] = sequence_actors[current_sequence][current_sequence_index].get_object()
print_debug(sequence_actors[current_sequence][current_sequence_index].get_object().name) print(sequence_actors[current_sequence][current_sequence_index].get_object().name)
State.stage_list[0].has_stage = true State.stage_list[0].has_stage = true

View File

@ -12,9 +12,8 @@ class_name MainMenu extends Panel
# Internal Signals # Internal Signals
signal _next_room(result: String) signal _next_room(result: String)
func execute() -> String: func execute() -> String:
print_debug("main_menu.gd: execute()") print("main_menu.gd: execute()")
assert(is_node_ready(), "MainMenu node not ready yet! (???)") assert(is_node_ready(), "MainMenu node not ready yet! (???)")
if State.save_game == null or State.save_game.current_room == 0: if State.save_game == null or State.save_game.current_room == 0:
@ -30,6 +29,11 @@ func execute() -> String:
save_game_handle.visible = save_game_handle.has_existing_saves() save_game_handle.visible = save_game_handle.has_existing_saves()
#if continue_button.visible:
# continue_button.grab_focus()
#else:
# new_game_button.grab_focus()
_activate() _activate()
var result = await _next_room var result = await _next_room
_deactivate() _deactivate()
@ -38,7 +42,7 @@ func execute() -> String:
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
print_debug("main_menu.gd: ready()") print("main_menu.gd: ready()")
_deactivate() _deactivate()
continue_button.pressed.connect(_start_game) continue_button.pressed.connect(_start_game)
@ -49,29 +53,25 @@ func _ready() -> void:
credits_button.pressed.connect(_choose.bind("credits")) #FIXME: Needs some other encoding, like path credits_button.pressed.connect(_choose.bind("credits")) #FIXME: Needs some other encoding, like path
quit_button.pressed.connect(get_tree().quit) quit_button.pressed.connect(get_tree().quit)
func _new_game() -> void: func _new_game() -> void:
print_debug("main_menu.gd: start_new_game()") print("main_menu.gd: start_new_game()")
State.save_game = SaveGame.new() State.save_game = SaveGame.new()
_start_game() _start_game()
func _start_game() -> void: func _start_game() -> void:
print_debug("main_menu.gd: _start_game()") print("main_menu.gd: _start_game()")
_next_room.emit(State.save_game.current_room_path) _next_room.emit(State.save_game.current_room_path)
func _load_save_game() -> void: func _load_save_game() -> void:
print_debug("main_menu.gd: _load_save_game()") print("main_menu.gd: _load_save_game()")
var save: SaveGame = await save_game_handle.pick_save_slot() var save: SaveGame = await save_game_handle.pick_save_slot()
_on_save_picked(save) _on_save_picked(save)
func _choose(choice: String) -> void: func _choose(choice: String) -> void:
print_debug("main_menu.gd: _choose(", choice, ")") print("main_menu.gd: _choose(", choice, ")")
_next_room.emit(choice) _next_room.emit(choice)
func _activate() -> void: func _activate() -> void:
save_game_handle.visible = false save_game_handle.visible = false
@ -79,12 +79,6 @@ func _activate() -> void:
child.focus_mode = Control.FOCUS_ALL child.focus_mode = Control.FOCUS_ALL
child.modulate = Color.WHITE child.modulate = Color.WHITE
child.mouse_filter = Control.MOUSE_FILTER_STOP child.mouse_filter = Control.MOUSE_FILTER_STOP
if continue_button.visible:
continue_button.grab_focus()
else:
new_game_button.grab_focus()
func _deactivate() -> void: func _deactivate() -> void:
save_game_handle.visible = false save_game_handle.visible = false
@ -94,9 +88,8 @@ func _deactivate() -> void:
child.modulate = Color.WEB_GRAY child.modulate = Color.WEB_GRAY
child.mouse_filter = Control.MOUSE_FILTER_IGNORE child.mouse_filter = Control.MOUSE_FILTER_IGNORE
func _on_save_picked(save: SaveGame): func _on_save_picked(save: SaveGame):
print_debug("main_menu.gd: _on_save_picked(", save, ")") print("main_menu.gd: _on_save_picked(", save, ")")
if (save != null): if (save != null):
State.save_game = save State.save_game = save
_next_room.emit("start_game") _next_room.emit("start_game")