forked from dialogic-godot/dialogic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply type hints to example scripts to avoid triggering any GDScript …
…warnings or errors (dialogic-godot#1975) Adds static type hints to default style layers --------- Co-authored-by: Jowan-Spooner <[email protected]> Co-authored-by: Jowan-Spooner <[email protected]>
- Loading branch information
Showing
14 changed files
with
591 additions
and
468 deletions.
There are no files selected for viewing
This file contains 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 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
32 changes: 23 additions & 9 deletions
32
addons/dialogic/Modules/DefaultLayoutParts/Layer_History/example_history_item.gd
This file contains 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 |
---|---|---|
@@ -1,16 +1,30 @@ | ||
extends Container | ||
|
||
func get_text_box() -> RichTextLabel: | ||
return %TextBox | ||
|
||
func load_info(text:String, character:String = "", character_color:=Color(), icon:Texture= null) -> void: | ||
%TextBox.text = text | ||
|
||
func get_name_label() -> Label: | ||
return %NameLabel | ||
|
||
|
||
func get_icon() -> TextureRect: | ||
return %Icon | ||
|
||
|
||
func load_info(text:String, character:String = "", character_color: Color =Color(), icon:Texture= null) -> void: | ||
get_text_box().text = text | ||
var name_label : Label = get_name_label() | ||
if character: | ||
%NameLabel.text = character | ||
%NameLabel.add_theme_color_override('font_color', character_color) | ||
%NameLabel.show() | ||
name_label.text = character | ||
name_label.add_theme_color_override('font_color', character_color) | ||
name_label.show() | ||
else: | ||
%NameLabel.hide() | ||
name_label.hide() | ||
|
||
var icon_node : TextureRect = get_icon() | ||
if icon == null: | ||
%Icon.hide() | ||
icon_node.hide() | ||
else: | ||
%Icon.show() | ||
%Icon.texture = icon | ||
icon_node.show() | ||
icon_node.texture = icon |
Oops, something went wrong.