tiger-cleanup #1

Merged
tiger merged 97 commits from tiger-cleanup into development 2026-01-15 14:54:23 +00:00
17 changed files with 130 additions and 163 deletions
Showing only changes of commit 71bf3724da - Show all commits

View File

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<attachedFolders>
<Path>.</Path>
</attachedFolders>
<explicitIncludes />
<explicitExcludes>
<Path>.godot</Path>

View File

@ -31,8 +31,9 @@ var revealed: bool = false:
var has_mouse: bool = false
# Automatically triggered story playback - e.g. for Intro in Youth Room
func play_story() -> void:
await ui.story_playable.play()
await ui.collect_memento()
# Called when the node enters the scene tree for the first time.
func _ready():
@ -54,12 +55,10 @@ func _ready():
func _on_mouse_entered():
if not Scenes.is_playing:
input_ray_pickable = false
ui.is_collapsed = false
has_mouse = true
func _on_mouse_exited():
input_ray_pickable = true
ui.is_collapsed = true
has_mouse = false
func try_reveal(for_player: PlayerController) -> bool:
@ -79,7 +78,7 @@ func collapse():
func _on_playback_finished():
# Restore player controller control using the room's unique node reference
var player_controller = owner.get_node_or_null("%PlayerController")
var player_controller := owner.get_node_or_null("%PlayerController") as PlayerController
if player_controller and "has_stage" in player_controller:
player_controller.has_stage = true
else:

View File

@ -509,6 +509,7 @@ offset_right = -424.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_40hhx")
scene_id = 1
progress = 17.0
[node name="PanelContainer" type="PanelContainer" parent="."]

View File

@ -449,8 +449,6 @@ offset_right = -875.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_o2rjr")
story_array = PackedStringArray("Moonlight trickled down through clouds and twigs as Dräven tapped through the night.", "He had been searching for a while and he knew a special someone must be hiding in the thicket.", "When a familiar smell first led him to a few bronce hairs as fluffy as his tail, he didn\'t think much of it.", "But then he saw paw-prints, that matched his own where he had not been. Would he finally find someone of his kind?", "He was sure of it, as the familiar scent has never been stronger than tonight.", "When suddenly: Was that chatter?", "His wings rustled with joy over the familiar voice and Dräven decided to get a better look.", "A few flaps and leaps brought him up a tree, to get a glimpse of his soon to be friend.", "But all he saw was a fox.", "He didn\'t even want to bother it anymore.", "It would just scream and laugh at his wings of leafs, just like the trees crackled at his paws, that were no roots.", "With a small whimper, Dräven spread his wings, and slid away to at least find comfort by seeing his reflection in the nearby lake.", "It took him a while to notice, how there was a sudden silence when the clouds broke: ", "Northern lights danced through the sky to form wings, that met at a sleek body made of stars and clouds.", "The whole forest held its breath as it stared into eyes of moonlight gazing down.", "Dräven was moved to tears when he gazed back at it. He was sad for the dragon that was of the moon and the stars and the skies.", "It must feel so lost in the universe.", "But his tears were of joy: It was the first time Dräven saw another creature of many kinds.")
paragraph_lengths = PackedInt32Array(2, 4, 5, 6, 8, 9, 12, 14, 17)
[node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 2

View File

@ -821,6 +821,7 @@ offset_right = -424.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_aby4n")
scene_id = 3
progress = 17.0
[node name="PanelContainer" type="PanelContainer" parent="."]

View File

@ -661,8 +661,7 @@ offset_right = -424.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_543ki")
story_array = PackedStringArray("My secret comic stash. I remember playing Clue-Men with the boys.", "I had a voice for every character in that comic. But more often than not I played him: Agent Q.", "Going under the radar, putting in precise work to save the world.", "Not having to deal with being a girl.", "Boys were so much easier. They like cars, bikes, guns and agents.", "They don\'t talk behind your back. They don\'t think everything is about relationships.", "Girls don\'t get that. I knew they talked behind my back about me only “pretending” to like boy stuff, so Id get laid ", "… I mean, maybe they were right?", "Like I won\'t deny I was probably the first girl in my class to see a dick.", "But like - thats what the boys do, right?", "At least it has gotten better after me and Jojo became friends.", "I still remember how that happend. I did a voice acting workshop in art class.", "Being allowed to share my technique in front of everyone was just :D", "I mean next to nobody put in any effort. But Jojo did.", "When our Mr Funny then decided to ape her attempts instead of just minding his own, I pretty much exploded.", "After this, we suddenly were besties. And my class finally started to just leave me be. ", "Maybe because I for once was friends with another girl. Maybe because I scared them. Maybe both.")
paragraph_lengths = PackedInt32Array(1, 2, 5, 7, 9, 10, 13, 14, 16)
scene_id = 2
progress = 17.0
[node name="PanelContainer" type="PanelContainer" parent="."]
@ -724,12 +723,12 @@ render_target_update_mode = 3
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.21953, 3.52719, 0)
[node name="YouthSpecialMeshesComicBook1" type="MeshInstance3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport/Node3D"]
transform = Transform3D(-0.0923767, -0.0774974, -0.992704, 0.0851048, 0.992704, -0.0854169, 0.992081, -0.0923743, -0.0851073, -0.045, -0.111, 0.033)
transform = Transform3D(-0.09237667, -0.07749741, -0.992704, 0.085104756, 0.9927039, -0.08541691, 0.992081, -0.0923743, -0.08510727, -0.045, -0.111, 0.033)
mesh = ExtResource("3_ho85h")
skeleton = NodePath("../..")
[node name="YouthSpecialMeshesComicBook2" type="MeshInstance3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport/Node3D"]
transform = Transform3D(-0.42101, 0.126406, -0.773945, 0.152605, 0.785327, 0.0775686, 0.78068, -0.0853444, -0.432541, 0.02, -0.055, -0.02)
transform = Transform3D(-0.4210099, 0.12640645, -0.7739451, 0.15260528, 0.785327, 0.07756861, 0.78067994, -0.085344404, -0.4325408, 0.02, -0.055, -0.02)
mesh = ExtResource("4_kn83e")
skeleton = NodePath("../..")

