First work on dialogic, resized guild, and started implementing portraits.

This commit is contained in:
2025-08-14 10:26:24 -04:00
parent 95a7db036b
commit 3aeb3d44e6
959 changed files with 47688 additions and 46 deletions

View File

@@ -0,0 +1,21 @@
@tool
extends DialogicLayoutBase
## The default layout base scene.
@export var canvas_layer: int = 1
@export var follow_viewport: bool = false
@export_subgroup("Global")
@export var global_bg_color: Color = Color(0, 0, 0, 0.9)
@export var global_font_color: Color = Color("white")
@export_file('*.ttf', '*.tres') var global_font: String = ""
@export var global_font_size: int = 18
func _apply_export_overrides() -> void:
# apply layer
set(&'layer', canvas_layer)
set(&'follow_viewport_enabled', follow_viewport)

View File

@@ -0,0 +1 @@
uid://wg42kuw3p6gy

View File

@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cqpb3ie51rwl5"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Base_Default/default_layout_base.gd" id="1_ifsho"]
[node name="DefaultLayoutBase" type="CanvasLayer"]
script = ExtResource("1_ifsho")

View File

@@ -0,0 +1,6 @@
[style]
type = "Layout Base"
name = "Default Layout Base"
author = "Dialogic"
description = "A very simple base for layouts."
scene = "default_layout_base.tscn"

View File

@@ -0,0 +1,6 @@
[style]
type = "Layout Base"
name = "Textbubble Base"
author = "Dialogic"
description = "A base scene for the textbubble style. Expects a textbubble layer."
scene = "text_bubble_base.tscn"

View File

@@ -0,0 +1,94 @@
@tool
extends DialogicLayoutBase
## This layout won't do anything on its own
var bubbles: Array = []
var registered_characters: Dictionary = {}
@export_group("Main")
@export_range(1, 25, 1) var bubble_count: int = 2
func _ready() -> void:
if Engine.is_editor_hint():
return
DialogicUtil.autoload().Text.about_to_show_text.connect(_on_dialogic_text_event)
$Example/CRT.position = $Example.get_viewport_rect().size/2
if not has_node('TextBubbleLayer'):
return
if len(bubbles) < bubble_count:
add_bubble()
func register_character(character:Variant, node:Node):
if typeof(character) == TYPE_STRING:
var character_string: String = character
if character.begins_with("res://"):
character = load(character)
else:
character = DialogicResourceUtil.get_character_resource(character)
if not character:
printerr("[Dialogic] Textbubble: Tried registering character from invalid string '", character_string, "'.")
registered_characters[character] = node
if len(registered_characters) > len(bubbles) and len(bubbles) < bubble_count:
add_bubble()
func _get_persistent_info() -> Dictionary:
return {"textbubble_registers": registered_characters}
func _load_persistent_info(info: Dictionary) -> void:
var register_info: Dictionary = info.get("textbubble_registers", {})
for character in register_info:
if is_instance_valid(register_info[character]):
register_character(character, register_info[character])
func add_bubble() -> void:
if not has_node('TextBubbleLayer'):
return
var new_bubble: Control = get_node("TextBubbleLayer").add_bubble()
bubbles.append(new_bubble)
func _on_dialogic_text_event(info:Dictionary):
var bubble_to_use: Node
for bubble in bubbles:
if bubble.current_character == info.character:
bubble_to_use = bubble
if bubble_to_use == null:
for bubble in bubbles:
if bubble.current_character == null:
bubble_to_use = bubble
if bubble_to_use == null:
bubble_to_use = bubbles[0]
var node_to_point_at: Node
if info.character in registered_characters:
node_to_point_at = registered_characters[info.character]
$Example.hide()
else:
node_to_point_at = $Example/CRT/Marker
$Example.show()
bubble_to_use.current_character = info.character
bubble_to_use.node_to_point_at = node_to_point_at
bubble_to_use.reset()
if has_node('TextBubbleLayer'):
get_node("TextBubbleLayer").bubble_apply_overrides(bubble_to_use)
bubble_to_use.open()
## Now close other bubbles
for bubble in bubbles:
if bubble != bubble_to_use:
bubble.close()
bubble.current_character = null

View File

@@ -0,0 +1 @@
uid://b8sku3tbf1hoq

View File

