Repository navigation
Format the words Memory, Imagination and Spirit in dialogue #2959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e7cff64
loomAnimation unused code
Un-player0 c86367b
custom richtexteffect
Un-player0 5ca4500
Merge branch 'main' of https://github.com/Un-player0/threadbare-fork
Un-player0 ba680c5
label insert effects
Un-player0 4db1c79
moving to scenes
Un-player0 0bc0f45
balloon instead of addon
Un-player0 45507c8
licensing
Un-player0 ce6c36f
suggestions
Un-player0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
scenes/ui_elements/dialogue/components/text_effects/base_threads_text_effect.gd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
1 change: 1 addition & 0 deletions
1
scenes/ui_elements/dialogue/components/text_effects/base_threads_text_effect.gd.uid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uid://xyhvmawoc711 |
12 changes: 12 additions & 0 deletions
12
scenes/ui_elements/dialogue/components/text_effects/text_effect_imagination.gd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| extends BaseThreadsTextEffect | ||
|
|
||
| var bbcode := "Imagination" | ||
|
|
||
|
|
||
| func _init() -> void: | ||
| text_color_1 = Color("7c6000ff") | ||
| text_color_2 = Color("c49f23ff") | ||
1 change: 1 addition & 0 deletions
1
scenes/ui_elements/dialogue/components/text_effects/text_effect_imagination.gd.uid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uid://ck3nll8j6ihhl |
12 changes: 12 additions & 0 deletions
12
scenes/ui_elements/dialogue/components/text_effects/text_effect_memory.gd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
1 change: 1 addition & 0 deletions
1
scenes/ui_elements/dialogue/components/text_effects/text_effect_memory.gd.uid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uid://dlf3lpdxx5paw |
12 changes: 12 additions & 0 deletions
12
scenes/ui_elements/dialogue/components/text_effects/text_effect_spirit.gd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
1 change: 1 addition & 0 deletions
1
scenes/ui_elements/dialogue/components/text_effects/text_effect_spirit.gd.uid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uid://cpx3xcjv54tj2 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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:
And then for example the
text_effect_imagination.gdwould be: