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,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")