Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The Eternal Loom welcomes you, StoryWeaver. Threads you collect help to repair t
if is_item_offering_possible():
=> have_threads
else:
It seems you are lacking the threads of Memory, Imagination, and Spirit... try coming back later.
It seems you are lacking the threads of [Memory]Memory[/Memory], [Imagination]Imagination[/Imagination], and [Spirit]Spirit[/Spirit]... try coming back later.
=> END

~ have_threads
Expand Down
16 changes: 16 additions & 0 deletions scenes/ui_elements/dialogue/balloon.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
[ext_resource type="Script" uid="uid://n1guv6m28qbw" path="res://scenes/ui_elements/dialogue/components/balloon.gd" id="1_oh0dh"]
[ext_resource type="Texture2D" uid="uid://dh4tixu06hfwt" path="res://assets/third_party/tiny-swords/UI/Banners/Carved_9Slides.png" id="3_1s4ug"]
[ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/nodes/dialogue_label/dialogue_label.tscn" id="4_3tiik"]
[ext_resource type="Script" uid="uid://ck3nll8j6ihhl" path="res://scenes/ui_elements/dialogue/components/text_effects/text_effect_imagination.gd" id="4_oyhl1"]
[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/nodes/responses_menu/dialogue_responses_menu.gd" id="5_gjlrd"]
[ext_resource type="Texture2D" uid="uid://brspc1u02oawt" path="res://assets/first_party/collectibles/memory.png" id="5_oh0dh"]
[ext_resource type="Script" uid="uid://bj58s4f3rjsqs" path="res://scenes/ui_elements/dialogue/components/response_button.gd" id="5_u3aeq"]
[ext_resource type="Script" uid="uid://dlf3lpdxx5paw" path="res://scenes/ui_elements/dialogue/components/text_effects/text_effect_memory.gd" id="5_w541t"]
[ext_resource type="Script" uid="uid://cpx3xcjv54tj2" path="res://scenes/ui_elements/dialogue/components/text_effects/text_effect_spirit.gd" id="6_6ahrn"]
[ext_resource type="Material" uid="uid://cruf3tlajs4jo" path="res://scenes/ui_elements/input_hints/components/drop_shadow_material.tres" id="6_y5co6"]
[ext_resource type="Texture2D" uid="uid://bbvedlx2ahdxk" path="res://assets/third_party/kenney_input_prompts/keyboard-&-mouse_sheet_default.png" id="7_u3aeq"]
[ext_resource type="Script" uid="uid://cbj0406q05dly" path="res://scenes/game_elements/props/hint/input_key/interact_input.gd" id="8_saw5e"]
Expand All @@ -31,6 +34,18 @@ axis_stretch_horizontal = 1
axis_stretch_vertical = 1
modulate_color = Color(1.3807716, 1.3807716, 1.3807716, 0.83137256)

[sub_resource type="RichTextEffect" id="RichTextEffect_4l5x3"]
script = ExtResource("4_oyhl1")
metadata/_custom_type_script = "uid://ck3nll8j6ihhl"

[sub_resource type="RichTextEffect" id="RichTextEffect_at502"]
script = ExtResource("5_w541t")
metadata/_custom_type_script = "uid://dlf3lpdxx5paw"

[sub_resource type="RichTextEffect" id="RichTextEffect_nh471"]
script = ExtResource("6_6ahrn")
metadata/_custom_type_script = "uid://cpx3xcjv54tj2"

[sub_resource type="AtlasTexture" id="AtlasTexture_oh0dh"]
atlas = ExtResource("7_u3aeq")
region = Rect2(128, 192, 64, 64)
Expand Down Expand Up @@ -129,6 +144,7 @@ layout_mode = 2
size_flags_vertical = 3
text = "¡Ah! ¿Another wanderer? It’s been a while siñce aňyone çame löõkiŋ for instead of «treaßure»."
vertical_alignment = 1
custom_effects = [SubResource("RichTextEffect_4l5x3"), SubResource("RichTextEffect_at502"), SubResource("RichTextEffect_nh471")]
skip_action = &"dialogue_skip"

[node name="ResponsesMenu" type="VBoxContainer" parent="Balloon/BalloonContainer/MarginContainer/MarginContainer/PanelContainer/MarginContainer/VBoxContainer" unique_id=938619174 node_paths=PackedStringArray("response_template")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
@tool
## Base class for the magical threads text effect
@abstract class_name BaseThreadsTextEffect
extends RichTextEffect

var text_color_1: Color
var text_color_2: Color

var speed: float = 4.0
var span: float = 2.0


func _process_custom_fx(char_fx: CharFXTransform) -> bool:
var time_var := sin(char_fx.elapsed_time * speed + (char_fx.range.x / span)) * 0.5 + 0.5

char_fx.color = text_color_1.lerp(text_color_2, time_var)
char_fx.offset = Vector2(0, -time_var * 2)

return true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://xyhvmawoc711
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
@tool
class_name ImaginationTextEffect

@manuq manuq Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scripts of all 3 effects are essentially the same. So please create a base class:

# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
@tool
## Base class for the magical threads text effect
@abstract class_name BaseThreadsTextEffect
extends RichTextEffect

var text_color_1: Color
var text_color_2: Color

var speed: float = 4.0
var span: float = 2.0


func _process_custom_fx(char_fx: CharFXTransform) -> bool:
	var time_var := sin(char_fx.elapsed_time * speed + (char_fx.range.x / span)) * 0.5 + 0.5

	char_fx.color = text_color_1.lerp(text_color_2, time_var)
	char_fx.offset = Vector2(0, -time_var * 2)

	return true

And then for example the text_effect_imagination.gd would be:

# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
@tool
class_name ImaginationTextEffect
extends BaseThreadsTextEffect

var bbcode := "Imagination"

func _init() -> void:
	text_color_1 = Color("7c6000ff")
	text_color_2 = Color("c49f23ff")

extends BaseThreadsTextEffect

var bbcode := "Imagination"


func _init() -> void:
text_color_1 = Color("7c6000ff")
text_color_2 = Color("c49f23ff")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://ck3nll8j6ihhl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
@tool
class_name MemoryTextEffect
extends BaseThreadsTextEffect

var bbcode := "Memory"


func _init() -> void:
text_color_1 = Color("4a7d00ff")
text_color_2 = Color("a0cf5bff")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dlf3lpdxx5paw
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
@tool
class_name SpiritTextEffect
extends BaseThreadsTextEffect

var bbcode := "Spirit"


func _init() -> void:
text_color_1 = Color("b20101ff")
text_color_2 = Color("de5b5bff")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cpx3xcjv54tj2
Loading