First work on dialogic, resized guild, and started implementing portraits.
This commit is contained in:
@@ -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
|
||||
@@ -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 |
@@ -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
|
||||
@@ -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 |
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
uid://b8ielb4ro8ron
|
||||
@@ -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")
|
||||
Reference in New Issue
Block a user