View File

@ -157,7 +157,7 @@ func arrange(cards: Array[Card], rect: Rect2, _obstacles: Array[Area2D]) -> Arra
if (colliding.position - card.position).length() > (nearest.position - card.position).length():
nearest = colliding
card.position += min(nearest.position - card.position.normalized() * card.diameter + 1, nearest.position - card.position)
card.position += min(nearest.position - card.position.normalized() * (card.diameter + 1), nearest.position - card.position)
continue
break

View File

@ -1,5 +1,9 @@
class_name CardCollider
extends Area2D
var is_dragged: bool = false
@export var direction: Vector2 = Vector2.ZERO
var is_dragged: bool = false:
set(dragged):
is_dragged = dragged
z_index = int(dragged)

View File

@ -1,4 +1,4 @@
extends Area2D
extends CardCollider
class_name Card
var card_id
@ -33,8 +33,11 @@ var transfor_arr: Array[Transform2D] = [
set(value):
text = value
_on_text_updated()
var label:Label
var background_sprite: AnimatedSprite2D
@onready var label: Label = $Label
@onready var background_sprite: AnimatedSprite2D = $AnimatedSprite2D
@export var picked_random: bool = false
@ -70,7 +73,7 @@ var background_sprite: AnimatedSprite2D
@export var voice_line: AudioStream = null
@export var is_dragable: bool = false
@export var diameter = 336.0
@export var diameter := 336.0
@export_range(0, 2) var burn_progress: float = 0:
set(burn):
if is_node_ready():
@ -125,12 +128,6 @@ var crumble_material: ShaderMaterial = preload("res://logic-scenes/card_burner/c
var card_fire: Sprite2D = preload("res://logic-scenes/card_burner/card_fire.tscn").instantiate()
var sticky_note_position: Vector2 = Vector2(-66, 83)
var collider: Shape2D
var is_dragged: bool = false:
set(dragged):
is_dragged = dragged
z_index = int(dragged)
var is_mouse_entered: bool = false
var mouse_offset: Vector2
@ -147,35 +144,12 @@ func _ready():
mouse_entered.connect(_on_mouse_entered)
mouse_exited.connect(_on_mouse_exited)
background_sprite = AnimatedSprite2D.new()
background_sprite.sprite_frames = preload("res://logic-scenes/board/card-textures/card-sprites.tres")
background_sprite.clip_children = CanvasItem.CLIP_CHILDREN_AND_DRAW
label = Label.new()
label.theme_type_variation = "card_text"
label.size = Vector2(273.0, 131.0)
label.position = Vector2(-135.0, -82.0)
label.autowrap_mode = TextServer.AUTOWRAP_WORD
var collision_shape: = CollisionShape2D.new()
collider = CapsuleShape2D.new()
collider.height = diameter
collider.radius = 110
collision_shape.shape = collider
add_child(collision_shape, false, Node.INTERNAL_MODE_FRONT)
add_child(background_sprite, false, Node.INTERNAL_MODE_FRONT)
add_child(label, false, Node.INTERNAL_MODE_FRONT)
collision_shape.rotation = PI/2
_handle_wiggle(0)
_on_text_updated()
_on_text_updated.call_deferred()
func _on_text_updated():
if is_node_ready():
var curr_frame = text.hash() % background_sprite.sprite_frames.get_frame_count(background_sprite.animation)
var curr_frame := text.hash() % background_sprite.sprite_frames.get_frame_count(background_sprite.animation)
background_sprite.frame = curr_frame
background_sprite.scale = Vector2(0.6, 0.6)

View File

@ -1,8 +1,38 @@
[gd_scene load_steps=2 format=3 uid="uid://dy5rd437h5hsw"]
[gd_scene load_steps=5 format=3 uid="uid://dy5rd437h5hsw"]
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="1_emip0"]
[ext_resource type="SpriteFrames" uid="uid://j7e7me3hl6xt" path="res://logic-scenes/board/card-textures/card-sprites.tres" id="2_mai6h"]
[ext_resource type="Theme" uid="uid://d1jvpqykmpfyg" path="res://logic-scenes/themes/serif.theme" id="3_mdi7r"]
[node name="card" type="Area2D"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mai6h"]
size = Vector2(511, 410)
[node name="Card" type="Area2D"]
script = ExtResource("1_emip0")
text = "asdf"
metadata/_custom_type_script = "uid://ddy8kb2hjvgss"
metadata/type = "card"
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = ExtResource("2_mai6h")
[node name="Label" type="Label" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -203.0
offset_top = -166.29167
offset_right = 224.0
offset_bottom = 173.12498
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("3_mdi7r")
theme_type_variation = &"card_text"
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. "
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 3
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(11, -2)
shape = SubResource("RectangleShape2D_mai6h")

View File

@ -215,9 +215,15 @@ func is_sticky_note_in_panel() -> bool:
## fixme ~> see above
return attached_to is StickyNotePanel
var transform_tween: Tween
func tween_transform_to(target: Transform2D):
var transform_tween: Tween = create_tween()
if transform_tween and transform_tween.is_running():
transform_tween.stop()
transform_tween = create_tween()
transform_tween.tween_property(self, "transform", target, 0.25)
await transform_tween.finished
transform_tween_finished.emit()

View File

@ -11,20 +11,8 @@ enum {
DONE
}
var has_stage: bool = false:
set(focus):
if not focus == has_stage:
if focus:
process_mode = Node.PROCESS_MODE_INHERIT
self.show()
self.mouse_filter = Control.MOUSE_FILTER_PASS
else:
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
self.hide()
process_mode = Node.PROCESS_MODE_DISABLED
has_stage = focus
var _input_locked: bool = true
var selection_state := INI:
set(state):
print_debug("Setting picker state to %s" % ["INI","CARDS","CARDS_SELECTED","TRANSITION","POSTS","POSTS_SELECTED","DONE"][state])
@ -38,6 +26,7 @@ var selection_state := INI:
reset()
var anim_players:Array[AnimationPlayer] = []
var curr_selection_id: int = -1:
set(new_id):
if selection_state == CARDS or selection_state == POSTS:
@ -84,7 +73,6 @@ func fill_card_slots(id: int):
new_card.connect("mouse_entered", Callable(self, "get_highlight"))
options.append(new_card)
anim_players.append($cards.get_child(i).get_child(0))
reset()
func fill_post_slots():
var sticky_notes: Array[StickyNote] = []
@ -110,15 +98,11 @@ var random_player: AnimationPlayer
var on_cooldown: bool = false
var card_anim_skipped:bool = false
func _input(event):
#if event.is_action_pressed("ui_end"):
# fill_card_slots(3)
# selection_state = CARDS
func _input(event):
if event is not InputEventAction:
return
if has_stage:
if not _input_locked:
if not on_cooldown:
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"):
@ -151,7 +135,7 @@ func _input(event):
show_posts()
func pick(id: int):
func pick(id: int) -> void:
print_debug("%s picked card %s at id %d" % [name, options[id].text, id])
if id == -1:
curr_selection_id = 0
@ -164,7 +148,8 @@ func pick(id: int):
anim_players[id].play("pick")
picked_player = anim_players[id]
var yield_to = anim_players[id].animation_finished
var yield_to := anim_players[id].animation_finished
output.append(options[id])
options.remove_at(id)
@ -252,12 +237,9 @@ func pick_cards(id: int, repeat: bool):
if not repeat:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
fill_card_slots(id)
reset()
show()
selection_state = CARDS
if id == Scenes.id.YOUTH_DRAEVEN and not repeat:
$Meaning.play()
else:
Scenes.finish_sequence(self)
func play_scene(_id, _repeat):
pass
await cards_picked

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=73 format=3 uid="uid://brk4hjdf2x81a"]
[ext_resource type="Script" uid="uid://bdb6n10apk1en" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"]
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_f4sp4"]
[ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="2_t7byf"]
[ext_resource type="Script" uid="uid://r12efqgk6t4n" path="res://logic-scenes/board/sticky-note.gd" id="3_f4sp4"]
[ext_resource type="AudioStream" uid="uid://bakwypwhs7a5n" path="res://base-environments/youth_room/audio/why-does-it-mean.wav" id="4_ujc5a"]
[ext_resource type="Script" uid="uid://c1oub0cs7cph6" path="res://dev-util/stereo-switch.gd" id="5_et74x"]
@ -1749,7 +1749,7 @@ layout_mode = 2
[node name="label" type="Label" parent="Control"]
visible = false
layout_mode = 2
layout_mode = 0
offset_left = -359.0
offset_top = -256.0
offset_right = 358.0
@ -1761,7 +1761,6 @@ horizontal_alignment = 1
layout_mode = 2
[node name="card_1" type="Control" parent="cards"]
layout_mode = 2
anchors_preset = 0
offset_left = -317.0
offset_top = 25.0
@ -1774,13 +1773,9 @@ libraries = {
&"": SubResource("AnimationLibrary_gdxmh")
}
[node name="Card" type="Area2D" parent="cards/card_1"]
script = ExtResource("2_f4sp4")
text = "Slot 1"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="Card" parent="cards/card_1" instance=ExtResource("2_t7byf")]
[node name="card_2" type="Control" parent="cards"]
layout_mode = 2
anchors_preset = 0
[node name="AnimationPlayer" type="AnimationPlayer" parent="cards/card_2"]
@ -1788,13 +1783,9 @@ libraries = {
&"": SubResource("AnimationLibrary_oxheu")
}
[node name="Card" type="Area2D" parent="cards/card_2"]
script = ExtResource("2_f4sp4")
text = "Slot 2"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="Card" parent="cards/card_2" instance=ExtResource("2_t7byf")]
[node name="card_3" type="Control" parent="cards"]
layout_mode = 2
anchors_preset = 0
offset_left = 315.0
offset_top = 22.0
@ -1807,16 +1798,12 @@ libraries = {
&"": SubResource("AnimationLibrary_8blxm")
}
[node name="Card" type="Area2D" parent="cards/card_3"]
script = ExtResource("2_f4sp4")
text = "Slot 3"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="Card" parent="cards/card_3" instance=ExtResource("2_t7byf")]
[node name="sticky_notes" type="Panel" parent="."]
layout_mode = 2
[node name="sticky_note_1" type="Control" parent="sticky_notes"]
layout_mode = 2
anchors_preset = 0
offset_top = -150.0
offset_bottom = -150.0
@ -1834,7 +1821,6 @@ text = "Slot 1"
metadata/_custom_type_script = "uid://r12efqgk6t4n"
[node name="sticky_note_2" type="Control" parent="sticky_notes"]
layout_mode = 2
anchors_preset = 0
offset_top = -50.0
offset_bottom = -50.0
@ -1852,7 +1838,6 @@ text = "Slot 2"
metadata/_custom_type_script = "uid://r12efqgk6t4n"
[node name="sticky_note_3" type="Control" parent="sticky_notes"]
layout_mode = 2
anchors_preset = 0
offset_top = 50.0
offset_bottom = 50.0
@ -1870,7 +1855,6 @@ text = "Slot 3"
metadata/_custom_type_script = "uid://r12efqgk6t4n"
[node name="sticky_note_4" type="Control" parent="sticky_notes"]
layout_mode = 2
anchors_preset = 0
offset_top = 150.0
offset_bottom = 150.0

