fix: youth room debug timing

This commit is contained in:
tiger tiger tiger 2026-01-19 19:36:05 +01:00
parent 73d75da9a5
commit 8189df3f4d
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)
%LeftDetection.body_exited.connect(on_left_train_exit)
%RightDetection.body_exited.connect(on_right_train_exit)
%burnout_station.leave_room.connect(func():
proceed.emit(Main.adulthood_room_path))

View File

@ -9,8 +9,9 @@ extends RoomTemplate
func start_room():
super.start_room()
%UI.show()
await Main.curtain.open()
# To start breathing etc.
@ -37,6 +38,9 @@ func _play_intro_scene() -> void:
func get_ready():
super.get_ready()
prints("indeed")
Scenes.scene_finished.connect(_on_scene_finished)
card_board.board_completed.connect(func():
%DoorInteractable.show()
if not save_game.is_childhood_board_complete:
@ -57,14 +61,6 @@ func get_ready():
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:
save_game = save
save_game.current_room = id

View File

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

View File

@ -2,16 +2,14 @@ class_name PlayerController extends RigidBody3D
@export var enabled: bool = false:
set(value):
if enabled == value:
return
if enabled == value: return
enabled = value
_apply_enabled_state()
func _apply_enabled_state() -> void:
# Kill any existing jitter tween to prevent stacking
if jitter_tween and jitter_tween.is_valid():
jitter_tween.kill()
if jitter_tween: jitter_tween.kill()
if enabled:
camera.make_current()
@ -19,8 +17,10 @@ func _apply_enabled_state() -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
jitter_tween = create_tween()
jitter_tween.tween_property(self, "jitter_strength", 1.0, 1.0)
if has_entered:
ui_exited.emit()
# Show hand cursor when player is enabled
if hand_cursor:
hand_cursor.visible = true
@ -116,6 +116,9 @@ func _ready():
State.player = self
State.player_view = %Camera3D
# Connect to central player enable signal.
Scenes.player_enable.connect(_on_player_enable)
_handle_jitter(0)
pitch.rotation_degrees.x = initial_pitch
@ -129,11 +132,6 @@ func _ready():
# 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_enabled_state()

View File

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