Repository navigation
Format the words Memory, Imagination and Spirit in dialogue - #2959
Conversation
|
Test build no longer available. |
|
Pre-commit is skipping my files, should i move them to another folder? |
Yes, that's because The actual dialogue balloon used in the game is Is it possible to add the custom RichTextEffects without editing the addon? |
Custom effects are only inserted in the markup section of the custom RichTextLabel that DialogueManager uses I'm not sure if this counts as editing the addon. If it's okay, I can just move the text effects to |
Yes, move them to our balloon, instead of changing the addon. Also, please move all scripts into
|
manuq
left a comment
There was a problem hiding this comment.
As commented, this change shouldn't affect the addon. It can be done in Threadbare's balloon.
manuq
left a comment
There was a problem hiding this comment.
This works very well! I think it needs refactoring to avoid having 3 scripts that are almost the same.
| # SPDX-FileCopyrightText: The Threadbare Authors | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| @tool | ||
| class_name ImaginationTextEffect |
There was a problem hiding this comment.
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 trueAnd 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")| var text_color := Color("#7C6000") | ||
| var text_markup := Color("c49f23ff") |
There was a problem hiding this comment.
Please use same color notation for each variable so they are consistent. You can change the notation from the color picker in the editor.
Grabacion.de.pantalla.desde.2026-09-23.21-39-46.mp4
The second one called "markup" confused me. Checking the code in _process_custom_fx, it lerps between them. So I would just call them color 1 and color 2, or color A and color B, or "start" and "end".
| var text_color := Color("#7C6000") | |
| var text_markup := Color("c49f23ff") | |
| var text_color_1 := Color("7c6000ff") | |
| var text_color_2 := Color("c49f23ff") |




Creates Custom RichTextEffects for each thread type
Can be used in
.dialoguefiles as a tagResolves: #392