View File

@ -3,22 +3,21 @@ class_name CollectableUi
@onready var canvas_layer: CanvasLayer = %CanvasLayer
signal open_board
signal exit_room
signal playback_finished
#TODO implement proper scene skipping
signal scene_skipped(i: int)
## STATE VARIABLES
## The StoryPlayable to play when this memento is collected.
## Auto-discovered from the owner's %CanvasLayer, or can be set manually.
var story_playable: StoryPlayable
@export var has_stage: bool = false:
set(focused):
if has_stage == focused: return
if focused:
has_stage = true
is_collapsed = false
if not visible: show()
else:
has_stage = false
get_viewport().gui_release_focus()
is_collapsed = true
@export var scene: Scenes.id = Scenes.id.YOUTH_DRAEVEN:
set(id):
@ -92,7 +91,6 @@ var story_playable: StoryPlayable
@onready var cn_label: RichTextLabel = %ContentNoteLabel
@onready var animation_player: AnimationPlayer = %AnimationPlayer
@export var is_collapsed: bool = true
@export var is_expanded: bool = false:
set(expanded):
if expanded != is_expanded:
@ -141,13 +139,6 @@ var story_playable: StoryPlayable
collected_box.show()
signal open_board
signal exit_room
signal playback_finished
#TODO implement proper scene skipping
signal scene_skipped(i: int)
func _ready() -> void:
State.settings_changed.connect(_on_context_updated)
%CollectButton.pressed.connect(collect_memento)
@ -170,10 +161,6 @@ func update_state() -> void:
_on_context_updated()
func try_reveal() -> bool:
#if is_exit and not State.active_save_game.is_childhood_board_complete: return false
#if not is_board:
# if (not Scenes.is_sequence_unlocked( self.scene )) or false: #FIXME only for testing!!!
# return false
if not visible or animation_player.get_animation("vanish") or animation_player.get_animation("vanish_all"):
update_state()
visible = true
@ -181,15 +168,6 @@ func try_reveal() -> bool:
return true
return false
#func _process(_delta: float) -> void:
# if not visible or Engine.is_editor_hint(): return
# if Input.is_action_just_pressed("collect_memento_ui"):
# if not is_board:
# collect_memento()
# else:
# open_board.emit()
# elif Input.is_action_just_pressed("option_memento_ui"):
# is_expanded = true
#FIXME something was eating all my inputs, maybe I can use the more pretty pattern when I figure out the culprit
func _input(event: InputEvent) -> void:
@ -243,6 +221,10 @@ func collect_memento() -> void:
# Play the story
await story_playable.play()
# Pick the cards
var picker := State.room.get_node("%Picker") as CardPicker
await picker.pick_cards(story_playable.scene_id, false)
# Hide the CanvasLayer when done
canvas_layer.hide()
@ -256,5 +238,7 @@ func collect_memento() -> void:
scene_skipped.emit(-1)
is_collected = true
get_viewport().gui_release_focus()
# Signal that playback is finished so the InteractiveSprite can restore player control
playback_finished.emit()

View File

@ -6,6 +6,9 @@ signal finished
signal intro
signal emit_thunder
@export var scene_id : Scenes.id
#TODO properly implement animation taking stage, as it should do, disabling processing when it does not have stage.
var max_lines: float = 0

View File

@ -117,7 +117,7 @@ func _process(_delta):
#dhas_entered = false
if Input.is_action_just_pressed("ui_accept"):
# Pass focus to the collider if it has has_stage property
var collider = focus_ray.get_collider()
var collider := focus_ray.get_collider()
if collider and "has_stage" in collider:
has_stage = false
collider.has_stage = true

View File

@ -191,7 +191,7 @@ crouch={
[internationalization]
locale/translations=PackedStringArray("res://internationalisation.de.translation", "res://internationalisation.en.translation")
locale/translations=PackedStringArray("res://internationalisation.de.translation", "res://internationalisation.en.translation", "res://internationalisation.es.translation", "res://internationalisation.ja.translation")
locale/test="de"
[layer_names]