Skip to content
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

Adding more Alignment options for Dialog Text #648

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 6 additions & 16 deletions addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func _ready() -> void:

n['button_layout'].connect('item_selected', self, '_on_button_layout_selected')

for button in ['dialog_box_anchor', 'button_position_on_screen']:
for button in ['dialog_box_anchor', 'button_position_on_screen', 'alignment']:
var button_positions_popup = n[button].get_popup()
button_positions_popup.clear()
button_positions_popup.add_icon_item(
Expand All @@ -240,8 +240,10 @@ func _ready() -> void:
button_positions_popup.add_icon_item(
get_icon("ControlAlignBottomRight", "EditorIcons"), "Bottom Right", 8)


n['button_position_on_screen'].connect('item_selected', self, '_on_button_anchor_selected')
n['dialog_box_anchor'].connect('item_selected', self, '_on_button_dialogbox_anchor_selected')
n['alignment'].connect('item_selected', self, '_on_Alignment_item_selected')

n['button_offset_x'].connect('value_changed', self, '_on_button_offset_changed')
n['button_offset_y'].connect('value_changed', self, '_on_button_offset_changed')
Expand Down Expand Up @@ -377,15 +379,8 @@ func load_theme(filename):
n['theme_shadow_offset_y'].value = theme.get_value('text', 'shadow_offset', Vector2(2,2)).y
n['theme_text_margin'].value = theme.get_value('text', 'margin', Vector2(20, 10)).x
n['theme_text_margin_h'].value = theme.get_value('text', 'margin', Vector2(20, 10)).y
n['alignment'].text = theme.get_value('text', 'alignment', 'Left')
match n['alignment'].text:
'Left':
n['alignment'].select(0)
'Center':
n['alignment'].select(1)
'Right':
n['alignment'].select(2)

n['alignment'].select(n['alignment'].get_item_index(theme.get_value('text', 'alignment', 0)))


# Name
n['name_font'].text = DialogicResources.get_filename_from_path(theme.get_value('name', 'font', 'res://addons/dialogic/Example Assets/Fonts/NameFont.tres'))
Expand Down Expand Up @@ -623,12 +618,7 @@ func _on_NameFontOpen_pressed():
func _on_Alignment_item_selected(index) -> void:
if loading:
return
if index == 0:
DialogicResources.set_theme_value(current_theme, 'text', 'alignment', 'Left')
elif index == 1:
DialogicResources.set_theme_value(current_theme, 'text', 'alignment', 'Center')
elif index == 2:
DialogicResources.set_theme_value(current_theme, 'text', 'alignment', 'Right')
DialogicResources.set_theme_value(current_theme, 'text', 'alignment', n['alignment'].get_item_id(index))
_on_PreviewButton_pressed() # Refreshing the preview


Expand Down
39 changes: 19 additions & 20 deletions addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/AudioPicker.tscn" type="PackedScene" id=7]
[ext_resource path="res://addons/dialogic/Editor/Common/TLabel.tscn" type="PackedScene" id=8]

[sub_resource type="Image" id=11]
[sub_resource type="Image" id=13]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "LumAlpha8",
Expand All @@ -18,13 +18,13 @@ data = {
"width": 16
}

[sub_resource type="ImageTexture" id=10]
[sub_resource type="ImageTexture" id=12]
flags = 4
flags = 4
image = SubResource( 11 )
image = SubResource( 13 )
size = Vector2( 16, 16 )

[sub_resource type="Image" id=12]
[sub_resource type="Image" id=14]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "LumAlpha8",
Expand All @@ -33,10 +33,10 @@ data = {
"width": 16
}

[sub_resource type="ImageTexture" id=8]
[sub_resource type="ImageTexture" id=10]
flags = 4
flags = 4
image = SubResource( 12 )
image = SubResource( 14 )
size = Vector2( 16, 16 )

[node name="ThemeEditor" type="ScrollContainer"]
Expand Down Expand Up @@ -102,7 +102,6 @@ size_flags_vertical = 3
tab_align = 0

[node name="Dialog Text" type="HBoxContainer" parent="VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
Expand Down Expand Up @@ -159,7 +158,7 @@ margin_left = 122.0
margin_right = 150.0
margin_bottom = 22.0
size_flags_vertical = 4
icon = SubResource( 10 )
icon = SubResource( 12 )

[node name="TLabel2" parent="VBoxContainer/TabContainer/Dialog Text/Column/GridContainer" instance=ExtResource( 8 )]
anchor_right = 0.0
Expand Down Expand Up @@ -189,7 +188,7 @@ margin_left = 122.0
margin_right = 150.0
margin_bottom = 22.0
size_flags_vertical = 4
icon = SubResource( 10 )
icon = SubResource( 12 )

[node name="TLabel3" parent="VBoxContainer/TabContainer/Dialog Text/Column/GridContainer" instance=ExtResource( 8 )]
anchor_right = 0.0
Expand Down Expand Up @@ -219,7 +218,7 @@ margin_left = 122.0
margin_right = 150.0
margin_bottom = 22.0
size_flags_vertical = 4
icon = SubResource( 10 )
icon = SubResource( 12 )

[node name="VSeparator" type="VSeparator" parent="VBoxContainer/TabContainer/Dialog Text"]
margin_left = 280.0
Expand Down Expand Up @@ -407,6 +406,7 @@ margin_right = 232.0
margin_bottom = 76.0

[node name="Dialog Box" type="HBoxContainer" parent="VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
Expand Down Expand Up @@ -591,8 +591,8 @@ margin_top = 56.0
margin_right = 266.0
margin_bottom = 78.0
text = "Top Left"
icon = SubResource( 8 )
items = [ "Top Left", SubResource( 10 ), false, 0, null, "Top Center", SubResource( 10 ), false, 1, null, "Top Right", SubResource( 10 ), false, 2, null, "", null, false, -1, null, "Center Left", SubResource( 10 ), false, 3, null, "Center", SubResource( 10 ), false, 4, null, "Center Right", SubResource( 10 ), false, 5, null, "", null, false, -1, null, "Bottom Left", SubResource( 10 ), false, 6, null, "Bottom Center", SubResource( 10 ), false, 7, null, "Bottom Right", SubResource( 10 ), false, 8, null ]
icon = SubResource( 10 )
items = [ "Top Left", SubResource( 12 ), false, 0, null, "Top Center", SubResource( 12 ), false, 1, null, "Top Right", SubResource( 12 ), false, 2, null, "", null, false, -1, null, "Center Left", SubResource( 12 ), false, 3, null, "Center", SubResource( 12 ), false, 4, null, "Center Right", SubResource( 12 ), false, 5, null, "", null, false, -1, null, "Bottom Left", SubResource( 12 ), false, 6, null, "Bottom Center", SubResource( 12 ), false, 7, null, "Bottom Right", SubResource( 12 ), false, 8, null ]
selected = 0
__meta__ = {
"_edit_use_anchors_": false
Expand Down Expand Up @@ -911,7 +911,7 @@ margin_left = 130.0
margin_right = 158.0
margin_bottom = 22.0
size_flags_vertical = 4
icon = SubResource( 10 )
icon = SubResource( 12 )

[node name="TLabel2" parent="VBoxContainer/TabContainer/Name Label/Column/GridContainer" instance=ExtResource( 8 )]
anchor_right = 0.0
Expand Down Expand Up @@ -1411,8 +1411,8 @@ margin_right = 309.0
margin_bottom = 130.0
size_flags_horizontal = 3
text = "Top Left"
icon = SubResource( 8 )
items = [ "Top Left", SubResource( 10 ), false, 0, null, "Top Center", SubResource( 10 ), false, 1, null, "Top Right", SubResource( 10 ), false, 2, null, "", null, false, -1, null, "Center Left", SubResource( 10 ), false, 3, null, "Center", SubResource( 10 ), false, 4, null, "Center Right", SubResource( 10 ), false, 5, null, "", null, false, -1, null, "Bottom Left", SubResource( 10 ), false, 6, null, "Bottom Center", SubResource( 10 ), false, 7, null, "Bottom Right", SubResource( 10 ), false, 8, null ]
icon = SubResource( 10 )
items = [ "Top Left", SubResource( 12 ), false, 0, null, "Top Center", SubResource( 12 ), false, 1, null, "Top Right", SubResource( 12 ), false, 2, null, "", null, false, -1, null, "Center Left", SubResource( 12 ), false, 3, null, "Center", SubResource( 12 ), false, 4, null, "Center Right", SubResource( 12 ), false, 5, null, "", null, false, -1, null, "Bottom Left", SubResource( 12 ), false, 6, null, "Bottom Center", SubResource( 12 ), false, 7, null, "Bottom Right", SubResource( 12 ), false, 8, null ]
selected = 0

[node name="TLabel6" parent="VBoxContainer/TabContainer/Choice Buttons/Column2/GridContainer" instance=ExtResource( 8 )]
Expand Down Expand Up @@ -1513,7 +1513,7 @@ margin_left = 90.0
margin_right = 118.0
margin_bottom = 22.0
size_flags_vertical = 4
icon = SubResource( 10 )
icon = SubResource( 12 )

[node name="VSeparator" type="VSeparator" parent="VBoxContainer/TabContainer/Glossary"]
margin_left = 280.0
Expand Down Expand Up @@ -1565,7 +1565,7 @@ margin_left = 90.0
margin_right = 118.0
margin_bottom = 22.0
size_flags_vertical = 4
icon = SubResource( 10 )
icon = SubResource( 12 )

[node name="TLabel2" parent="VBoxContainer/TabContainer/Glossary/Column3/GridContainer" instance=ExtResource( 8 )]
anchor_right = 0.0
Expand Down Expand Up @@ -1612,7 +1612,7 @@ margin_left = 90.0
margin_right = 118.0
margin_bottom = 22.0
size_flags_vertical = 4
icon = SubResource( 10 )
icon = SubResource( 12 )

[node name="TLabel4" parent="VBoxContainer/TabContainer/Glossary/Column3/GridContainer" instance=ExtResource( 8 )]
anchor_right = 0.0
Expand Down Expand Up @@ -1659,7 +1659,7 @@ margin_left = 90.0
margin_right = 118.0
margin_bottom = 22.0
size_flags_vertical = 4
icon = SubResource( 10 )
icon = SubResource( 12 )

[node name="TLabel6" parent="VBoxContainer/TabContainer/Glossary/Column3/GridContainer" instance=ExtResource( 8 )]
anchor_right = 0.0
Expand Down Expand Up @@ -1857,7 +1857,6 @@ one_shot = true
[connection signal="color_changed" from="VBoxContainer/TabContainer/Dialog Text/Column2/GridContainer/HBoxContainer2/ColorPickerButtonShadow" to="." method="_on_ColorPickerButtonShadow_color_changed"]
[connection signal="value_changed" from="VBoxContainer/TabContainer/Dialog Text/Column2/GridContainer/HBoxContainer/ShadowOffsetX" to="." method="_on_ShadowOffset_value_changed"]
[connection signal="value_changed" from="VBoxContainer/TabContainer/Dialog Text/Column2/GridContainer/HBoxContainer/ShadowOffsetY" to="." method="_on_ShadowOffset_value_changed"]
[connection signal="item_selected" from="VBoxContainer/TabContainer/Dialog Text/Column3/GridContainer/HBoxContainer3/Alignment" to="." method="_on_Alignment_item_selected"]
[connection signal="color_changed" from="VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer2/ColorPickerButton" to="." method="_on_BackgroundColor_ColorPickerButton_color_changed"]
[connection signal="pressed" from="VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer3/BackgroundTextureButton" to="." method="_on_BackgroundTextureButton_pressed"]
[connection signal="color_changed" from="VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer6/ColorPickerButton" to="." method="_on_ColorPicker_Background_texture_modulation_color_changed"]
Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Nodes/DialogNode.gd
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ func _ready():
$TextBubble.connect("text_completed", self, "_on_text_completed")
$TextBubble.connect("letter_written", self, "_on_letter_written")
$TextBubble.connect("signal_request", self, "_on_signal_request")
$TextBubble/RichTextLabel.connect('meta_hover_started', self, '_on_RichTextLabel_meta_hover_started')
$TextBubble/RichTextLabel.connect('meta_hover_ended', self, '_on_RichTextLabel_meta_hover_ended')
$TextBubble.text_label.connect('meta_hover_started', self, '_on_RichTextLabel_meta_hover_started')
$TextBubble.text_label.connect('meta_hover_ended', self, '_on_RichTextLabel_meta_hover_ended')

if Engine.is_editor_hint():
if preview:
Expand Down
48 changes: 40 additions & 8 deletions addons/dialogic/Nodes/TextBubble.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ extends Control

var text_speed := 0.02 # Higher = lower speed
var theme_text_speed = text_speed
var theme_text_max_height = 0

#experimental database of current commands
var commands = []
#the regex matching object
var regex = RegEx.new()
var bbcoderemoverregex = RegEx.new()

onready var text_label = $RichTextLabel
onready var text_container = $TextContainer
onready var text_label = $TextContainer/RichTextLabel
onready var name_label = $NameLabel
onready var next_indicator = $NextIndicatorContainer/NextIndicator

Expand Down Expand Up @@ -85,15 +87,38 @@ func update_text(text:String):

result = regex.search(text_bbcodefree)


# Updating the text and starting the animation from 0
text_label.bbcode_text = text
text_label.visible_characters = 0

## SIZING THE RICHTEXTLABEL
# The sizing is done in a very terrible way because the RichtTextLabel has
# a hard time knowing what size it will be and how to display this.
# for this reason the RichTextLabel ist first set to just go for the size it needs,
# even if this might be more than available.
text_label.size_flags_vertical = 0
text_label.fit_content_height = true
# a frame later, when the sizes have been updated, it will check if there
# is enough space or the scrollbar should be activated.
call_deferred("update_sizing")


# updating the size alignment stuff
text_label.grab_focus()
start_text_timer()
return true

func update_sizing():
# this will enable/disable the scrollbar based on the size of the text
theme_text_max_height = text_container.rect_size.y

if text_label.rect_size.y >= theme_text_max_height:
text_label.fit_content_height = false
text_label.size_flags_vertical = Control.SIZE_EXPAND_FILL
else:
text_label.fit_content_height = true
text_label.size_flags_vertical = 0


#handle an activated command.
func handle_command(command:Array):
if(command[1] == "speed"):
Expand Down Expand Up @@ -134,6 +159,14 @@ func load_theme(theme: ConfigFile):
text_label.set('custom_fonts/italics_font', DialogicUtil.path_fixer_load(theme.get_value('text', 'italic_font', 'res://addons/dialogic/Example Assets/Fonts/DefaultItalicFont.tres')))
name_label.set('custom_fonts/font', DialogicUtil.path_fixer_load(theme.get_value('name', 'font', 'res://addons/dialogic/Example Assets/Fonts/NameFont.tres')))

# setting the vertical alignment
var alignment = theme.get_value('text', 'alignment',0)
if alignment <= 2: # top
text_container.alignment = BoxContainer.ALIGN_BEGIN
elif alignment <= 5: # center
text_container.alignment = BoxContainer.ALIGN_CENTER
elif alignment <= 8: # bottom
text_container.alignment = BoxContainer.ALIGN_END

var text_color = Color(theme.get_value('text', 'color', '#ffffffff'))
text_label.set('custom_colors/default_color', text_color)
Expand All @@ -157,10 +190,10 @@ func load_theme(theme: ConfigFile):

# Margin
var text_margin = theme.get_value('text', 'margin', Vector2(20, 10))
text_label.set('margin_left', text_margin.x)
text_label.set('margin_right', text_margin.x * -1)
text_label.set('margin_top', text_margin.y)
text_label.set('margin_bottom', text_margin.y * -1)
text_container.set('margin_left', text_margin.x)
text_container.set('margin_right', text_margin.x * -1)
text_container.set('margin_top', text_margin.y)
text_container.set('margin_bottom', text_margin.y * -1)

# Backgrounds
$TextureRect.texture = DialogicUtil.path_fixer_load(theme.get_value('background','image', "res://addons/dialogic/Example Assets/backgrounds/background-2.png"))
Expand Down Expand Up @@ -219,7 +252,6 @@ func load_theme(theme: ConfigFile):
var animation = theme.get_value('next_indicator', 'animation', 'Up and down')
next_indicator.get_node('AnimationPlayer').play(animation)


# Saving reference to the current theme
_theme = theme

Expand Down
36 changes: 27 additions & 9 deletions addons/dialogic/Nodes/TextBubble.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tracks/0/keys = {
[sub_resource type="StyleBoxFlat" id=6]
content_margin_left = 20.0
content_margin_right = 20.0
content_margin_bottom = -200.0
content_margin_bottom = -170.0
bg_color = Color( 1, 1, 1, 0 )
expand_margin_left = 10.0

Expand All @@ -56,7 +56,7 @@ anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -455.0
margin_top = 393.0
margin_top = 399.0
margin_right = 455.0
margin_bottom = 560.0
script = ExtResource( 4 )
Expand All @@ -83,13 +83,24 @@ __meta__ = {
"_edit_use_anchors_": false
}

[node name="RichTextLabel" type="RichTextLabel" parent="."]
[node name="TextContainer" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 20.0
margin_top = 10.0
margin_right = -20.0
margin_bottom = -10.0
margin_left = 10.0
margin_top = 12.0
margin_right = -10.0
margin_bottom = -12.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="RichTextLabel" type="RichTextLabel" parent="TextContainer"]
margin_top = 11.0
margin_right = 890.0
margin_bottom = 125.0
focus_mode = 2
custom_colors/default_color = Color( 1, 1, 1, 1 )
custom_colors/selection_color = Color( 0, 0, 0, 0 )
Expand All @@ -100,9 +111,16 @@ custom_fonts/normal_font = ExtResource( 1 )
custom_styles/focus = SubResource( 1 )
custom_styles/normal = SubResource( 2 )
bbcode_enabled = true
bbcode_text = "Placeholder text for testing and formatting."
bbcode_text = "Placeholder text for testing an formatting.
Placeholder text for testing an formatting.
adsd"
visible_characters = 0
percent_visible = 0.0
meta_underlined = false
text = "Placeholder text for testing and formatting."
text = "Placeholder text for testing an formatting.
Placeholder text for testing an formatting.
adsd"
fit_content_height = true
selection_enabled = true
__meta__ = {
"_edit_use_anchors_": false
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Other/DialogicResources.gd
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static func get_theme_config(filename: String):
return config


static func set_theme_value(filename, section, key, value):
static func set_theme_value(filename:String, section:String, key:String, value):
# WARNING: For use in the editor only
var config = get_theme_config(filename)
config.set_value(section, key, value)
Expand Down