fix: youth room debug timing

This commit is contained in:
tiger tiger tiger 2026-01-19 19:36:05 +01:00
parent 73d75da9a5
commit e9980378b8
5 changed files with 19 additions and 24 deletions

View File

@ -14,6 +14,7 @@ func start_room():
%RightDetection.body_entered.connect(on_right_train_enter) %RightDetection.body_entered.connect(on_right_train_enter)
%LeftDetection.body_exited.connect(on_left_train_exit) %LeftDetection.body_exited.connect(on_left_train_exit)
%RightDetection.body_exited.connect(on_right_train_exit) %RightDetection.body_exited.connect(on_right_train_exit)
%burnout_station.leave_room.connect(func(): %burnout_station.leave_room.connect(func():
proceed.emit(Main.adulthood_room_path)) proceed.emit(Main.adulthood_room_path))

View File

@ -9,6 +9,7 @@ extends RoomTemplate
func start_room(): func start_room():
super.start_room() super.start_room()
%UI.show() %UI.show()
await Main.curtain.open() await Main.curtain.open()
@ -37,6 +38,9 @@ func _play_intro_scene() -> void:
func get_ready(): func get_ready():
super.get_ready() super.get_ready()
prints("indeed")
Scenes.scene_finished.connect(_on_scene_finished)
card_board.board_completed.connect(func(): card_board.board_completed.connect(func():
%DoorInteractable.show() %DoorInteractable.show()
if not save_game.is_childhood_board_complete: if not save_game.is_childhood_board_complete:
@ -57,14 +61,6 @@ func get_ready():
await get_tree().process_frame await get_tree().process_frame
func _ready():
printt(_ready, name)
super._ready()
id = State.rooms.YOUTH
Scenes.scene_finished.connect(_on_scene_finished)
func pull_save_state(save: SaveGame) -> void: func pull_save_state(save: SaveGame) -> void:
save_game = save save_game = save
save_game.current_room = id save_game.current_room = id

View File

@ -23,26 +23,28 @@ func _ready() -> void:
save_game.player_position = %PlayerController.global_position save_game.player_position = %PlayerController.global_position
if not Main.normal_boot: if not Main.normal_boot:
start_room.call_deferred() push_warning("------- DEBUG MODE --------")
play.call_deferred()
func disable()-> void: func disable()-> void:
push_warning("Room disabling is deprecated / unter reconstruction") push_warning("Room disabling is deprecated / unter reconstruction")
func get_ready(): func get_ready():
# Override this function to initialize more things. it's called by start_room prints("----------", "GET_READY", self.name, "--------------")
pass pass
func play() -> String: func play() -> String:
start_room.call_deferred() await get_ready()
await start_room()
var next_room : StringName = await proceed var next_room : StringName = await proceed
prints("----------", "PROCEEDING", next_room, "--------------") prints("----------", "PROCEEDING", next_room, "--------------")
return next_room return next_room
func start_room(): func start_room():
await get_ready()
prints("----------", "START_ROOM", self.name, "--------------") prints("----------", "START_ROOM", self.name, "--------------")
Main.curtain.open()
func pull_save_state(_save: SaveGame) -> void: func pull_save_state(_save: SaveGame) -> void:

View File

@ -2,16 +2,14 @@ class_name PlayerController extends RigidBody3D
@export var enabled: bool = false: @export var enabled: bool = false:
set(value): set(value):
if enabled == value: if enabled == value: return
return
enabled = value enabled = value
_apply_enabled_state() _apply_enabled_state()
func _apply_enabled_state() -> void: func _apply_enabled_state() -> void:
# Kill any existing jitter tween to prevent stacking # Kill any existing jitter tween to prevent stacking
if jitter_tween and jitter_tween.is_valid(): if jitter_tween: jitter_tween.kill()
jitter_tween.kill()
if enabled: if enabled:
camera.make_current() camera.make_current()
@ -19,8 +17,10 @@ func _apply_enabled_state() -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
jitter_tween = create_tween() jitter_tween = create_tween()
jitter_tween.tween_property(self, "jitter_strength", 1.0, 1.0) jitter_tween.tween_property(self, "jitter_strength", 1.0, 1.0)
if has_entered: if has_entered:
ui_exited.emit() ui_exited.emit()
# Show hand cursor when player is enabled # Show hand cursor when player is enabled
if hand_cursor: if hand_cursor:
hand_cursor.visible = true hand_cursor.visible = true
@ -116,6 +116,9 @@ func _ready():
State.player = self State.player = self
State.player_view = %Camera3D State.player_view = %Camera3D
# Connect to central player enable signal.
Scenes.player_enable.connect(_on_player_enable)
_handle_jitter(0) _handle_jitter(0)
pitch.rotation_degrees.x = initial_pitch pitch.rotation_degrees.x = initial_pitch
@ -129,11 +132,6 @@ func _ready():
# Setup hand cursor # Setup hand cursor
_setup_hand_cursor() _setup_hand_cursor()
# Connect to central player enable signal.
# Guard for standalone test scenes without autoloads.
if get_node_or_null("/root/Scenes"):
Scenes.player_enable.connect(_on_player_enable)
# Apply exported enabled state now that nodes are ready # Apply exported enabled state now that nodes are ready
_apply_enabled_state() _apply_enabled_state()

View File

@ -53,7 +53,6 @@ func _enter_tree() -> void:
func _ready() -> void: func _ready() -> void:
print_debug("main.gd: _ready()") print_debug("main.gd: _ready()")
await get_tree().process_frame
main_menu.continue_button.pressed.connect(func(): app_state = AppState.PLAY) main_menu.continue_button.pressed.connect(func(): app_state = AppState.PLAY)
main_menu.credits_button.pressed.connect(func(): app_state = AppState.CREDITS) main_menu.credits_button.pressed.connect(func(): app_state = AppState.CREDITS)
@ -66,7 +65,6 @@ func _ready() -> void:
else: else:
print_debug("main.gd: direct boot (hiding menus and entering main loop)") print_debug("main.gd: direct boot (hiding menus and entering main loop)")
app_state = AppState.PLAY app_state = AppState.PLAY
curtain.open()
func start_game(save: SaveGame) -> void: func start_game(save: SaveGame) -> void: