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