@@ -0,0 +1,55 @@
[gd_scene load_steps=3 format=3 uid="uid://syki6k0e6aac"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Base_TextBubble/text_bubble_base.gd" id="1_urqwc"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_70ljh"]
content_margin_left = 5.0
content_margin_top = 5.0
content_margin_right = 5.0
content_margin_bottom = 5.0
bg_color = Color(0, 0, 0, 0.654902)
[node name="TextBubbleHolder" type="CanvasLayer"]
script = ExtResource("1_urqwc")
[node name="Example" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="RichTextLabel" parent="Example"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 12.0
offset_top = -235.0
offset_right = 835.0
offset_bottom = -14.0
grow_vertical = 0
theme_override_styles/normal = SubResource("StyleBoxFlat_70ljh")
bbcode_enabled = true
text = "This is a fallback bubble, that is not actually connected to any character. In game use the following code to add speech bubbles to a character:
[color=darkgray]
var layout = Dialogic.start(timeline_path)
layout.register_character(character_resource, node)
[/color]
- [color=lightblue]character_resource[/color] should be a loaded DialogicCharacter (a .dch file).
- [color=lightblue]node[/color] should be the 2D or 3D node the bubble should point at.
-> E.g. [color=darkgray]layout.register_character(load(\"res://path/to/my/character.dch\"), $BubbleMarker)"
[node name="CRT" type="ColorRect" parent="Example"]
layout_mode = 0
offset_left = 504.0
offset_top = 290.0
offset_right = 540.0
offset_bottom = 324.0
rotation = 0.785397
color = Color(1, 0.313726, 1, 1)
[node name="Marker" type="Marker2D" parent="Example/CRT"]
position = Vector2(10.6066, 9.1924)

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" version="1.1" id="svg32487" sodipodi:docname="picture.svg" inkscape:export-filename="..\dialogic\dialogic\addons\dialogic\Modules\LayoutStuff\Layer_FullBackground\background_layer_icon.png" inkscape:export-xdpi="96" inkscape:export-ydpi="96" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs32491" />
<sodipodi:namedview id="namedview32489" pagecolor="#505050" bordercolor="#eeeeee" borderopacity="1" inkscape:showpageshadow="0" inkscape:pageopacity="0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" showgrid="false" />
<path d="M 7.191,6 C 6.87508,6 6.57215,6.11708 6.34885,6.32546 6.12546,6.53385 6,6.81646 6,7.11108 V 24.8889 c 0,0.2946 0.12546,0.5773 0.34885,0.7856 C 6.57215,25.8829 6.87508,26 7.191,26 h 17.618 c 0,0 0.6188,-0.1171 0.8422,-0.3255 C 25.8745,25.4662 26,25.1835 26,24.8889 26,24.5942 26,7.11108 26,7.11108 26,6.81646 25.8745,6.53385 25.6512,6.32546 25.4278,6.11708 25.1249,6 24.809,6 Z M 8.22223,8.22223 H 23.7778 V 21.5555 H 8.22223 Z" fill="#ffffff" id="path32483" />
<path d="M 20.4326,19.7336 H 11.749 c -0.7571,0 -1.3172,-0.6658 -1.146,-1.3624 l 0.6072,-2.47 c 0.134,-0.5452 0.6764,-0.9111 1.266,-0.8541 l 1.8929,0.1834 c 0.3794,0.0368 0.7542,-0.1025 1.0054,-0.3736 l 2.335,-2.5203 c 0.6051,-0.6532 1.7341,-0.4282 2.0083,0.4002 l 1.8377,5.5543 c 0.2368,0.7154 -0.3292,1.4425 -1.1229,1.4425 z" fill="#ffffff" id="path32485" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cm8w3lr5o038d"
path="res://.godot/imported/background_layer_icon.svg-021cd7ab7c646ee621f9b89b8dfc9d60.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/background_layer_icon.svg"
dest_files=["res://.godot/imported/background_layer_icon.svg-021cd7ab7c646ee621f9b89b8dfc9d60.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

View File

@@ -0,0 +1,2 @@
@tool
extends DialogicLayoutLayer

View File

@@ -0,0 +1,25 @@
[gd_scene load_steps=3 format=3 uid="uid://c1k5m0w3r40xf"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/full_background_layer.gd" id="1_tu40u"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Background/node_background_holder.gd" id="2_ghan2"]
[node name="BackgroundLayer" type="Control"]
layout_direction = 2
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_tu40u")
[node name="DialogicNode_BackgroundHolder" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(1, 1, 1, 0)
script = ExtResource("2_ghan2")

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "Full Background"
author = "Dialogic"
description = "A simple layer displaying backgrounds."
scene = "full_background_layer.tscn"
icon = "background_layer_icon.svg"

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c3hagnfudj3nk"
path="res://.godot/imported/preview.png-4e6ca7ca01626d69870923f306b0d377.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/preview.png"
dest_files=["res://.godot/imported/preview.png-4e6ca7ca01626d69870923f306b0d377.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,177 @@
@tool
extends DialogicLayoutLayer
## Layer that provides a popup with glossary info,
## when hovering a glossary entry on a text node.
@export_group('Text')
enum Alignment {LEFT, CENTER, RIGHT}
@export var title_alignment: Alignment = Alignment.LEFT
@export var text_alignment: Alignment = Alignment.LEFT
@export var extra_alignment: Alignment = Alignment.RIGHT
@export_subgroup("Colors")
enum TextColorModes {GLOBAL, ENTRY, CUSTOM}
@export var title_color_mode: TextColorModes = TextColorModes.ENTRY
@export var title_custom_color: Color = Color.WHITE
@export var text_color_mode: TextColorModes = TextColorModes.ENTRY
@export var text_custom_color: Color = Color.WHITE
@export var extra_color_mode: TextColorModes = TextColorModes.ENTRY
@export var extra_custom_color: Color = Color.WHITE
@export_group("Font")
@export var font_use_global: bool = true
@export_file('*.ttf', '*.tres') var font_custom: String = ""
@export_subgroup('Sizes')
@export var font_title_size: int = 18
@export var font_text_size: int = 17
@export var font_extra_size: int = 15
@export_group("Box")
@export_subgroup("Color")
enum ModulateModes {BASE_COLOR_ONLY, ENTRY_COLOR_ON_BOX, GLOBAL_BG_COLOR}
@export var box_modulate_mode: ModulateModes = ModulateModes.ENTRY_COLOR_ON_BOX
@export var box_base_modulate: Color = Color.WHITE
@export_subgroup("Size")
@export var box_width: int = 200
const MISSING_INDEX := -1
func get_pointer() -> Control:
return $Pointer
func get_title() -> Label:
return %Title
func get_text() -> RichTextLabel:
return %Text
func get_extra() -> RichTextLabel:
return %Extra
func get_panel() -> PanelContainer:
return %Panel
func get_panel_point() -> PanelContainer:
return %PanelPoint
func _ready() -> void:
if Engine.is_editor_hint():
return
get_pointer().hide()
var text_system: Node = DialogicUtil.autoload().get(&'Text')
var _error: int = 0
_error = text_system.connect(&'animation_textbox_hide', get_pointer().hide)
_error = text_system.connect(&'meta_hover_started', _on_dialogic_display_dialog_text_meta_hover_started)
_error = text_system.connect(&'meta_hover_ended', _on_dialogic_display_dialog_text_meta_hover_ended)
## Method that shows the bubble and fills in the info
func _on_dialogic_display_dialog_text_meta_hover_started(meta: String) -> void:
var entry_info := DialogicUtil.autoload().Glossary.get_entry(meta)
if entry_info.is_empty():
return
get_pointer().show()
get_title().text = entry_info.title
get_text().text = entry_info.text
get_text().text = ['', '[center]', '[right]'][text_alignment] + get_text().text
get_extra().text = entry_info.extra
get_extra().text = ['', '[center]', '[right]'][extra_alignment] + get_extra().text
get_pointer().global_position = get_pointer().get_global_mouse_position()
if title_color_mode == TextColorModes.ENTRY:
get_title().add_theme_color_override(&"font_color", entry_info.color)
if text_color_mode == TextColorModes.ENTRY:
get_text().add_theme_color_override(&"default_color", entry_info.color)
if extra_color_mode == TextColorModes.ENTRY:
get_extra().add_theme_color_override(&"default_color", entry_info.color)
match box_modulate_mode:
ModulateModes.ENTRY_COLOR_ON_BOX:
get_panel().self_modulate = entry_info.color
get_panel_point().self_modulate = entry_info.color
## Method that keeps the bubble at mouse position when visible
func _process(_delta: float) -> void:
if Engine.is_editor_hint():
return
var pointer: Control = get_pointer()
if pointer.visible:
pointer.global_position = pointer.get_global_mouse_position()
## Method that hides the bubble
func _on_dialogic_display_dialog_text_meta_hover_ended(_meta:String) -> void:
get_pointer().hide()
func _apply_export_overrides() -> void:
# Apply fonts
var font: FontFile
var global_font_setting: String = get_global_setting(&"font", '')
if font_use_global and ResourceLoader.exists(global_font_setting):
font = load(global_font_setting)
elif ResourceLoader.exists(font_custom):
font = load(font_custom)
var title: Label = get_title()
if font:
title.add_theme_font_override(&"font", font)
title.horizontal_alignment = title_alignment as HorizontalAlignment
# Apply font & sizes
title.add_theme_font_size_override(&"font_size", font_title_size)
var labels: Array[RichTextLabel] = [get_text(), get_extra()]
var sizes: PackedInt32Array = [font_text_size, font_extra_size]
for i : int in len(labels):
if font:
labels[i].add_theme_font_override(&'normal_font', font)
labels[i].add_theme_font_size_override(&"normal_font_size", sizes[i])
labels[i].add_theme_font_size_override(&"bold_font_size", sizes[i])
labels[i].add_theme_font_size_override(&"italics_font_size", sizes[i])
labels[i].add_theme_font_size_override(&"bold_italics_font_size", sizes[i])
labels[i].add_theme_font_size_override(&"mono_font_size", sizes[i])
# Apply text colors
# this applies Global or Custom colors, entry colors are applied on hover
var controls: Array[Control] = [get_title(), get_text(), get_extra()]
var settings: Array[StringName] = [&'font_color', &'default_color', &'default_color']
var color_modes: Array[TextColorModes] = [title_color_mode, text_color_mode, extra_color_mode]
var custom_colors: PackedColorArray = [title_custom_color, text_custom_color, extra_custom_color]
for i : int in len(controls):
match color_modes[i]:
TextColorModes.GLOBAL:
controls[i].add_theme_color_override(settings[i], get_global_setting(&'font_color', custom_colors[i]) as Color)
TextColorModes.CUSTOM:
controls[i].add_theme_color_override(settings[i], custom_colors[i])
# Apply box size
var panel: PanelContainer = get_panel()
panel.size.x = box_width
panel.position.x = -box_width/2.0
# Apply box coloring
match box_modulate_mode:
ModulateModes.BASE_COLOR_ONLY:
panel.self_modulate = box_base_modulate
get_panel_point().self_modulate = box_base_modulate
ModulateModes.GLOBAL_BG_COLOR:
panel.self_modulate = get_global_setting(&'bg_color', box_base_modulate)
get_panel_point().self_modulate = get_global_setting(&'bg_color', box_base_modulate)

View File

@@ -0,0 +1 @@
uid://djuf2aqt5402a

View File

@@ -0,0 +1,87 @@
[gd_scene load_steps=3 format=3 uid="uid://dsbwnp5hegnu3"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Glossary/glossary_popup_layer.gd" id="1_3nmfj"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_a3cyk"]
bg_color = Color(0.12549, 0.12549, 0.12549, 1)
border_width_left = 2
border_width_top = 4
border_width_right = 4
border_width_bottom = 2
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
expand_margin_left = 5.0
expand_margin_top = 5.0
expand_margin_right = 5.0
expand_margin_bottom = 5.0
[node name="Glossary" type="Control"]
layout_mode = 3
anchors_preset = 0
mouse_filter = 2
script = ExtResource("1_3nmfj")
[node name="Pointer" type="Control" parent="."]
anchors_preset = 0
[node name="Panel" type="PanelContainer" parent="Pointer"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -81.0
offset_top = -113.0
offset_right = 86.0
offset_bottom = -35.0
grow_horizontal = 2
grow_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxFlat_a3cyk")
metadata/_edit_use_custom_anchors = true
metadata/_edit_layout_mode = 1
[node name="VBox" type="VBoxContainer" parent="Pointer/Panel"]
layout_mode = 2
theme_override_constants/separation = 0
[node name="Title" type="Label" parent="Pointer/Panel/VBox"]
unique_name_in_owner = true
layout_mode = 2
[node name="HSeparator" type="HSeparator" parent="Pointer/Panel/VBox"]
layout_mode = 2
[node name="Text" type="RichTextLabel" parent="Pointer/Panel/VBox"]
unique_name_in_owner = true
layout_mode = 2
bbcode_enabled = true
fit_content = true
[node name="Extra" type="RichTextLabel" parent="Pointer/Panel/VBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/normal_font_size = 15
bbcode_enabled = true
fit_content = true
[node name="Control" type="Control" parent="Pointer/Panel"]
show_behind_parent = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
[node name="PanelPoint" type="PanelContainer" parent="Pointer/Panel/Control"]
unique_name_in_owner = true
layout_mode = 0
offset_left = -0.999999
offset_top = -14.0
offset_right = 19.0
offset_bottom = 6.0
rotation = 0.75799
size_flags_horizontal = 4
size_flags_vertical = 8
theme_override_styles/panel = SubResource("StyleBoxFlat_a3cyk")

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "Popup Glossary"
author = "Dialogic"
description = "A popup that that appears when hovering glossary entries."
scene = "glossary_popup_layer.tscn"
icon = "popup_glossary_layer_icon.svg"

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="100" height="100" viewBox="0 0 26.458333 26.458333" version="1.1" id="svg13076" inkscape:export-filename="text_input_layer_icon.svg" inkscape:export-xdpi="96" inkscape:export-ydpi="96" inkscape:version="1.2.2 (732a01da63, 2022-12-09)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview id="namedview13078" pagecolor="#505050" bordercolor="#eeeeee" borderopacity="1" inkscape:showpageshadow="0" inkscape:pageopacity="0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" inkscape:document-units="mm" showgrid="true" inkscape:zoom="4.185" inkscape:cx="70.728793" inkscape:cy="64.755078" inkscape:window-width="1920" inkscape:window-height="1017" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="layer1">
<inkscape:grid type="xygrid" id="grid14286" />
</sodipodi:namedview>
<defs id="defs13073" />
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 3.9687497,20.505208 v -9.260417 l 9.2604173,2.645834 9.260416,-2.645834 v 9.260417 l -9.260416,2.645833 -9.2604173,-2.645833" id="path35151" sodipodi:nodetypes="ccccccc" />
<path style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 13.229167,13.890625 v 9.260416" id="path35153" sodipodi:nodetypes="cc" />
<rect style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" id="rect35155" width="10.583333" height="3.96875" x="7.9375" y="3.96875" ry="0.050781649" />
<path style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 11.90625,7.9374999 c 1.322917,2.6458331 1.322917,2.6458331 1.322917,2.6458331 l 1.322916,-2.6458331 z" id="path35313" />
<path style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 6.6145829,15.213541 3.9687501,1.322917" id="path35315" />
<path style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 6.6145829,17.859374 3.9687501,1.322917" id="path35317" />
<path style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 15.875,16.536458 3.96875,-1.322917" id="path35319" />
<path style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 15.875,19.182291 3.96875,-1.322916" id="path35321" sodipodi:nodetypes="cc" />
<path style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 15.875,19.182291 3.96875,-1.322916" id="path35323" sodipodi:nodetypes="cc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c3q86ma7r6l57"
path="res://.godot/imported/popup_glossary_layer_icon.svg-4af96bdb70714a5289a4ffe42cf8f357.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Glossary/popup_glossary_layer_icon.svg"
dest_files=["res://.godot/imported/popup_glossary_layer_icon.svg-4af96bdb70714a5289a4ffe42cf8f357.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.3
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dydv1g180rqex"
path="res://.godot/imported/preview.png-573567ffd6162e40c78fe5aca0af73c9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Glossary/preview.png"
dest_files=["res://.godot/imported/preview.png-573567ffd6162e40c78fe5aca0af73c9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,30 @@
extends Container
func get_text_box() -> RichTextLabel:
return %TextBox
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:
name_label.text = character
name_label.add_theme_color_override('font_color', character_color)
name_label.show()
else:
name_label.hide()
var icon_node: TextureRect = get_icon()
if icon == null:
icon_node.hide()
else:
icon_node.show()
icon_node.texture = icon

View File

@@ -0,0 +1 @@
uid://jvv88fqc6b71

View File

@@ -0,0 +1,46 @@
[gd_scene load_steps=3 format=3 uid="uid://cuoywrmvda1yg"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_History/example_history_item.gd" id="1_dgoja"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_upgjp"]
content_margin_left = 5.0
content_margin_top = 5.0
content_margin_right = 5.0
content_margin_bottom = 5.0
bg_color = Color(0.780392, 0.780392, 0.780392, 0.156863)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[node name="HistoryItem" type="PanelContainer"]
offset_left = -37.0
offset_top = 510.0
offset_right = 1085.0
offset_bottom = 555.0
theme_override_styles/panel = SubResource("StyleBoxFlat_upgjp")
script = ExtResource("1_dgoja")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="Icon" type="TextureRect" parent="HBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 30)
layout_mode = 2
expand_mode = 1
stretch_mode = 4
[node name="NameLabel" type="Label" parent="HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
[node name="TextBox" type="RichTextLabel" parent="HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
bbcode_enabled = true
text = "Some tex"
fit_content = true

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
id="svg5" inkscape:export-filename="history-icon.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" sodipodi:docname="history_icon.svg" inkscape:export-ydpi="96" inkscape:export-xdpi="96" inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100px" height="100px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<sodipodi:namedview id="namedview7" inkscape:pagecheckerboard="0" inkscape:cy="23.572542" inkscape:zoom="2.2483786" inkscape:cx="-42.25267" pagecolor="#464646" showgrid="false" borderopacity="0.25" bordercolor="#000000" inkscape:document-units="mm" inkscape:deskcolor="#d1d1d1" inkscape:pageopacity="0" inkscape:showpageshadow="2" inkscape:current-layer="svg5" inkscape:window-y="-8" inkscape:window-x="-8" inkscape:window-height="1017" inkscape:window-width="1920" showguides="true" inkscape:window-maximized="1">
</sodipodi:namedview>
<g>
<path fill="#FFFFFF" d="M50.037,53.276l17.386,5.477c0.4,0.126,0.805,0.186,1.203,0.186c1.7,0,3.276-1.092,3.814-2.799
c0.663-2.107-0.507-4.354-2.613-5.018l-14.968-4.714l-1.078-7.916c-0.299-2.189-2.311-3.721-4.504-3.423
c-2.189,0.298-3.722,2.314-3.423,4.503l1.421,10.429C47.484,51.535,48.56,52.811,50.037,53.276z"/>
<path fill="#FFFFFF" d="M52.908,7.826c-20.465,0-37.303,15.785-39.001,35.818l-2.034,0.034c-1.447,0.024-2.769,0.829-3.455,2.104
c-0.687,1.274-0.63,2.821,0.146,4.042l5.943,9.347c0.735,1.155,2.009,1.854,3.375,1.854c0.021,0,0.042,0,0.063-0.001
c1.391-0.021,2.669-0.765,3.378-1.961l5.65-9.541c0.738-1.247,0.745-2.795,0.017-4.048s-2.067-2.012-3.525-1.99l-1.513,0.025
c1.731-15.55,14.95-27.684,30.956-27.684c17.178,0,31.152,13.975,31.152,31.152c0,17.178-13.975,31.152-31.152,31.152
c-2.438,0-4.866-0.282-7.213-0.838c-0.543-0.129-1.086-0.138-1.604-0.048c-0.385-0.001-0.775,0.035-1.164,0.152l-17.479,5.268
l1.693-10.559c0.35-2.182-1.135-4.233-3.316-4.583c-2.182-0.357-4.233,1.135-4.583,3.315l-2.705,16.865
c-0.218,1.361,0.279,2.738,1.316,3.645c0.739,0.646,1.678,0.989,2.634,0.989c0.386,0,0.774-0.056,1.154-0.17l22.993-6.929
c2.707,0.582,5.484,0.892,8.275,0.892c21.589,0,39.152-17.563,39.152-39.152S74.497,7.826,52.908,7.826z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cvq7qbkngeoud"
path="res://.godot/imported/history_icon.svg-0be9d23e65368ea3983968e4ce0e43d3.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_History/history_icon.svg"
dest_files=["res://.godot/imported/history_icon.svg-0be9d23e65368ea3983968e4ce0e43d3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.3
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

View File

@@ -0,0 +1,151 @@
@tool
extends DialogicLayoutLayer
## Example scene for viewing the History
## Implements most of the visual options from 1.x History mode
@export_group('Look')
@export_subgroup('Font')
@export var font_use_global_size: bool = true
@export var font_custom_size: int = 15
@export var font_use_global_fonts: bool = true
@export_file('*.ttf', '*.tres') var font_custom_normal: String = ""
@export_file('*.ttf', '*.tres') var font_custom_bold: String = ""
@export_file('*.ttf', '*.tres') var font_custom_italics: String = ""
@export_subgroup('Buttons')
@export var show_open_button: bool = true
@export var show_close_button: bool = true
@export_group('Settings')
@export_subgroup('Events')
@export var show_all_choices: bool = true
@export var show_join_and_leave: bool = true
@export_subgroup('Behaviour')
@export var scroll_to_bottom: bool = true
@export var show_name_colors: bool = true
@export var name_delimeter: String = ": "
var scroll_to_bottom_flag: bool = false
@export_group('Private')
@export var HistoryItem: PackedScene = null
var history_item_theme: Theme = null
func get_show_history_button() -> Button:
return $ShowHistory
func get_hide_history_button() -> Button:
return $HideHistory
func get_history_box() -> ScrollContainer:
return %HistoryBox
func get_history_log() -> VBoxContainer:
return %HistoryLog
func _ready() -> void:
if Engine.is_editor_hint():
return
DialogicUtil.autoload().History.open_requested.connect(_on_show_history_pressed)
DialogicUtil.autoload().History.close_requested.connect(_on_hide_history_pressed)
func _apply_export_overrides() -> void:
var history_subsystem: Node = DialogicUtil.autoload().get(&'History')
if history_subsystem != null:
get_show_history_button().visible = show_open_button and history_subsystem.get(&'simple_history_enabled')
else:
set(&'visible', false)
history_item_theme = Theme.new()
if font_use_global_size:
history_item_theme.default_font_size = get_global_setting(&'font_size', font_custom_size)
else:
history_item_theme.default_font_size = font_custom_size
if font_use_global_fonts and ResourceLoader.exists(get_global_setting(&'font', '') as String):
history_item_theme.default_font = load(get_global_setting(&'font', '') as String) as Font
elif ResourceLoader.exists(font_custom_normal):
history_item_theme.default_font = load(font_custom_normal)
if ResourceLoader.exists(font_custom_bold):
history_item_theme.set_font(&'RichtTextLabel', &'bold_font', load(font_custom_bold) as Font)
if ResourceLoader.exists(font_custom_italics):
history_item_theme.set_font(&'RichtTextLabel', &'italics_font', load(font_custom_italics) as Font)
func _process(_delta : float) -> void:
if Engine.is_editor_hint():
return
if scroll_to_bottom_flag and get_history_box().visible and get_history_log().get_child_count():
await get_tree().process_frame
get_history_box().ensure_control_visible(get_history_log().get_children()[-1] as Control)
scroll_to_bottom_flag = false
func _on_show_history_pressed() -> void:
DialogicUtil.autoload().paused = true
show_history()
func show_history() -> void:
for child: Node in get_history_log().get_children():
child.queue_free()
var history_subsystem: Node = DialogicUtil.autoload().get(&'History')
for info: Dictionary in history_subsystem.call(&'get_simple_history'):
var history_item : Node = HistoryItem.instantiate()
history_item.set(&'theme', history_item_theme)
match info.event_type:
"Text":
if info.has('character') and info['character']:
if show_name_colors:
history_item.call(&'load_info', info['text'], info['character']+name_delimeter, info['character_color'])
else:
history_item.call(&'load_info', info['text'], info['character']+name_delimeter)
else:
history_item.call(&'load_info', info['text'])
"Character":
if !show_join_and_leave:
history_item.queue_free()
continue
history_item.call(&'load_info', '[i]'+info['text'])
"Choice":
var choices_text: String = ""
if show_all_choices:
for i : String in info['all_choices']:
if i.ends_with('#disabled'):
choices_text += "- [i]("+i.trim_suffix('#disabled')+")[/i]\n"
elif i == info['text']:
choices_text += "-> [b]"+i+"[/b]\n"
else:
choices_text += "-> "+i+"\n"
else:
choices_text += "- [b]"+info['text']+"[/b]\n"
history_item.call(&'load_info', choices_text)
get_history_log().add_child(history_item)
if scroll_to_bottom:
scroll_to_bottom_flag = true
get_show_history_button().hide()
get_hide_history_button().visible = show_close_button
get_history_box().show()
func _on_hide_history_pressed() -> void:
DialogicUtil.autoload().paused = false
get_history_box().hide()
get_hide_history_button().hide()
var history_subsystem: Node = DialogicUtil.autoload().get(&'History')
get_show_history_button().visible = show_open_button and history_subsystem.get(&'simple_history_enabled')

View File

@@ -0,0 +1 @@
uid://bjd2agyoi2oi1

View File

@@ -0,0 +1,93 @@
[gd_scene load_steps=4 format=3 uid="uid://lx24i8fl6uo"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_History/history_layer.gd" id="1_4mqm3"]
[ext_resource type="PackedScene" uid="uid://cuoywrmvda1yg" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_History/example_history_item.tscn" id="2_x1xgk"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1hdvb"]
content_margin_left = 10.0
content_margin_top = 10.0
content_margin_right = 10.0
content_margin_bottom = 10.0
bg_color = Color(0, 0, 0, 0.776471)
border_color = Color(0.8, 0.8, 0.8, 0)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[node name="ExampleHistoryScene" type="Control"]
layout_direction = 1
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 2
script = ExtResource("1_4mqm3")
font_use_global_size = null
font_custom_size = null
font_use_global_fonts = null
font_custom_normal = null
font_custom_bold = null
font_custom_italics = null
HistoryItem = ExtResource("2_x1xgk")
disabled = null
[node name="HistoryBox" type="ScrollContainer" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 74.0
offset_top = 65.0
offset_right = -74.0
offset_bottom = -57.0
grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_1hdvb")
horizontal_scroll_mode = 0
[node name="HistoryLog" type="VBoxContainer" parent="HistoryBox"]
unique_name_in_owner = true
layout_direction = 1
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ShowHistory" type="Button" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -73.0
offset_top = 7.0
offset_right = -9.0
offset_bottom = 38.0
grow_horizontal = 0
size_flags_horizontal = 4
size_flags_vertical = 4
text = "History"
[node name="HideHistory" type="Button" parent="."]
visible = false
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -123.0
offset_top = 58.0
offset_right = -62.0
offset_bottom = 89.0
grow_horizontal = 0
size_flags_horizontal = 4
size_flags_vertical = 4
text = "Return"
[connection signal="pressed" from="ShowHistory" to="." method="_on_show_history_pressed"]
[connection signal="pressed" from="HideHistory" to="." method="_on_hide_history_pressed"]

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "Overlay History"
author = "Dialogic"
description = "Provides a history button and overlay."
scene = "history_layer.tscn"
icon = "history_icon.svg"

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b7ep7q40d2amu"
path="res://.godot/imported/preview.png-b328f7e30aebed2adb4720cdbf791362.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_History/preview.png"
dest_files=["res://.godot/imported/preview.png-b328f7e30aebed2adb4720cdbf791362.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,4 @@
@tool
extends DialogicLayoutLayer
## A layer that holds a full-screen input catcher.

View File

@@ -0,0 +1 @@
uid://ey53dtdeqmtf

View File

@@ -0,0 +1,24 @@
[gd_scene load_steps=3 format=3 uid="uid://cn674foxwedqu"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Input/full_advance_input_layer.gd" id="1_3cmha"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_input.gd" id="2_dxpjw"]
[node name="FullAdvanceInputLayer" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_3cmha")
[node name="DialogicNode_Input" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1
script = ExtResource("2_dxpjw")

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="100" height="100" viewBox="0 0 26.458333 26.458333" version="1.1" id="svg13076" inkscape:export-filename="portrait_layer.svg" inkscape:export-xdpi="96" inkscape:export-ydpi="96" inkscape:version="1.2.2 (732a01da63, 2022-12-09)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview id="namedview13078" pagecolor="#505050" bordercolor="#eeeeee" borderopacity="1" inkscape:showpageshadow="0" inkscape:pageopacity="0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" inkscape:document-units="mm" showgrid="true" inkscape:zoom="4.185" inkscape:cx="70.728793" inkscape:cy="64.755078" inkscape:window-width="1920" inkscape:window-height="1017" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="layer1">
<inkscape:grid type="xygrid" id="grid14286" />
</sodipodi:namedview>
<defs id="defs13073" />
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1">
<path id="rect32348" style="fill:#ffffff;fill-opacity:0.75;stroke:none;stroke-width:0.724233;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" d="m 6.234761,11.189706 v 5.629112 c 0,3.874621 3.1197871,6.993682 6.994406,6.993682 3.87462,0 6.993682,-3.119061 6.993682,-6.993682 v -5.629112 z" />
<path id="path35376" style="fill:#ffffff;fill-opacity:0.75;stroke:none;stroke-width:0.724233;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" d="M 13.806123,2.8560687 V 5.619952 c 0.38293,0.2052666 0.642107,0.6084819 0.642107,1.0750043 v 1.2197859 c 0,0.4665295 -0.259168,0.8697412 -0.642107,1.0750052 v 1.0445996 h 6.416726 V 9.8244141 c 0,-3.6799558 -2.814523,-6.6763287 -6.416726,-6.9683454 z" />
<path id="path35374" style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.724233;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" d="M 12.652213,2.8560687 C 9.0496644,3.1477449 6.234761,6.144214 6.234761,9.8244141 v 0.2099329 h 6.417452 V 8.9904712 C 12.268805,8.785348 12.009381,8.3816175 12.009381,7.9147422 V 6.6949563 c 0,-0.4668682 0.259433,-0.8706032 0.642832,-1.0757281 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bv38272320783"
path="res://.godot/imported/input_layer_icon.svg-3f439e08e8c66cbf3522ce60714f7588.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Input/input_layer_icon.svg"
dest_files=["res://.godot/imported/input_layer_icon.svg-3f439e08e8c66cbf3522ce60714f7588.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.3
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "Input Catcher"
author = "Dialogic"
description = "A full screen mouse input catcher for advancing dialog."
scene = "full_advance_input_layer.tscn"
icon = "input_layer_icon.svg"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b6wifoui7fdf1"
path="res://.godot/imported/preview.png-c20c74f5253522c0ea9ec9a21fcd804d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Input/preview.png"
dest_files=["res://.godot/imported/preview.png-c20c74f5253522c0ea9ec9a21fcd804d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,13 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://cmpf1qxjh5tuw"]
[resource]
content_margin_left = 10.0
content_margin_top = 10.0
content_margin_right = 10.0
content_margin_bottom = 10.0
bg_color = Color(1, 1, 1, 1)
skew = Vector2(0.073, 0)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "Textbox with Portrait "
author = "Dialogic"
description = "A layer with a textbox that also contains a speaker portrait."
scene = "textbox_with_speaker_portrait.tscn"
icon = "speaker-textbox-icon.svg"

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://s5s4lmhfnav2"
path="res://.godot/imported/preview.png-dcc8befd9aebdd8b4c988971a734c72f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/preview.png"
dest_files=["res://.godot/imported/preview.png-dcc8befd9aebdd8b4c988971a734c72f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
id="svg13076" inkscape:export-filename="bitmap.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" sodipodi:docname="textbox_layer_icon.svg" inkscape:export-ydpi="96" inkscape:export-xdpi="96"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100px" height="100px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<g>
<circle id="path6939_1_" fill="#FFFFFF" cx="30.504" cy="50.494" r="10.29"/>
<path id="path6995_1_" fill="#FFFFFF" d="M39.762,75.19h-19.55l4.117-17.494h11.318L39.762,75.19z"/>
</g>
<path fill="#FFFFFF" d="M87,20H13c-4.418,0-8,3.582-8,8v47.875c0,4.418,3.582,8,8,8h74c4.418,0,8-3.582,8-8V28
C95,23.582,91.418,20,87,20z M58.585,36.733h12.364c1.888,0,3.42,1.531,3.42,3.419c0,1.888-1.532,3.419-3.42,3.419H58.585
c-1.888,0-3.419-1.531-3.419-3.419C55.166,38.264,56.697,36.733,58.585,36.733z M47.546,69.842c0,2.721-2.207,4.928-4.927,4.928
h-24.23c-2.72,0-4.927-2.207-4.927-4.928v-35.77c0-2.72,2.207-4.927,4.927-4.927h24.23c2.721,0,4.927,2.208,4.927,4.927V69.842z
M85.08,67.142H58.585c-1.889,0-3.419-1.531-3.419-3.42s1.53-3.42,3.419-3.42H85.08c1.887,0,3.419,1.531,3.419,3.42
S86.967,67.142,85.08,67.142z M85.08,55.355H58.585c-1.888,0-3.419-1.529-3.419-3.418s1.531-3.419,3.419-3.419H85.08
c1.888,0,3.419,1.53,3.419,3.419S86.968,55.355,85.08,55.355z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c0v3akss47tgy"
path="res://.godot/imported/speaker-textbox-icon.svg-e67964032c31cfdc4bf5a376d48a985e.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/speaker-textbox-icon.svg"
dest_files=["res://.godot/imported/speaker-textbox-icon.svg-e67964032c31cfdc4bf5a376d48a985e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

View File

@@ -0,0 +1,129 @@
@tool
extends DialogicLayoutLayer
enum Alignments {LEFT, CENTER, RIGHT}
enum LimitedAlignments {LEFT=0, RIGHT=1}
@export_group('Text')
@export_subgroup("Text")
@export var text_alignment: Alignments = Alignments.LEFT
@export_subgroup('Size')
@export var text_use_global_size: bool = true
@export var text_custom_size: int = 15
@export_subgroup('Color')
@export var text_use_global_color: bool = true
@export var text_custom_color: Color = Color.WHITE
@export_subgroup('Fonts')
@export var use_global_fonts: bool = true
@export_file('*.ttf', '*.tres') var custom_normal_font: String = ""
@export_file('*.ttf', '*.tres') var custom_bold_font: String = ""
@export_file('*.ttf', '*.tres') var custom_italic_font: String = ""
@export_file('*.ttf', '*.tres') var custom_bold_italic_font: String = ""
@export_group('Name Label')
@export_subgroup("Color")
enum NameLabelColorModes {GLOBAL_COLOR, CHARACTER_COLOR, CUSTOM_COLOR}
@export var name_label_color_mode: NameLabelColorModes = NameLabelColorModes.GLOBAL_COLOR
@export var name_label_custom_color: Color = Color.WHITE
@export_subgroup("Behaviour")
@export var name_label_alignment: Alignments = Alignments.LEFT
@export var name_label_hide_when_no_character: bool = false
@export_subgroup("Font & Size")
@export var name_label_use_global_size: bool = true
@export var name_label_custom_size: int = 15
@export var name_label_use_global_font: bool = true
@export_file('*.ttf', '*.tres') var name_label_customfont: String = ""
@export_group('Box')
@export_subgroup("Box")
@export_file('*.tres') var box_panel: String = this_folder.path_join("default_stylebox.tres")
@export var box_modulate_global_color: bool = true
@export var box_modulate_custom_color: Color = Color(0.47247135639191, 0.31728461384773, 0.16592600941658)
@export var box_size: Vector2 = Vector2(600, 160)
@export var box_distance: int = 25
@export_group('Portrait')
@export_subgroup('Portrait')
@export var portrait_stretch_factor: float = 0.3
@export var portrait_position: LimitedAlignments = LimitedAlignments.LEFT
@export var portrait_bg_modulate: Color = Color(0, 0, 0, 0.5137255191803)
## Called by dialogic whenever export overrides might change
func _apply_export_overrides() -> void:
## FONT SETTINGS
var dialog_text: DialogicNode_DialogText = %DialogicNode_DialogText
dialog_text.alignment = text_alignment as DialogicNode_DialogText.Alignment
var text_size: int = text_custom_size
if text_use_global_size:
text_size = get_global_setting(&'font_size', text_custom_size)
dialog_text.add_theme_font_size_override(&"normal_font_size", text_size)
dialog_text.add_theme_font_size_override(&"bold_font_size", text_size)
dialog_text.add_theme_font_size_override(&"italics_font_size", text_size)
dialog_text.add_theme_font_size_override(&"bold_italics_font_size", text_size)
var text_color: Color = text_custom_color
if text_use_global_color:
text_color = get_global_setting(&'font_color', text_custom_color)
dialog_text.add_theme_color_override(&"default_color", text_color)
var normal_font: String = custom_normal_font
if use_global_fonts and ResourceLoader.exists(get_global_setting(&'font', '') as String):
normal_font = get_global_setting(&'font', '')
if !normal_font.is_empty():
dialog_text.add_theme_font_override(&"normal_font", load(normal_font) as Font)
if !custom_bold_font.is_empty():
dialog_text.add_theme_font_override(&"bold_font", load(custom_bold_font) as Font)
if !custom_italic_font.is_empty():
dialog_text.add_theme_font_override(&"italics_font", load(custom_italic_font) as Font)
if !custom_bold_italic_font.is_empty():
dialog_text.add_theme_font_override(&"bold_italics_font", load(custom_bold_italic_font) as Font)
## BOX SETTINGS
var panel: PanelContainer = %Panel
var portrait_panel: Panel = %PortraitPanel
if box_modulate_global_color:
panel.self_modulate = get_global_setting(&'bg_color', box_modulate_custom_color)
else:
panel.self_modulate = box_modulate_custom_color
panel.size = box_size
panel.position = Vector2(-box_size.x/2, -box_size.y-box_distance)
portrait_panel.size_flags_stretch_ratio = portrait_stretch_factor
var stylebox: StyleBox = load(box_panel)
panel.add_theme_stylebox_override(&'panel', stylebox)
## PORTRAIT SETTINGS
var portrait_background_color: ColorRect = %PortraitBackgroundColor
portrait_background_color.color = portrait_bg_modulate
portrait_panel.get_parent().move_child(portrait_panel, portrait_position)
## NAME LABEL SETTINGS
var name_label: DialogicNode_NameLabel = %DialogicNode_NameLabel
if name_label_use_global_size:
name_label.add_theme_font_size_override(&"font_size", get_global_setting(&'font_size', name_label_custom_size) as int)
else:
name_label.add_theme_font_size_override(&"font_size", name_label_custom_size)
var name_label_font: String = name_label_customfont
if name_label_use_global_font and ResourceLoader.exists(get_global_setting(&'font', '') as String):
name_label_font = get_global_setting(&'font', '')
if !name_label_font.is_empty():
name_label.add_theme_font_override(&'font', load(name_label_font) as Font)
name_label.use_character_color = false
match name_label_color_mode:
NameLabelColorModes.GLOBAL_COLOR:
name_label.add_theme_color_override(&"font_color", get_global_setting(&'font_color', name_label_custom_color) as Color)
NameLabelColorModes.CUSTOM_COLOR:
name_label.add_theme_color_override(&"font_color", name_label_custom_color)
NameLabelColorModes.CHARACTER_COLOR:
name_label.use_character_color = true
name_label.horizontal_alignment = name_label_alignment as HorizontalAlignment
name_label.hide_when_empty = name_label_hide_when_no_character

View File

@@ -0,0 +1,124 @@
[gd_scene load_steps=7 format=3 uid="uid://by6waso0mjpjp"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Character/node_portrait_container.gd" id="1_4jxq7"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/speaker_portrait_textbox_layer.gd" id="1_7jt4d"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_name_label.gd" id="2_y0h34"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_dialog_text.gd" id="3_11puy"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_type_sound.gd" id="5_sr2qw"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dmg1w"]
bg_color = Color(0.254902, 0.254902, 0.254902, 1)
skew = Vector2(0.073, 0)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
[node name="TextboxWithSpeakerPortrait" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_7jt4d")
box_panel = "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/default_stylebox.tres"
[node name="Anchor" type="Control" parent="."]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 0
mouse_filter = 2
[node name="Panel" type="PanelContainer" parent="Anchor"]
unique_name_in_owner = true
self_modulate = Color(0.533333, 0.376471, 0.176471, 1)
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -250.0
offset_top = -200.0
offset_right = 250.0
offset_bottom = -50.0
grow_horizontal = 2
grow_vertical = 0
mouse_filter = 2
[node name="HBox" type="HBoxContainer" parent="Anchor/Panel"]
layout_mode = 2
mouse_filter = 2
theme_override_constants/separation = 15
[node name="PortraitPanel" type="Panel" parent="Anchor/Panel/HBox"]
unique_name_in_owner = true
clip_children = 1
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.3
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_dmg1w")
[node name="PortraitBackgroundColor" type="ColorRect" parent="Anchor/Panel/HBox/PortraitPanel"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -7.0
offset_top = -3.0
offset_right = 7.0
offset_bottom = 3.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 0.231373)
[node name="DialogicNode_PortraitContainer" type="Control" parent="Anchor/Panel/HBox/PortraitPanel/PortraitBackgroundColor"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 4.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_4jxq7")
mode = 1
container_ids = PackedStringArray("1")
debug_character_portrait = "speaker"
[node name="VBoxContainer" type="VBoxContainer" parent="Anchor/Panel/HBox"]
layout_mode = 2
size_flags_horizontal = 3
mouse_filter = 2
[node name="DialogicNode_NameLabel" type="Label" parent="Anchor/Panel/HBox/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 8
text = "Name"
script = ExtResource("2_y0h34")
[node name="DialogicNode_DialogText" type="RichTextLabel" parent="Anchor/Panel/HBox/VBoxContainer" node_paths=PackedStringArray("textbox_root")]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
theme_override_font_sizes/normal_font_size = 6
bbcode_enabled = true
text = "Some text"
scroll_following = true
visible_characters_behavior = 1
script = ExtResource("3_11puy")
textbox_root = NodePath("../../..")
[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="Anchor/Panel/HBox/VBoxContainer/DialogicNode_DialogText"]
script = ExtResource("5_sr2qw")

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "Simple Text Input Box"
author = "Dialogic"
description = "A layer with a simple text input box."
scene = "text_input_layer.tscn"
icon = "text_input_layer_icon.svg"

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bn2b53n51smoo"
path="res://.godot/imported/preview.png-bcceb5d2b7f92c1d0f818071294dc895.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_TextInput/preview.png"
dest_files=["res://.godot/imported/preview.png-bcceb5d2b7f92c1d0f818071294dc895.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,14 @@
@tool
extends DialogicLayoutLayer
## A layer that contains a text-input node.
func _apply_export_overrides() -> void:
var layer_theme: Theme = get(&'theme')
if layer_theme == null:
layer_theme = Theme.new()
if get_global_setting(&'font', ''):
layer_theme.default_font = load(get_global_setting(&'font', '') as String)
layer_theme.default_font_size = get_global_setting(&'font_size', 0)

View File

@@ -0,0 +1 @@
uid://bvma3rxhy6q35

View File

@@ -0,0 +1,76 @@
[gd_scene load_steps=5 format=3 uid="uid://cvgf4c6gg0tsy"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_TextInput/text_input_layer.gd" id="1_7ahrn"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/TextInput/node_text_input.gd" id="1_mxdep"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3dpjm"]
content_margin_left = 15.0
content_margin_top = 15.0
content_margin_right = 15.0
content_margin_bottom = 15.0
bg_color = Color(1, 1, 1, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[sub_resource type="Theme" id="Theme_8xwp1"]
[node name="TextInputLayer" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_7ahrn")
[node name="DialogicNode_TextInput" type="Control" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -210.0
offset_top = -50.0
offset_right = 210.0
offset_bottom = 50.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_mxdep")
input_line_edit = NodePath("TextInputPanel/VBoxContainer/InputField")
text_label = NodePath("TextInputPanel/VBoxContainer/TextLabel")
confirmation_button = NodePath("TextInputPanel/VBoxContainer/ConfirmationButton")
metadata/_edit_layout_mode = 1
[node name="TextInputPanel" type="PanelContainer" parent="DialogicNode_TextInput"]
unique_name_in_owner = true
self_modulate = Color(0, 0, 0, 0.780392)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_3dpjm")
[node name="VBoxContainer" type="VBoxContainer" parent="DialogicNode_TextInput/TextInputPanel"]
layout_mode = 2
[node name="TextLabel" type="Label" parent="DialogicNode_TextInput/TextInputPanel/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme = SubResource("Theme_8xwp1")
text = "Please enter some text:"
autowrap_mode = 3
[node name="InputField" type="LineEdit" parent="DialogicNode_TextInput/TextInputPanel/VBoxContainer"]
layout_mode = 2
[node name="ConfirmationButton" type="Button" parent="DialogicNode_TextInput/TextInputPanel/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Confirm"

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
id="svg13076" inkscape:export-filename="input_layer_icon.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" inkscape:export-ydpi="96" inkscape:export-xdpi="96" inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100px" height="100px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<sodipodi:namedview id="namedview13078" inkscape:pagecheckerboard="0" inkscape:cy="64.755078" inkscape:zoom="4.185" inkscape:cx="70.728793" pagecolor="#505050" showgrid="true" borderopacity="1" bordercolor="#eeeeee" inkscape:document-units="mm" inkscape:deskcolor="#505050" inkscape:pageopacity="0" inkscape:showpageshadow="0" inkscape:current-layer="layer1" inkscape:window-y="-8" inkscape:window-x="-8" inkscape:window-height="1017" inkscape:window-width="1920" inkscape:window-maximized="1">
<inkscape:grid id="grid14286" type="xygrid"></inkscape:grid>
</sodipodi:namedview>
<g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer">
<g id="path30124">
<polygon fill="#FFFFFF" points="40.03,68.723 24.778,68.723 24.778,60.723 28.403,60.723 28.403,39.191 24.778,39.191
24.778,31.191 40.03,31.191 40.03,39.191 36.403,39.191 36.403,60.723 40.03,60.723 "/>
</g>
<g id="rect30126">
<path fill="#FFFFFF" d="M81.973,83.529H17.151c-6.41,0-11.625-5.216-11.625-11.626V28.097c0-6.411,5.215-11.626,11.625-11.626
h64.821c6.411,0,11.627,5.215,11.627,11.626v43.807C93.6,78.313,88.384,83.529,81.973,83.529z M17.151,24.471
c-1.999,0-3.625,1.626-3.625,3.626v43.807c0,1.999,1.626,3.626,3.625,3.626h64.821c2,0,3.627-1.627,3.627-3.626V28.097
c0-2-1.627-3.626-3.627-3.626H17.151z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d1irtbrawo1jp"
path="res://.godot/imported/text_input_layer_icon.svg-5a1e8bca317bf45f6805d82812407215.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_TextInput/text_input_layer_icon.svg"
dest_files=["res://.godot/imported/text_input_layer_icon.svg-5a1e8bca317bf45f6805d82812407215.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.3
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "Textbubble Layer"
author = "Dialogic"
description = "A simple textbubble layer. Expects a textbubble base. Each textbubble provides a name label, dialog text and choices."
scene = "text_bubble_layer.tscn"
icon = "text_bubble_layer_icon.svg"

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://x0kxo1qd4jqf"
path="res://.godot/imported/preview.png-136e526350ab989f1e1d2ba13d756aaa.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Textbubble/preview.png"
dest_files=["res://.godot/imported/preview.png-136e526350ab989f1e1d2ba13d756aaa.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,17 @@
shader_type canvas_item;
uniform sampler2D deformation_sampler : filter_linear, repeat_enable;
uniform float radius :hint_range(1.0, 200, 0.01)= 25;
uniform vec2 box_size = vec2(100, 100);
uniform float box_padding = 15;
uniform float wobble_amount : hint_range(0.0, 1.0, 0.01) = 0.2;
uniform float wobble_speed : hint_range(0.0, 10.0, 0.01) = 1;
uniform float wobble_detail : hint_range(0.01, 1, 0.01) = 0.5;
void fragment() {
float adjusted_radius = min(min(radius, box_size.x/2.0), box_size.y/2.0);
vec2 deformation_sample = texture(deformation_sampler, UV*wobble_detail+TIME*wobble_speed*0.05).xy*(vec2(box_padding)/box_size)*0.9;
vec2 deformed_UV = UV+((deformation_sample)-vec2(0.5)*vec2(box_padding)/box_size)*wobble_amount;
float rounded_box = length(max(abs(deformed_UV*(box_size+vec2(box_padding))-vec2(0.5)*(box_size+vec2(box_padding)))+adjusted_radius-vec2(0.5)*box_size,0))-adjusted_radius;
COLOR.a = min(smoothstep(0.0, -1, rounded_box), COLOR.a);
}

View File

@@ -0,0 +1 @@
uid://fevg6633ljkf

View File

@@ -0,0 +1,202 @@
extends Control
@onready var tail: Line2D = ($Group/Tail as Line2D)
@onready var bubble: Control = ($Group/Background as Control)
@onready var text: DialogicNode_DialogText = (%DialogText as DialogicNode_DialogText)
# The choice container is added by the TextBubble layer
@onready var choice_container: Container = null
@onready var name_label: Label = (%NameLabel as Label)
@onready var name_label_box: PanelContainer = (%NameLabelPanel as PanelContainer)
@onready var name_label_holder: HBoxContainer = $DialogText/NameLabelPositioner
var node_to_point_at: Node = null
var current_character: DialogicCharacter = null
var max_width := 300
var bubble_rect: Rect2 = Rect2(0.0, 0.0, 2.0, 2.0)
var base_position := Vector2.ZERO
var base_direction := Vector2(1.0, -1.0).normalized()
var safe_zone := 50.0
var padding := Vector2()
var name_label_alignment := HBoxContainer.ALIGNMENT_BEGIN
var name_label_offset := Vector2()
var force_choices_on_separate_lines := false
# Sets the padding shader paramter.
# It's the amount of spacing around the background to allow some wobbeling.
var bg_padding := 30
func _ready() -> void:
reset()
DialogicUtil.autoload().Choices.question_shown.connect(_on_question_shown)
func reset() -> void:
scale = Vector2.ZERO
modulate.a = 0.0
tail.points = []
bubble_rect = Rect2(0,0,2,2)
base_position = get_speaker_canvas_position()
position = base_position
func _process(delta:float) -> void:
base_position = get_speaker_canvas_position()
var center := get_viewport_rect().size / 2.0
var dist_x := absf(base_position.x - center.x)
var dist_y := absf(base_position.y - center.y)
var x_e := center.x - bubble_rect.size.x
var y_e := center.y - bubble_rect.size.y
var influence_x := remap(clamp(dist_x, x_e, center.x), x_e, center.x * 0.8, 0.0, 1.0)
var influence_y := remap(clamp(dist_y, y_e, center.y), y_e, center.y * 0.8, 0.0, 1.0)
if base_position.x > center.x: influence_x = -influence_x
if base_position.y > center.y: influence_y = -influence_y
var edge_influence := Vector2(influence_x, influence_y)
var direction := (base_direction + edge_influence).normalized()
var p: Vector2 = base_position + direction * (
safe_zone + lerp(bubble_rect.size.y, bubble_rect.size.x, abs(direction.x)) * 0.4
)
p = p.clamp(bubble_rect.size / 2.0, get_viewport_rect().size - bubble_rect.size / 2.0)
position = position.lerp(p, 5 * delta)
var point_a: Vector2 = Vector2.ZERO
var point_b: Vector2 = (base_position - position) * 0.75
var offset: Vector2 = Vector2.from_angle(point_a.angle_to_point(point_b)) * bubble_rect.size * abs(direction.x) * 0.4
point_a += offset
point_b += offset * 0.5
var curve := Curve2D.new()
var direction_point := Vector2(0, (point_b.y - point_a.y))
curve.add_point(point_a, Vector2.ZERO, direction_point * 0.5)
curve.add_point(point_b)
tail.points = curve.tessellate(5)
tail.width = bubble_rect.size.x * 0.15
func open() -> void:
set_process(true)
show()
text.enabled = true
var open_tween := create_tween().set_parallel(true)
open_tween.tween_property(self, "scale", Vector2.ONE, 0.1).from(Vector2.ZERO)
open_tween.tween_property(self, "modulate:a", 1.0, 0.1).from(0.0)
func close() -> void:
text.enabled = false
var close_tween := create_tween().set_parallel(true)
close_tween.tween_property(self, "scale", Vector2.ONE * 0.8, 0.2)
close_tween.tween_property(self, "modulate:a", 0.0, 0.2)
await close_tween.finished
hide()
set_process(false)
func _on_dialog_text_started_revealing_text() -> void:
_resize_bubble(get_base_content_size(), true)
func _resize_bubble(content_size:Vector2, popup:=false) -> void:
var bubble_size: Vector2 = content_size+(padding*2)+Vector2.ONE*bg_padding
var half_size: Vector2= (bubble_size / 2.0)
bubble.pivot_offset = half_size
bubble_rect = Rect2(position, bubble_size * Vector2(1.1, 1.1))
bubble.position = -half_size
bubble.size = bubble_size
text.size = content_size
text.position = -(content_size/2.0)
if popup:
var t := create_tween().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK)
t.tween_property(bubble, "scale", Vector2.ONE, 0.2).from(Vector2.ZERO)
else:
bubble.scale = Vector2.ONE
bubble.material.set(&"shader_parameter/box_size", bubble_size)
name_label_holder.position = Vector2(0, bubble.position.y - text.position.y - name_label_holder.size.y/2.0)
name_label_holder.position += name_label_offset
name_label_holder.alignment = name_label_alignment
name_label_holder.size.x = text.size.x
func _on_question_shown(info:Dictionary) -> void:
if !is_visible_in_tree():
return
await get_tree().process_frame
var content_size := get_base_content_size()
content_size.y += choice_container.size.y
content_size.x = max(content_size.x, choice_container.size.x)
_resize_bubble(content_size)
func get_base_content_size() -> Vector2:
var font: Font = text.get_theme_font(&"normal_font")
return font.get_multiline_string_size(
text.get_parsed_text(),
HORIZONTAL_ALIGNMENT_LEFT,
max_width,
text.get_theme_font_size(&"normal_font_size")
)
func add_choice_container(node:Container, alignment:=FlowContainer.ALIGNMENT_BEGIN) -> void:
if choice_container:
choice_container.get_parent().remove_child(choice_container)
choice_container.queue_free()
node.name = "ChoiceContainer"
choice_container = node
node.set_anchors_preset(LayoutPreset.PRESET_BOTTOM_WIDE)
node.grow_vertical = Control.GROW_DIRECTION_BEGIN
text.add_child(node)
if node is HFlowContainer:
(node as HFlowContainer).alignment = alignment
for i:int in range(5):
choice_container.add_child(DialogicNode_ChoiceButton.new())
if node is HFlowContainer:
continue
match alignment:
HBoxContainer.ALIGNMENT_BEGIN:
(choice_container.get_child(-1) as Control).size_flags_horizontal = SIZE_SHRINK_BEGIN
HBoxContainer.ALIGNMENT_CENTER:
(choice_container.get_child(-1) as Control).size_flags_horizontal = SIZE_SHRINK_CENTER
HBoxContainer.ALIGNMENT_END:
(choice_container.get_child(-1) as Control).size_flags_horizontal = SIZE_SHRINK_END
for child:Button in choice_container.get_children():
var prev := child.get_parent().get_child(wrap(child.get_index()-1, 0, choice_container.get_child_count()-1)).get_path()
var next := child.get_parent().get_child(wrap(child.get_index()+1, 0, choice_container.get_child_count()-1)).get_path()
child.focus_next = next
child.focus_previous = prev
child.focus_neighbor_left = prev
child.focus_neighbor_top = prev
child.focus_neighbor_right = next
child.focus_neighbor_bottom = next
func get_speaker_canvas_position() -> Vector2:
if is_instance_valid(node_to_point_at):
if node_to_point_at is Node3D:
base_position = get_viewport().get_camera_3d().unproject_position(
(node_to_point_at as Node3D).global_position)
if node_to_point_at is CanvasItem:
base_position = (node_to_point_at as CanvasItem).get_global_transform_with_canvas().origin
return base_position

View File

@@ -0,0 +1 @@
uid://dxmbq8y6byxip

View File

@@ -0,0 +1,17 @@
shader_type canvas_item;
uniform sampler2D deformation_sampler : filter_linear, repeat_enable;
uniform float radius : hint_range(1.0, 200, 0.01) = 25;
uniform vec2 box_size = vec2(100, 100);
uniform float box_padding = 15;
uniform float wobble_amount : hint_range(0.0, 1.0, 0.01) = 0.2;
uniform float wobble_speed : hint_range(0.0, 10.0, 0.01) = 1;
uniform float wobble_detail : hint_range(0.01, 1, 0.01) = 0.5;
void fragment() {
float adjusted_radius = min(min(radius, box_size.x/2.0), box_size.y/2.0);
vec2 deformation_sample = texture(deformation_sampler, UV*wobble_detail+TIME*wobble_speed*0.05).xy*(vec2(box_padding)/box_size)*0.9;
vec2 deformed_UV = UV+((deformation_sample)-vec2(0.5)*vec2(box_padding)/box_size)*wobble_amount;
float rounded_box = length(max(abs(deformed_UV*(box_size+vec2(box_padding))-vec2(0.5)*(box_size+vec2(box_padding)))+adjusted_radius-vec2(0.5)*box_size,0))-adjusted_radius;
COLOR.a = min(smoothstep(0.0, -1, rounded_box), COLOR.a);
}

View File

@@ -0,0 +1 @@
uid://dl6kcmkb7sjil

View File

@@ -0,0 +1,111 @@
[gd_scene load_steps=11 format=3 uid="uid://dlx7jcvm52tyw"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Textbubble/text_bubble.gd" id="1_jdhpk"]
[ext_resource type="Shader" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Textbubble/text_bubble.gdshader" id="2_1mhvf"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_dialog_text.gd" id="3_syv35"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_type_sound.gd" id="4_7bm4b"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_name_label.gd" id="6_5gd03"]
[sub_resource type="Curve" id="Curve_0j8nu"]
_data = [Vector2(0, 1), 0.0, -1.0, 0, 1, Vector2(1, 0), -1.0, 0.0, 1, 0]
point_count = 2
[sub_resource type="FastNoiseLite" id="FastNoiseLite_lsfnp"]
noise_type = 0
fractal_type = 0
cellular_jitter = 0.15
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_kr7hw"]
seamless = true
noise = SubResource("FastNoiseLite_lsfnp")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_60xbe"]
resource_local_to_scene = true
shader = ExtResource("2_1mhvf")
shader_parameter/radius = 200.0
shader_parameter/box_size = Vector2(100, 100)
shader_parameter/box_padding = 10.0
shader_parameter/wobble_amount = 0.75
shader_parameter/wobble_speed = 10.0
shader_parameter/wobble_detail = 0.51
shader_parameter/deformation_sampler = SubResource("NoiseTexture2D_kr7hw")
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_h6ls0"]
content_margin_left = 5.0
content_margin_right = 5.0
bg_color = Color(1, 1, 1, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
shadow_color = Color(0.152941, 0.152941, 0.152941, 0.12549)
shadow_size = 5
[node name="TextBubble" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_jdhpk")
[node name="Group" type="CanvasGroup" parent="."]
[node name="Tail" type="Line2D" parent="Group"]
unique_name_in_owner = true
points = PackedVector2Array(-9, 7, -29, 118, -95, 174, -193, 195)
width = 96.0
width_curve = SubResource("Curve_0j8nu")
[node name="Background" type="ColorRect" parent="Group"]
unique_name_in_owner = true
material = SubResource("ShaderMaterial_60xbe")
offset_left = -115.0
offset_top = -69.0
offset_right = 108.0
offset_bottom = 83.0
mouse_filter = 2
[node name="DialogText" type="RichTextLabel" parent="." node_paths=PackedStringArray("textbox_root")]
unique_name_in_owner = true
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -53.0
offset_top = -13.0
offset_right = 53.0
offset_bottom = 12.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/default_color = Color(0, 0, 0, 1)
scroll_active = false
visible_characters_behavior = 1
script = ExtResource("3_syv35")
textbox_root = NodePath("..")
[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="DialogText"]
script = ExtResource("4_7bm4b")
[node name="NameLabelPositioner" type="HBoxContainer" parent="DialogText"]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 23.0
grow_horizontal = 2
alignment = 1
[node name="NameLabelPanel" type="PanelContainer" parent="DialogText/NameLabelPositioner"]
unique_name_in_owner = true
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_h6ls0")
[node name="NameLabel" type="Label" parent="DialogText/NameLabelPositioner/NameLabelPanel" node_paths=PackedStringArray("name_label_root")]
unique_name_in_owner = true
layout_mode = 2
horizontal_alignment = 1
script = ExtResource("6_5gd03")
name_label_root = NodePath("..")
use_character_color = false
[connection signal="started_revealing_text" from="DialogText" to="." method="_on_dialog_text_started_revealing_text"]

View File

@@ -0,0 +1,185 @@
@tool
extends DialogicLayoutLayer
## This layout won't do anything on its own
@export_group("Main")
@export_subgroup("Text")
@export var text_size: int = 15
@export var text_color: Color = Color.BLACK
@export_file('*.ttf') var normal_font: String = ""
@export_file('*.ttf') var bold_font: String = ""
@export_file('*.ttf') var italic_font: String = ""
@export_file('*.ttf') var bold_italic_font: String = ""
@export var text_max_width: int = 300
@export_subgroup('Box')
@export var box_modulate: Color = Color.WHITE
@export var box_modulate_by_character_color: bool = false
@export var box_padding: Vector2 = Vector2(10,10)
@export_range(1, 999) var box_corner_radius: int = 25
@export_range(0.1, 5) var box_wobble_speed: float = 1
@export_range(0, 1) var box_wobble_amount: float = 0.5
@export_range(0, 1) var box_wobble_detail: float = 0.2
@export_subgroup('Behaviour')
@export var behaviour_distance: int = 50
@export var behaviour_direction: Vector2 = Vector2(1, -1)
@export_group('Name Label')
@export_subgroup("Name Label")
@export var name_label_enabled: bool = true
@export var name_label_font_size: int = 15
@export_file('*.ttf') var name_label_font: String = ""
@export var name_label_use_character_color: bool = true
@export var name_label_color: Color = Color.BLACK
@export_subgroup("Name Label Box")
@export var name_label_box_modulate: Color = Color.WHITE
@export var name_label_box_modulate_use_character_color: bool = false
@export var name_label_padding: Vector2 = Vector2(5,0)
@export var name_label_offset: Vector2 = Vector2(0,0)
@export var name_label_alignment := HBoxContainer.ALIGNMENT_BEGIN
@export_group('Choices')
@export_subgroup('Choices Text')
@export var choices_text_size: int = 15
@export_file('*.ttf') var choices_text_font: String = ""
@export var choices_text_color: Color = Color.DARK_SLATE_GRAY
@export var choices_text_color_hover: Color = Color.DARK_MAGENTA
@export var choices_text_color_focus: Color = Color.DARK_MAGENTA
@export var choices_text_color_disabled: Color = Color.DARK_GRAY
@export_subgroup('Choices Layout')
@export var choices_layout_alignment := FlowContainer.ALIGNMENT_END
@export var choices_layout_force_lines: bool = false
@export_file('*.tres', "*.res") var choices_base_theme: String = ""
const TextBubble := preload("res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Textbubble/text_bubble.gd")
var bubbles: Array[TextBubble] = []
var fallback_bubble: TextBubble = null
const textbubble_scene: PackedScene = preload("res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Textbubble/text_bubble.tscn")
func add_bubble() -> TextBubble:
var new_bubble: TextBubble = textbubble_scene.instantiate()
add_child(new_bubble)
bubbles.append(new_bubble)
return new_bubble
## Called by dialogic whenever export overrides might change
func _apply_export_overrides() -> void:
pass
## Called by the base layer before opening the bubble
func bubble_apply_overrides(bubble:TextBubble) -> void:
## TEXT FONT AND COLOR
var rtl: RichTextLabel = bubble.text
rtl.add_theme_font_size_override(&'normal_font', text_size)
rtl.add_theme_font_size_override(&"normal_font_size", text_size)
rtl.add_theme_font_size_override(&"bold_font_size", text_size)
rtl.add_theme_font_size_override(&"italics_font_size", text_size)
rtl.add_theme_font_size_override(&"bold_italics_font_size", text_size)
rtl.add_theme_color_override(&"default_color", text_color)
if !normal_font.is_empty():
rtl.add_theme_font_override(&"normal_font", load(normal_font) as Font)
if !bold_font.is_empty():
rtl.add_theme_font_override(&"bold_font", load(bold_font) as Font)
if !italic_font.is_empty():
rtl.add_theme_font_override(&"italitc_font", load(italic_font) as Font)
if !bold_italic_font.is_empty():
rtl.add_theme_font_override(&"bold_italics_font", load(bold_italic_font) as Font)
bubble.set(&'max_width', text_max_width)
## BOX & TAIL COLOR
var tail_and_bg_group := (bubble.get_node("Group") as CanvasGroup)
tail_and_bg_group.self_modulate = box_modulate
if box_modulate_by_character_color and bubble.current_character != null:
tail_and_bg_group.self_modulate = bubble.current_character.color
var background := (bubble.get_node('%Background') as ColorRect)
var bg_material: ShaderMaterial = (background.material as ShaderMaterial)
bg_material.set_shader_parameter(&'radius', box_corner_radius)
bg_material.set_shader_parameter(&'wobble_amount', box_wobble_amount)
bg_material.set_shader_parameter(&'wobble_speed', box_wobble_speed)
bg_material.set_shader_parameter(&'wobble_detail', box_wobble_detail)
bubble.padding = box_padding
## BEHAVIOUR
bubble.safe_zone = behaviour_distance
bubble.base_direction = behaviour_direction
## NAME LABEL SETTINGS
var nl: DialogicNode_NameLabel = bubble.name_label
nl.add_theme_font_size_override(&"font_size", name_label_font_size)
if !name_label_font.is_empty():
nl.add_theme_font_override(&'font', load(name_label_font) as Font)
if name_label_use_character_color and bubble.current_character:
nl.add_theme_color_override(&"font_color", bubble.current_character.color)
else:
nl.add_theme_color_override(&"font_color", name_label_color)
var nlp: PanelContainer = bubble.name_label_box
nlp.self_modulate = name_label_box_modulate
if name_label_box_modulate_use_character_color and bubble.current_character:
nlp.self_modulate = bubble.current_character.color
nlp.get_theme_stylebox(&'panel').content_margin_left = name_label_padding.x
nlp.get_theme_stylebox(&'panel').content_margin_right = name_label_padding.x
nlp.get_theme_stylebox(&'panel').content_margin_top = name_label_padding.y
nlp.get_theme_stylebox(&'panel').content_margin_bottom = name_label_padding.y
bubble.name_label_offset = name_label_offset
bubble.name_label_alignment = name_label_alignment
nlp.get_parent().visible = name_label_enabled
## CHOICE SETTINGS
if choices_layout_force_lines:
bubble.add_choice_container(VBoxContainer.new(), choices_layout_alignment)
else:
bubble.add_choice_container(HFlowContainer.new(), choices_layout_alignment)
var choice_theme: Theme = null
if choices_base_theme.is_empty() or not ResourceLoader.exists(choices_base_theme):
choice_theme = Theme.new()
var base_style := StyleBoxFlat.new()
base_style.draw_center = false
base_style.border_width_bottom = 2
base_style.border_color = choices_text_color
choice_theme.set_stylebox(&'normal', &'Button', base_style)
var focus_style := (base_style.duplicate() as StyleBoxFlat)
focus_style.border_color = choices_text_color_focus
choice_theme.set_stylebox(&'focus', &'Button', focus_style)
var hover_style := (base_style.duplicate() as StyleBoxFlat)
hover_style.border_color = choices_text_color_hover
choice_theme.set_stylebox(&'hover', &'Button', hover_style)
var disabled_style := (base_style.duplicate() as StyleBoxFlat)
disabled_style.border_color = choices_text_color_disabled
choice_theme.set_stylebox(&'disabled', &'Button', disabled_style)
choice_theme.set_stylebox(&'pressed', &'Button', base_style)
else:
choice_theme = (load(choices_base_theme) as Theme)
if !choices_text_font.is_empty():
choice_theme.default_font = (load(choices_text_font) as Font)
choice_theme.set_font_size(&'font_size', &'Button', choices_text_size)
choice_theme.set_color(&'font_color', &'Button', choices_text_color)
choice_theme.set_color(&'font_pressed_color', &'Button', choices_text_color)
choice_theme.set_color(&'font_hover_color', &'Button', choices_text_color_hover)
choice_theme.set_color(&'font_focus_color', &'Button', choices_text_color_focus)
choice_theme.set_color(&'font_disabled_color', &'Button', choices_text_color_disabled)
bubble.choice_container.theme = choice_theme

View File

@@ -0,0 +1 @@
uid://bnveym4ubsn3g

View File

@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://d2it0xiap3gnt"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Textbubble/text_bubble_layer.gd" id="1_b37je"]
[node name="TextBubbleLayer" type="Control"]
layout_mode = 3
anchors_preset = 0
mouse_filter = 2
script = ExtResource("1_b37je")

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="100" height="100" viewBox="0 0 26.458333 26.458333" version="1.1" id="svg13076" inkscape:export-filename="input_layer_icon.svg" inkscape:export-xdpi="96" inkscape:export-ydpi="96" inkscape:version="1.2.2 (732a01da63, 2022-12-09)" sodipodi:docname="text_bubble_layer_icon.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview id="namedview13078" pagecolor="#505050" bordercolor="#eeeeee" borderopacity="1" inkscape:showpageshadow="0" inkscape:pageopacity="0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" inkscape:document-units="mm" showgrid="true" inkscape:zoom="5.9184838" inkscape:cx="61.502239" inkscape:cy="68.598651" inkscape:window-width="1920" inkscape:window-height="1017" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="layer1">
<inkscape:grid type="xygrid" id="grid14286" />
</sodipodi:namedview>
<defs id="defs13073" />
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1">
<rect x="4.0595255" y="7.3477197" width="18.477333" height="10.384831" rx="1.759746" stroke="#ffffff" stroke-width="1.46627" id="rect30126" style="fill:#ffffff;fill-opacity:1" />
<rect x="4.4799924" y="3.1119337" width="6.9150147" height="2.1797333" rx="0.65857279" stroke="#ffffff" stroke-width="0.410954" id="rect1570" style="fill:#ffffff;fill-opacity:1" />
<path style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" d="m 5.8208333,22.489583 c 2.507191,-1.706008 3.833717,-3.283474 4.7624997,-5.291666 l 5.820833,-1e-6 c 0.106809,2.563666 -4.892406,4.003771 -10.5833327,5.291667" id="path1626" sodipodi:nodetypes="cccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dgpyaea4qw8a5"
path="res://.godot/imported/text_bubble_layer_icon.svg-d46d5806bbf83c1dc50f8d7fc8dac67d.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Textbubble/text_bubble_layer_icon.svg"
dest_files=["res://.godot/imported/text_bubble_layer_icon.svg-d46d5806bbf83c1dc50f8d7fc8dac67d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.3
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

View File

@@ -0,0 +1,15 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://bu0tsjabpj4rd"]
[resource]
content_margin_left = 10.0
content_margin_top = 5.0
content_margin_right = 10.0
content_margin_bottom = 5.0
bg_color = Color(0, 0, 0, 0.956863)
draw_center = false
border_width_left = 5
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
expand_margin_left = 5.0

View File

@@ -0,0 +1,18 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://xs2s6euq5stw"]
[resource]
content_margin_top = 5.0
content_margin_bottom = 5.0
bg_color = Color(0, 0, 0, 0.956863)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
expand_margin_left = 1.0
expand_margin_top = 1.0
expand_margin_right = 1.0
expand_margin_bottom = 1.0

View File

@@ -0,0 +1,12 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://wrp8f7ard3uu"]
[resource]
content_margin_left = 10.0
content_margin_top = 5.0
content_margin_right = 10.0
content_margin_bottom = 5.0
bg_color = Color(0, 0, 0, 0.941176)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="100" height="100" viewBox="0 0 26.458333 26.458333" version="1.1" id="svg13076" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs13073" />
<g id="layer1">
<rect style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" id="rect19792" width="13.229166" height="2.6458333" x="6.614583" y="6.614583" ry="0.050781649" />
<rect style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" id="rect19794" width="13.229166" height="2.6458333" x="6.614583" y="11.90625" ry="0.050781649" />
<rect style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.88;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2" id="rect19796" width="13.229166" height="2.6458333" x="6.614583" y="17.197916" ry="0.050781649" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://xcxex6r1v6xk"
path="res://.godot/imported/choices_layer_icon.svg-2f676308da08dddba733cb2bfba8fc69.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/choices_layer_icon.svg"
dest_files=["res://.godot/imported/choices_layer_icon.svg-2f676308da08dddba733cb2bfba8fc69.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.3
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "Centered Choices"
author = "Dialogic"
description = "A layer containing simple centered choices."
scene = "vn_choice_layer.tscn"
icon = "choices_layer_icon.svg"

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://h1qtatxnadhj"
path="res://.godot/imported/preview.png-ae89c99370d002f2ecf00af8e270d88c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/preview.png"
dest_files=["res://.godot/imported/preview.png-ae89c99370d002f2ecf00af8e270d88c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,122 @@
@tool
extends DialogicLayoutLayer
## A layer that allows showing up to 10 choices.
## Choices are positioned in the center of the screen.
@export_group("Text")
@export_subgroup('Font')
@export var font_use_global: bool = true
@export_file('*.ttf', '*.tres') var font_custom: String = ""
@export_subgroup('Size')
@export var font_size_use_global: bool = true
@export var font_size_custom: int = 16
@export_subgroup('Color')
@export var text_color_use_global: bool = true
@export var text_color_custom: Color = Color.WHITE
@export var text_color_pressed: Color = Color.WHITE
@export var text_color_hovered: Color = Color.GRAY
@export var text_color_disabled: Color = Color.DARK_GRAY
@export var text_color_focused: Color = Color.WHITE
@export_group('Boxes')
@export_subgroup('Panels')
@export_file('*.tres') var boxes_stylebox_normal: String = "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/choice_panel_normal.tres"
@export_file('*.tres') var boxes_stylebox_hovered: String = "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/choice_panel_hover.tres"
@export_file('*.tres') var boxes_stylebox_pressed: String = ""
@export_file('*.tres') var boxes_stylebox_disabled: String = ""
@export_file('*.tres') var boxes_stylebox_focused: String = "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/choice_panel_focus.tres"
@export_subgroup('Modulate')
@export_subgroup('Size & Position')
@export var boxes_v_separation: int = 10
@export var boxes_fill_width: bool = true
@export var boxes_min_size: Vector2 = Vector2()
@export var boxes_offset: Vector2 = Vector2()
@export_group('Sounds')
@export_range(-80, 24, 0.01) var sounds_volume: float = -10
@export_file("*.wav", "*.ogg", "*.mp3") var sounds_pressed: String = "res://addons/dialogic/Example Assets/sound-effects/typing1.wav"
@export_file("*.wav", "*.ogg", "*.mp3") var sounds_hover: String = "res://addons/dialogic/Example Assets/sound-effects/typing2.wav"
@export_file("*.wav", "*.ogg", "*.mp3") var sounds_focus: String = "res://addons/dialogic/Example Assets/sound-effects/typing4.wav"
func get_choices() -> VBoxContainer:
return $Choices
func get_button_sound() -> DialogicNode_ButtonSound:
return %DialogicNode_ButtonSound
## Method that applies all exported settings
func _apply_export_overrides() -> void:
# apply text settings
var layer_theme: Theme = Theme.new()
# font
if font_use_global and get_global_setting(&'font', false):
layer_theme.set_font(&'font', &'Button', load(get_global_setting(&'font', '') as String) as Font)
elif ResourceLoader.exists(font_custom):
layer_theme.set_font(&'font', &'Button', load(font_custom) as Font)
# font size
if font_size_use_global:
layer_theme.set_font_size(&'font_size', &'Button', get_global_setting(&'font_size', font_size_custom) as int)
else:
layer_theme.set_font_size(&'font_size', &'Button', font_size_custom)
# font color
if text_color_use_global:
layer_theme.set_color(&'font_color', &'Button', get_global_setting(&'font_color', text_color_custom) as Color)
else:
layer_theme.set_color(&'font_color', &'Button', text_color_custom)
layer_theme.set_color(&'font_pressed_color', &'Button', text_color_pressed)
layer_theme.set_color(&'font_hover_color', &'Button', text_color_hovered)
layer_theme.set_color(&'font_disabled_color', &'Button', text_color_disabled)
layer_theme.set_color(&'font_pressed_color', &'Button', text_color_pressed)
layer_theme.set_color(&'font_focus_color', &'Button', text_color_focused)
# apply box settings
if ResourceLoader.exists(boxes_stylebox_normal):
var style_box: StyleBox = load(boxes_stylebox_normal)
layer_theme.set_stylebox(&'normal', &'Button', style_box)
layer_theme.set_stylebox(&'hover', &'Button', style_box)
layer_theme.set_stylebox(&'pressed', &'Button', style_box)
layer_theme.set_stylebox(&'disabled', &'Button', style_box)
layer_theme.set_stylebox(&'focus', &'Button', style_box)
if ResourceLoader.exists(boxes_stylebox_hovered):
layer_theme.set_stylebox(&'hover', &'Button', load(boxes_stylebox_hovered) as StyleBox)
if ResourceLoader.exists(boxes_stylebox_pressed):
layer_theme.set_stylebox(&'pressed', &'Button', load(boxes_stylebox_pressed) as StyleBox)
if ResourceLoader.exists(boxes_stylebox_disabled):
layer_theme.set_stylebox(&'disabled', &'Button', load(boxes_stylebox_disabled) as StyleBox)
if ResourceLoader.exists(boxes_stylebox_focused):
layer_theme.set_stylebox(&'focus', &'Button', load(boxes_stylebox_focused) as StyleBox)
get_choices().add_theme_constant_override(&"separation", boxes_v_separation)
self.position = boxes_offset
for child: Node in get_choices().get_children():
if not child is DialogicNode_ChoiceButton:
continue
var choice: DialogicNode_ChoiceButton = child as DialogicNode_ChoiceButton
if boxes_fill_width:
choice.size_flags_horizontal = Control.SIZE_FILL
else:
choice.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
choice.custom_minimum_size = boxes_min_size
set(&'theme', layer_theme)
# apply sound settings
var button_sound: DialogicNode_ButtonSound = get_button_sound()
button_sound.volume_db = sounds_volume
button_sound.sound_pressed = load(sounds_pressed)
button_sound.sound_hover = load(sounds_hover)
button_sound.sound_focus = load(sounds_focus)

View File

@@ -0,0 +1 @@
uid://cq5x832dsaah8

View File

@@ -0,0 +1,98 @@
[gd_scene load_steps=7 format=3 uid="uid://dhk6j6eb6e3q"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/vn_choice_layer.gd" id="1_kurgw"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Choice/node_choice_button.gd" id="1_w632k"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Choice/node_button_sound.gd" id="2_mgko6"]
[ext_resource type="AudioStream" uid="uid://b6c1p14bc20p1" path="res://addons/dialogic/Example Assets/sound-effects/typing1.wav" id="3_mql8i"]
[ext_resource type="AudioStream" uid="uid://c2viukvbub6v6" path="res://addons/dialogic/Example Assets/sound-effects/typing4.wav" id="4_420fr"]
[sub_resource type="AudioStream" id="AudioStream_pe27w"]
[node name="VN_ChoiceLayer" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_kurgw")
[node name="Choices" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -41.0
offset_top = -47.0
offset_right = 42.0
offset_bottom = 47.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
alignment = 1
metadata/_edit_layout_mode = 1
[node name="DialogicNode_ChoiceButton1" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton2" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton3" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton4" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton5" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton6" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton7" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton8" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton9" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton10" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ChoiceButton11" type="Button" parent="Choices"]
layout_mode = 2
text = "Some text"
script = ExtResource("1_w632k")
[node name="DialogicNode_ButtonSound" type="AudioStreamPlayer" parent="Choices"]
unique_name_in_owner = true
script = ExtResource("2_mgko6")
sound_pressed = ExtResource("3_mql8i")
sound_hover = ExtResource("4_420fr")
sound_focus = SubResource("AudioStream_pe27w")

View File

@@ -0,0 +1,7 @@
[style]
type = "Layer"
name = "5 Portraits"
author = "Dialogic"
description = "A layer with 5 portrait position containers."
scene = "vn_portrait_layer.tscn"
icon = "portrait_layer_icon.svg"

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
id="svg13076" inkscape:export-filename="portrait_layre.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" inkscape:export-ydpi="96" inkscape:export-xdpi="96" inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100px" height="100px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<sodipodi:namedview id="namedview13078" inkscape:pagecheckerboard="0" inkscape:cy="64.755078" inkscape:zoom="4.185" inkscape:cx="70.728793" pagecolor="#505050" showgrid="true" borderopacity="1" bordercolor="#eeeeee" inkscape:document-units="mm" inkscape:deskcolor="#505050" inkscape:pageopacity="0" inkscape:showpageshadow="0" inkscape:current-layer="layer1" inkscape:window-y="-8" inkscape:window-x="-8" inkscape:window-height="1017" inkscape:window-width="1920" inkscape:window-maximized="1">
<inkscape:grid id="grid14286" type="xygrid"></inkscape:grid>
</sodipodi:namedview>
<g>
<ellipse id="path23638" fill="#FFFFFF" cx="18.793" cy="33.473" rx="13.682" ry="14.261"/>
<path id="path23636" sodipodi:nodetypes="ccccc" fill="#FFFFFF" d="M6.903,80.789c0-11.847,0-23.693,4.756-35.539h14.268
c4.756,11.846,4.756,23.692,4.756,35.539H6.903"/>
<ellipse id="ellipse23642" fill="#FFFFFF" cx="49.999" cy="33.473" rx="13.683" ry="14.261"/>
<path id="path23640" sodipodi:nodetypes="ccccc" fill="#FFFFFF" d="M38.108,80.789c0-11.847,0-23.693,4.756-35.539h14.268
c4.756,11.846,4.756,23.692,4.756,35.539H38.108"/>
<path id="path23644" sodipodi:nodetypes="ccccc" fill="#FFFFFF" d="M69.316,80.789c0-11.847,0-23.693,4.756-35.539H88.34
c4.757,11.846,4.757,23.692,4.757,35.539H69.316"/>
<ellipse id="ellipse23646" fill="#FFFFFF" cx="81.206" cy="33.473" rx="13.683" ry="14.261"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://fwi64s4gbob2"
path="res://.godot/imported/portrait_layer_icon.svg-4bc8b0ebd4dd0977a12c09f30758d7e1.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Portraits/portrait_layer_icon.svg"
dest_files=["res://.godot/imported/portrait_layer_icon.svg-4bc8b0ebd4dd0977a12c09f30758d7e1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.3
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ypmfci4n2abt"
path="res://.godot/imported/preview.png-8a6dae1a8e205382d354326ea6961ed2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Portraits/preview.png"
dest_files=["res://.godot/imported/preview.png-8a6dae1a8e205382d354326ea6961ed2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,14 @@
@tool
extends DialogicLayoutLayer
## A layer that allows showing 5 portraits, like in a visual novel.
## The canvas layer that the portraits are on.
@export var portrait_size_mode: DialogicNode_PortraitContainer.SizeModes = DialogicNode_PortraitContainer.SizeModes.FIT_SCALE_HEIGHT
func _apply_export_overrides() -> void:
# apply portrait size
for child: DialogicNode_PortraitContainer in %Portraits.get_children():
child.size_mode = portrait_size_mode
child.update_portrait_transforms()

View File

@@ -0,0 +1 @@
uid://dhu6skuji8f8q

View File

@@ -0,0 +1,84 @@
[gd_scene load_steps=3 format=3 uid="uid://cy1y14inwkplb"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Portraits/vn_portrait_layer.gd" id="1_1i7em"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Character/node_portrait_container.gd" id="1_rxdcc"]
[node name="VN_PortraitLayer" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_1i7em")
[node name="Portraits" type="Control" parent="."]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="DialogicNode_PortraitContainer1" type="Control" parent="Portraits"]
layout_mode = 1
anchor_right = 0.2
anchor_bottom = 1.0
offset_right = -1.52588e-05
grow_vertical = 2
pivot_offset = Vector2(115.2, 648)
mouse_filter = 2
script = ExtResource("1_rxdcc")
container_ids = PackedStringArray("leftmost", "0")
metadata/_edit_use_anchors_ = true
[node name="DialogicNode_PortraitContainer2" type="Control" parent="Portraits"]
layout_mode = 1
anchor_left = 0.2
anchor_right = 0.4
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
container_ids = PackedStringArray("left", "1")
metadata/_edit_use_anchors_ = true
[node name="DialogicNode_PortraitContainer3" type="Control" parent="Portraits"]
layout_mode = 1
anchor_left = 0.4
anchor_right = 0.6
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
container_ids = PackedStringArray("center", "middle", "2")
metadata/_edit_use_anchors_ = true
[node name="DialogicNode_PortraitContainer4" type="Control" parent="Portraits"]
layout_mode = 1
anchor_left = 0.6
anchor_right = 0.8
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
container_ids = PackedStringArray("right", "3")
metadata/_edit_use_anchors_ = true
[node name="DialogicNode_PortraitContainer5" type="Control" parent="Portraits"]
layout_mode = 1
anchor_left = 0.8
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
container_ids = PackedStringArray("rightmost", "4")
metadata/_edit_use_anchors_ = true

View File

@@ -0,0 +1,93 @@
extends AnimationPlayer
## A custom script/node that adds some animations to the textbox.
# Careful: Sync these with the ones in the root script!
enum AnimationsIn {NONE, POP_IN, FADE_UP}
enum AnimationsOut {NONE, POP_OUT, FADE_DOWN}
enum AnimationsNewText {NONE, WIGGLE}
var animation_in: AnimationsIn
var animation_out: AnimationsOut
var animation_new_text: AnimationsNewText
var full_clear := true
func get_text_panel() -> PanelContainer:
return %DialogTextPanel
func get_dialog() -> DialogicNode_DialogText:
return %DialogicNode_DialogText
func _ready() -> void:
var text_system: Node = DialogicUtil.autoload().get(&'Text')
text_system.connect(&'animation_textbox_hide', _on_textbox_hide)
text_system.connect(&'animation_textbox_show', _on_textbox_show)
text_system.connect(&'animation_textbox_new_text', _on_textbox_new_text)
text_system.connect(&'about_to_show_text', _on_about_to_show_text)
var animation_system: Node = DialogicUtil.autoload().get(&'Animations')
animation_system.connect(&'animation_interrupted', _on_animation_interrupted)
func _on_textbox_show() -> void:
if animation_in == AnimationsIn.NONE:
return
play('RESET')
var animation_system: Node = DialogicUtil.autoload().get(&'Animations')
animation_system.call(&'start_animating')
get_text_panel().get_parent().get_parent().set(&'modulate', Color.TRANSPARENT)
get_dialog().text = ""
match animation_in:
AnimationsIn.POP_IN:
play("textbox_pop")
AnimationsIn.FADE_UP:
play("textbox_fade_up")
if not animation_finished.is_connected(Callable(animation_system, &'animation_finished')):
animation_finished.connect(Callable(animation_system, &'animation_finished'), CONNECT_ONE_SHOT)
func _on_textbox_hide() -> void:
if animation_out == AnimationsOut.NONE:
return
play('RESET')
var animation_system: Node = DialogicUtil.autoload().get(&'Animations')
animation_system.call(&'start_animating')
match animation_out:
AnimationsOut.POP_OUT:
play_backwards("textbox_pop")
AnimationsOut.FADE_DOWN:
play_backwards("textbox_fade_up")
if not animation_finished.is_connected(Callable(animation_system, &'animation_finished')):
animation_finished.connect(Callable(animation_system, &'animation_finished'), CONNECT_ONE_SHOT)
func _on_about_to_show_text(info:Dictionary) -> void:
full_clear = !info.append
func _on_textbox_new_text() -> void:
if DialogicUtil.autoload().Inputs.auto_skip.enabled:
return
if animation_new_text == AnimationsNewText.NONE:
return
var animation_system: Node = DialogicUtil.autoload().get(&'Animations')
animation_system.call(&'start_animating')
if full_clear:
get_dialog().text = ""
match animation_new_text:
AnimationsNewText.WIGGLE:
play("new_text")
if not animation_finished.is_connected(Callable(animation_system, &'animation_finished')):
animation_finished.connect(Callable(animation_system, &'animation_finished'), CONNECT_ONE_SHOT)
func _on_animation_interrupted() -> void:
if is_playing():
stop()

View File

@@ -0,0 +1 @@
uid://deyihsk5ygbhr

View File

@@ -0,0 +1,13 @@
extends Range
var enabled: bool = true
func _process(_delta : float) -> void:
if !enabled:
hide()
return
if DialogicUtil.autoload().Inputs.auto_advance.get_progress() < 0:
hide()
else:
show()
value = DialogicUtil.autoload().Inputs.auto_advance.get_progress()

View File

@@ -0,0 +1 @@
uid://c1vq61i7urva2

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="6.4715624mm" height="6.4715624mm" viewBox="0 0 6.4715624 6.4715622" version="1.1" id="svg5" inkscape:export-filename="next.svg" inkscape:export-xdpi="17.054285" inkscape:export-ydpi="17.054285" sodipodi:docname="next.svg" inkscape:version="1.2.2 (732a01da63, 2022-12-09)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview id="namedview7" pagecolor="#505050" bordercolor="#eeeeee" borderopacity="1" inkscape:showpageshadow="0" inkscape:pageopacity="0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" inkscape:document-units="mm" showgrid="true" inkscape:zoom="8.4359982" inkscape:cx="-7.0531072" inkscape:cy="10.312947" inkscape:window-width="1920" inkscape:window-height="1017" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="layer1">
<inkscape:grid type="xygrid" id="grid2291" originx="-1.8058334" originy="-1.8059061" />
</sodipodi:namedview>
<defs id="defs2" />
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(-3.3788024,-4.701698)">
<path style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.18;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:3.2;stroke-dasharray:none;stroke-dashoffset:0" d="M 4.4833857,5.2770419 6.6000523,10.568709 8.716719,5.2770419 c -2.6603643,0.2499583 -1.6020309,0.2499583 -4.2333333,0 z" id="path2289" sodipodi:nodetypes="cccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b0rpqfg4fhebk"
path="res://.godot/imported/next.svg-689f85597f487815b8ddefa23d22bf6f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/next.svg"
dest_files=["res://.godot/imported/next.svg-689f85597f487815b8ddefa23d22bf6f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

Some files were not shown because too many files have changed in this diff Show More