feat: major transitioning overhaul

This commit is contained in:
tiger tiger tiger 2026-01-18 21:53:19 +01:00
parent 517b1812ec
commit 6be6d6774a
12 changed files with 52 additions and 30 deletions

View File

@ -11,6 +11,8 @@ func start_room():
%UI.show()
$logic/PlayerController.process_mode = Node.PROCESS_MODE_INHERIT
await Main.curtain.open()
if not Scenes.is_sequence_repeating(Scenes.id.YOUTH_DRAVEN):
# Play intro scene directly (not triggered by CollectableUi)
await _play_intro_scene()

View File

@ -196,6 +196,15 @@ func add_note(note: StickyNote) -> void:
notes.append(note)
note.is_dragable = true
func appear():
await Main.curtain.close()
show()
await Main.curtain.open()
func vanish():
await Main.curtain.close()
hide()
await Main.curtain.open()
# Checks if a Node is currently inside the dropzone
func is_in_dropzone(to_check: Draggable) -> bool:

View File

@ -147,8 +147,8 @@ _data = {
}
[node name="board" type="PanelContainer"]
show_behind_parent = true
material = SubResource("ShaderMaterial_ttqei")
clip_contents = true
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0

View File

@ -37,14 +37,13 @@ func play() -> void:
# 3. Populate the 4 anchor slots with random cards
for ancor: Control in ancors:
var card: Card = stack.pop_front()
assert(card, "Not enough cards collected.")
cards.append(card)
ancor.add_child(card)
print_debug("CardBurner: Added card '%s' to anchor" % card.name)
print("CardBurner: ", len(cards))
await appear()
# 4. Wait for player to burn a card (or skip)
print_debug("CardBurner: Waiting for player to burn a card...")
handle_direction_input(Vector2.UP)

View File

@ -90,14 +90,22 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_copuj")
[node name="ColorRect" type="ColorRect" parent="."]
custom_minimum_size = Vector2(8192, 8192)
layout_mode = 2
color = Color(0, 0, 0, 0.5019608)
[node name="Control" type="Control" parent="."]
layout_mode = 2
[node name="ColorRect" type="ColorRect" parent="Control"]
show_behind_parent = true
custom_minimum_size = Vector2(8192, 8192)
layout_mode = 0
offset_left = -4096.0
offset_top = -4096.0
offset_right = 4096.0
offset_bottom = 4096.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 0.6745098)
[node name="Label" type="Label" parent="Control"]
layout_mode = 1
anchors_preset = 7

View File

@ -101,9 +101,10 @@ func _input(event: InputEvent) -> void:
func play_story() -> void:
# Check if this is a repeat playthrough
var repeat := collected
collected = true
canvas_layer.show()
await playable.appear()
# Allow room to prepare for scene (e.g., play animations)
await State.room.prepare_scene_start(playable.scene_id, repeat)
@ -111,7 +112,6 @@ func play_story() -> void:
Scenes.begin_sequence(playable.scene_id)
# Play the story
await playable.appear()
await playable.play()
# Pick the cards if not already picked
@ -131,11 +131,12 @@ func play_story() -> void:
func play_board() -> void:
canvas_layer.show()
await playable.appear()
# Play the board (handles mouse visibility and waits for close)
await playable.play()
# Hide the CanvasLayer when done
await playable.vanish()
canvas_layer.hide()
Scenes.player_enable.emit(true)
@ -144,18 +145,18 @@ func play_board() -> void:
func play_burner() -> void:
canvas_layer.show()
await playable.appear()
# Play the board (handles mouse visibility and waits for close)
# Play the burner mini-game, will actually send us to the next map
await playable.play()
# Hide the CanvasLayer when done
await playable.vanish()
canvas_layer.hide()
func interact() -> void:
Scenes.player_enable.emit(false)
await collapse()
collected = true
# collapse other interactables BEFORE showing canvas
get_tree().call_group("interactables", "collapse")

View File

@ -13,15 +13,17 @@ func handle_hover(_area: Draggable):
#prints("Playable[base].handle_hover", _area, _area.name)
pass
const TRANSPARENT_BLACK := Color(0,0,0,0)
func appear():
self.modulate = Color.TRANSPARENT
self.modulate = TRANSPARENT_BLACK
show()
var tween := create_tween().set_ease(Tween.EASE_IN)
tween.tween_property(self, "modulate", Color.WHITE, 1.5)
tween.tween_property(self, "modulate", Color.WHITE, 0.3)
await tween.finished
func vanish():
var tween := create_tween().set_ease(Tween.EASE_OUT)
tween.tween_property(self, "modulate", Color.TRANSPARENT, 1.5)
tween.tween_property(self, "modulate", TRANSPARENT_BLACK, 0.3)
await tween.finished
hide()

View File

@ -39,7 +39,6 @@ var app_state: AppState = AppState.BOOT:
credits_roll.hide()
main_menu.hide()
pause_menu.hide()
curtain.hide()
AppState.PAUSE:
credits_roll.hide()
main_menu.hide()
@ -76,7 +75,7 @@ func start_game(save: SaveGame) -> void:
await State.room.play()
func _load_room(next_path: String) -> bool:
await curtain.show()
await curtain.close()
%Loading.play()
if State.room != null:
@ -95,7 +94,6 @@ func _load_room(next_path: String) -> bool:
await get_tree().process_frame
await State.room.get_ready()
%Loading.stop()
await curtain.hide()
return true
ResourceLoader.THREAD_LOAD_FAILED:
push_error("Failed to load room.")

View File

@ -100,6 +100,7 @@ offset_bottom = 0.0
[node name="MainMenu" parent="." instance=ExtResource("3_ik73t")]
unique_name_in_owner = true
visible = false
z_index = 10
[node name="FPSLabel" type="Label" parent="."]
visible = false

View File

@ -5,22 +5,22 @@ var _tween : Tween = null
func _ready() -> void:
print_debug("curtain.gd: ready()")
show()
visible = true
func show() -> void:
visible = true
## Conceals the Game Stage
func close() -> void:
visible = true
print_debug("curtain.gd: show()")
if _tween != null:
_tween.kill()
if _tween: _tween.kill()
_tween = create_tween()
_tween.tween_property(self, "modulate:a", 1.0, 1.0)
_tween.tween_property(self, "modulate:a", 1.0, 0.7)
await _tween.finished
func hide() -> void:
## Makes the Game Stage Visible
func open() -> void:
print_debug("curtain.gd: hide()")
if _tween != null:
_tween.kill()
if _tween: _tween.kill()
_tween = create_tween()
_tween.tween_property(self, "modulate:a", 0.0, 1.0)
_tween.tween_property(self, "modulate:a", 0.0, 0.7)
await _tween.finished
visible = false

View File

@ -3,6 +3,7 @@
[ext_resource type="Script" uid="uid://cg7sc173lvchp" path="res://ui/curtain/curtain.gd" id="1_8qa50"]
[node name="Curtain" type="Panel"]
z_index = -10
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0

View File

@ -41,6 +41,7 @@ _data = {
}
[node name="Loading" type="Control"]
z_index = -5
layout_mode = 3
anchors_preset = 2
anchor_top = 1.0