This commit is contained in:
2025-08-31 17:53:17 -05:00
parent 6d75b33775
commit aea5158d6e
161 changed files with 13444 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
@tool
extends Button
@export var tip_title: String = ""
@export_multiline var tip_text: String = "" # (String, MULTILINE)
@onready var tip_dialog = get_node("TipDialog")
func _on_BtnTip_pressed():
tip_dialog.title = tip_title
tip_dialog.dialog_text = tip_text
tip_dialog.popup_centered()

View File

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

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=3 uid="uid://dyepkyvo6sodg"]
[ext_resource type="Texture2D" uid="uid://cae7h22m1o7aw" path="res://addons/madtalk/images/icon_question.png" id="1"]
[ext_resource type="Script" uid="uid://degiqbehoikc5" path="res://addons/madtalk/components/BtnTip.gd" id="2"]
[node name="BtnTip" type="Button"]
offset_right = 28.0
offset_bottom = 26.0
focus_mode = 0
icon = ExtResource("1")
flat = true
script = ExtResource("2")
[node name="TipDialog" type="AcceptDialog" parent="."]
initial_position = 2
size = Vector2i(650, 200)
popup_window = true
dialog_autowrap = true
[connection signal="pressed" from="." to="." method="_on_BtnTip_pressed"]

View File

@@ -0,0 +1,3 @@
extends CheckBox
@export var locale: String = ""

View File

@@ -0,0 +1 @@
uid://7r6730p3jqi8

View File

@@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://cfxq3ddd234s5"]
[ext_resource type="Script" uid="uid://7r6730p3jqi8" path="res://addons/madtalk/components/CheckBoxLocale.gd" id="1_nugbd"]
[node name="CheckBoxLocale" type="CheckBox"]
theme_override_colors/font_color = Color(0.323181, 0.438824, 0, 1)
theme_override_colors/font_pressed_color = Color(0.509804, 1, 0, 1)
theme_override_font_sizes/font_size = 12
button_pressed = true
text = "Default locale"
clip_text = true
script = ExtResource("1_nugbd")

View File

@@ -0,0 +1,311 @@
@tool
extends GraphNode
class_name DialogGraphNode
signal connections_changed
# data is a live reference to the underlying data this GraphNode refers to
# changing properties in this script will affect the original data
@export var data: Resource
var DialogOptions_template = preload("res://addons/madtalk/components/DialogNode_DialogOptions.tscn")
var DialogNodeItem_message_template = preload("res://addons/madtalk/components/DialogNodeItem_message.tscn")
var DialogNodeItem_condition_template = preload("res://addons/madtalk/components/DialogNodeItem_condition.tscn")
var DialogNodeItem_effect_template = preload("res://addons/madtalk/components/DialogNodeItem_effect.tscn")
var DialogNodeItem_option_template = preload("res://addons/madtalk/components/DialogNodeItem_option.tscn")
@onready var topbar = get_node("TopBar")
@onready var add_menu = get_node("TopBar/AddMenu")
@onready var dialog_remove = get_node("TopBar/DialogRemove")
const COLOR_COND := Color(1.0, 0.5, 0.0, 1.0)
const COLOR_OPT := Color(0.0, 1.0, 1.0, 1.0)
const COLOR_CONT := Color(1.0, 1.0, 1.0, 1.0)
# Stores a port_index -> data resource map
var port_data_map := {}
# Stores a reference to the main editor
var main_editor: Control = null
func _ready():
if data:
update_from_data()
func clear():
var itemlist = get_children()
# Index 0 is always topbar, we ignore
itemlist.remove_at(0)
for item in itemlist:
item.hide()
item.queue_free()
custom_minimum_size.y = 1
size.y = 1
# Clears the port_index -> data resource map
port_data_map.clear()
func update_from_data():
if data == null:
return
# === Clear
clear()
# === Header
if data.sequence_id == 0:
title = "ID: 0 START"
else:
title = "ID: %d" % data.sequence_id
var i = 1 # Index 0 is topbar so we skip
var final_size = 24 # accumulation variable
var output_i = 0
# === Items
for item in data.items:
# Type-specific actions:
var new_item = null
match item.item_type:
DialogNodeItemData.ItemTypes.Message:
item.port_index = -1
new_item = DialogNodeItem_message_template.instantiate()
clear_slot(i)
DialogNodeItemData.ItemTypes.Condition:
item.port_index = output_i
port_data_map[output_i] = item
output_i += 1
new_item = DialogNodeItem_condition_template.instantiate()
clear_slot(i)
set_slot(i, # index
false, # bool enable_left
0, # int type_left
Color.BLACK, # Color color_left
true, # bool enable_right
0, # int type_right
COLOR_COND # Color color_right
#, Texture custom_left=null, Texture custom_right=null
)
DialogNodeItemData.ItemTypes.Effect:
item.port_index = -1
new_item = DialogNodeItem_effect_template.instantiate()
clear_slot(i)
if new_item:
new_item.sequence_node = self
add_child(new_item)
new_item.remove_requested.connect(_on_Item_remove_requested)
new_item.move_up_requested.connect(_on_move_up_requested)
new_item.move_down_requested.connect(_on_move_down_requested)
new_item.mouse_entered.connect(main_editor._on_item_mouse_entered.bind(new_item))
new_item.mouse_exited.connect(main_editor._on_item_mouse_exited.bind(new_item))
new_item.drag_started.connect(main_editor._on_item_drag_started)
new_item.drag_ended.connect(main_editor._on_item_drag_ended)
new_item.set_data(item)
final_size += new_item.custom_minimum_size.y
i += 1
# === Options
# If we have options
if data.options.size() > 0:
# Delete the continue connection as it is invalid
data.continue_sequence_id = -1
data.continue_port_index = -1
# Traverse options
for option in data.options:
option.port_index = output_i
port_data_map[output_i] = option
output_i += 1
var new_opt = DialogNodeItem_option_template.instantiate()
add_child(new_opt)
new_opt.text = option.text
new_opt.set_conditional(option.is_conditional)
set_slot(i, # index
false, # bool enable_left
0, # int type_left
Color.BLACK, # Color color_left
true, # bool enable_right
0, # int type_right
COLOR_OPT # Color color_right
#, Texture custom_left=null, Texture custom_right=null
)
final_size += new_opt.custom_minimum_size.y
i += 1
# If no options, continue is the single option
else:
data.continue_port_index = output_i
output_i += 1
var new_opt = DialogNodeItem_option_template.instantiate()
add_child(new_opt)
new_opt.text = "(Continue)"
set_slot(i, # index
false, # bool enable_left
0, # int type_left
Color.BLACK, # Color color_left
true, # bool enable_right
0, # int type_right
COLOR_CONT # Color color_right
#, Texture custom_left=null, Texture custom_right=null
)
final_size += new_opt.custom_minimum_size.y
i += 1
# === UPDATING SIZE
if is_inside_tree() and get_tree():
# We yield one frame to allow all resizing methods to be called properly
# before we apply the final size to the node
await get_tree().process_frame
# This works fine when the MadTalk editor is exported in a project
# (such as in-game dialog editting)
size.y = final_size
# However, if the MadTalk editor is running as a plugin in the Godot Editor
# (and only in this situation), waiting just one frame is not enough, and
# the node resizing suffers from random-like errors. If you ever find out
# the reason, please don't hesitate to send a PR.
# Currently we wait a second frame and then fix the size manually again
# A visual glitch can be seen for one frame
await get_tree().process_frame
final_size = 0
for item in get_children():
final_size += item.size.y
size.y = final_size
# Given an output port index, returns the corresponding data resource
# return value can be either DialogNodeItemData or DialogNodeOptionData
func get_data_by_port(port_index: int) -> Resource:
# first check if this is a continue port
if port_index == data.continue_port_index:
return data
# otherwise check if invalid port
if not port_index in port_data_map:
return null
# Finally get the data for the port
return port_data_map[port_index]
# =======================================
# ADD MENU
enum AddMenuItems {
Message,
Condition,
Effect
}
func _on_BtnAdd_pressed():
var cursor_position = get_viewport().get_mouse_position() if get_viewport().gui_embed_subwindows else DisplayServer.mouse_get_position()
add_menu.popup(Rect2(cursor_position, Vector2(1,1)))
func _on_AddMenu_id_pressed(id):
match id:
AddMenuItems.Message:
var new_data_item = DialogNodeItemData.new()
new_data_item.resource_scene_unique_id = Resource.generate_scene_unique_id()
new_data_item.item_type = DialogNodeItemData.ItemTypes.Message
new_data_item.message_speaker_id = ""
new_data_item.message_text = ""
data.items.append(new_data_item)
update_from_data()
AddMenuItems.Condition:
var new_data_item = DialogNodeItemData.new()
new_data_item.resource_scene_unique_id = Resource.generate_scene_unique_id()
new_data_item.item_type = DialogNodeItemData.ItemTypes.Condition
new_data_item.condition_type = MTDefs.ConditionTypes.Random
new_data_item.condition_values = [50]
data.items.append(new_data_item)
update_from_data()
AddMenuItems.Effect:
var new_data_item = DialogNodeItemData.new()
new_data_item.resource_scene_unique_id = Resource.generate_scene_unique_id()
new_data_item.item_type = DialogNodeItemData.ItemTypes.Effect
new_data_item.effect_type = MTDefs.EffectTypes.ChangeSheet
new_data_item.effect_values = ["",0]
data.items.append(new_data_item)
update_from_data()
# Adding items always causes connection rebuild since the options come
# after all the items (or the "Continue" if there are no options)
emit_signal("connections_changed")
# =======================================
# OPTION LIST
func _on_BtnOptions_pressed():
var dialog_opt = DialogOptions_template.instantiate()
# has to be added to topbar and not to self, since all children
# added to self will be considered a connection in the node
topbar.add_child(dialog_opt)
dialog_opt.connect("saved", Callable(self, "_on_DialogOptions_saved"))
dialog_opt.open(data)
func _on_DialogOptions_saved(source_dialog):
update_from_data()
# If options changed we have to rebuild connections
emit_signal("connections_changed")
# =======================================
# MOVE UP/DOWN
func _on_move_up_requested(requester):
var cur_index = data.items.find(requester.data)
if cur_index > 0:
var item_data = data.items[cur_index]
data.items.remove_at(cur_index)
data.items.insert(cur_index-1, item_data)
update_from_data()
emit_signal("connections_changed")
func _on_move_down_requested(requester):
var cur_index = data.items.find(requester.data)
if cur_index < (data.items.size()-1):
var item_data = data.items[cur_index]
data.items.remove_at(cur_index)
data.items.insert(cur_index+1, item_data)
update_from_data()
emit_signal("connections_changed")
# =======================================
# REMOVE BUTTON
var deleting_item = null
func _on_Item_remove_requested(requester):
deleting_item = requester
dialog_remove.popup_centered()
func _on_DialogRemove_confirmed():
if deleting_item:
data.items.erase(deleting_item.data)
deleting_item.data = null
update_from_data()
emit_signal("connections_changed")
# =======================================
# UI events
func _on_DialogNode_dragged(from, to):
data.position = to

View File

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

View File

@@ -0,0 +1,159 @@
[gd_scene load_steps=15 format=3 uid="uid://cp6hkrxr23xk6"]
[ext_resource type="Script" uid="uid://dw017cofkhu8c" path="res://addons/madtalk/components/DialogNode.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://sks6j6y53n1k" path="res://addons/madtalk/components/DialogNodeItem_message.tscn" id="2"]
[ext_resource type="Script" uid="uid://c2bv5lwcvdmrb" path="res://addons/madtalk/components/resources/DialogNodeItemData.gd" id="3"]
[ext_resource type="Texture2D" uid="uid://0l1emjk1cyiy" path="res://addons/madtalk/images/icon_options.png" id="4"]
[ext_resource type="Texture2D" uid="uid://xt0wkyrex027" path="res://addons/madtalk/images/icon_plus.png" id="5"]
[ext_resource type="PackedScene" uid="uid://y6s6jwiawub6" path="res://addons/madtalk/components/DialogNodeItem_option.tscn" id="8"]
[ext_resource type="PackedScene" uid="uid://bjmg67jkhsynh" path="res://addons/madtalk/components/DialogNodeItem_condition.tscn" id="9"]
[ext_resource type="PackedScene" uid="uid://vkj7uamlpxxp" path="res://addons/madtalk/components/DialogNodeItem_effect.tscn" id="10"]
[ext_resource type="Texture2D" uid="uid://dqt1wi0i1aqol" path="res://addons/madtalk/images/icon_effect.png" id="11"]
[ext_resource type="Texture2D" uid="uid://200bqpuqfn6m" path="res://addons/madtalk/images/icon_condition.png" id="12"]
[ext_resource type="Texture2D" uid="uid://dxgulu8lvnwrr" path="res://addons/madtalk/images/icon_x.png" id="13"]
[ext_resource type="Texture2D" uid="uid://u746x6ecjfx5" path="res://addons/madtalk/images/icon_message.png" id="14"]
[sub_resource type="Theme" id="1"]
GraphNode/constants/title_offset = 22
GraphNode/icons/close = ExtResource("13")
[sub_resource type="Resource" id="2"]
script = ExtResource("3")
item_type = 0
connected_to_id = -1
message_speaker_id = "mr_name"
message_speaker_variant = ""
message_voice_clip = ""
message_text = "Hello world"
message_voice_clip_locales = {}
message_text_locales = {}
message_hide_on_end = 0
condition_type = 0
condition_values = [50]
effect_type = 0
effect_values = []
[node name="DialogNode" type="GraphNode"]
offset_left = 250.0
offset_top = 130.0
offset_right = 610.0
offset_bottom = 370.0
theme = SubResource("1")
theme_override_colors/resizer_color = Color(1, 1, 1, 1)
theme_override_constants/separation = 0
title = "0"
slot/0/left_enabled = true
slot/0/left_type = 0
slot/0/left_color = Color(1, 1, 1, 1)
slot/0/left_icon = null
slot/0/right_enabled = false
slot/0/right_type = 0
slot/0/right_color = Color(1, 1, 1, 1)
slot/0/right_icon = null
slot/0/draw_stylebox = true
slot/1/left_enabled = false
slot/1/left_type = 0
slot/1/left_color = Color(1, 1, 1, 1)
slot/1/left_icon = null
slot/1/right_enabled = false
slot/1/right_type = 0
slot/1/right_color = Color(1, 1, 1, 1)
slot/1/right_icon = null
slot/1/draw_stylebox = true
slot/2/left_enabled = false
slot/2/left_type = 0
slot/2/left_color = Color(1, 1, 1, 1)
slot/2/left_icon = null
slot/2/right_enabled = true
slot/2/right_type = 0
slot/2/right_color = Color(1, 0.501961, 0, 1)
slot/2/right_icon = null
slot/2/draw_stylebox = true
slot/3/left_enabled = false
slot/3/left_type = 0
slot/3/left_color = Color(1, 1, 1, 1)
slot/3/left_icon = null
slot/3/right_enabled = false
slot/3/right_type = 0
slot/3/right_color = Color(1, 1, 1, 1)
slot/3/right_icon = null
slot/3/draw_stylebox = true
slot/4/left_enabled = false
slot/4/left_type = 0
slot/4/left_color = Color(1, 1, 1, 1)
slot/4/left_icon = null
slot/4/right_enabled = false
slot/4/right_type = 0
slot/4/right_color = Color(1, 1, 1, 1)
slot/4/right_icon = null
slot/4/draw_stylebox = true
script = ExtResource("1")
[node name="TopBar" type="Control" parent="."]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
[node name="BtnAdd" type="TextureButton" parent="TopBar"]
layout_mode = 0
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -44.0
offset_top = -8.0
offset_right = -28.0
offset_bottom = 8.0
texture_normal = ExtResource("5")
[node name="BtnOptions" type="TextureButton" parent="TopBar"]
layout_mode = 0
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -8.0
offset_right = -4.0
offset_bottom = 8.0
texture_normal = ExtResource("4")
[node name="AddMenu" type="PopupMenu" parent="TopBar"]
size = Vector2i(128, 100)
item_count = 3
item_0/text = "Message"
item_0/icon = ExtResource("14")
item_0/id = 0
item_1/text = "Condition"
item_1/icon = ExtResource("12")
item_1/id = 1
item_2/text = "Effect"
item_2/icon = ExtResource("11")
item_2/id = 2
[node name="DialogRemove" type="ConfirmationDialog" parent="TopBar"]
initial_position = 2
size = Vector2i(386, 109)
popup_window = true
min_size = Vector2i(386, 109)
dialog_text = "
Are you sure you want to remove this item? "
[node name="DialogNodeItem_message" parent="." instance=ExtResource("2")]
custom_minimum_size = Vector2(0, 63)
layout_mode = 2
data = SubResource("2")
[node name="DialogNodeItem_condition" parent="." instance=ExtResource("9")]
layout_mode = 2
[node name="DialogNodeItem_effect" parent="." instance=ExtResource("10")]
layout_mode = 2
[node name="DialogNodeItem_option" parent="." instance=ExtResource("8")]
layout_mode = 2
[connection signal="dragged" from="." to="." method="_on_DialogNode_dragged"]
[connection signal="pressed" from="TopBar/BtnAdd" to="." method="_on_BtnAdd_pressed"]
[connection signal="pressed" from="TopBar/BtnOptions" to="." method="_on_BtnOptions_pressed"]
[connection signal="id_pressed" from="TopBar/AddMenu" to="." method="_on_AddMenu_id_pressed"]
[connection signal="confirmed" from="TopBar/DialogRemove" to="." method="_on_DialogRemove_confirmed"]

View File

@@ -0,0 +1,230 @@
@tool
extends Control
class_name DialogNodeItem_condition
signal remove_requested(requester)
signal move_up_requested(requester)
signal move_down_requested(requester)
signal drag_started(requester)
signal drag_ended(requester)
@export var data: Resource
enum PopupOptions {
Edit,
MoveUp,
MoveDown,
Remove
}
#@onready var dialog_edit = get_node("DialogEdit")
var edit_condition_type
var edit_specificlist
var edit_btntip
# names of the nodes holding the controls in edit box
const edit_specificlist_items = [
"Random",
"VarBool",
"VarAtLeast",
"VarUnder",
"VarString",
"Time",
"DayWeek",
"DayMonth",
"Date",
"ElapsedVar",
"Custom"
]
@onready var condition_conditionlabel = get_node("ConditionLabel")
var template_DialogEdit: PackedScene = preload("res://addons/madtalk/components/popups/Condition_DialogEdit.tscn")
var dialog_edit: Window
var template_PopupMenu: PackedScene = preload("res://addons/madtalk/components/popups/DialogNodeItem_PopupMenu.tscn")
var popup_menu: PopupMenu
@onready var dragdrop_line := $DragDropLine
var sequence_node = null
func _ready():
if data:
set_data(data)
func set_data(new_data):
data = new_data
update_from_data()
func update_from_data():
if data:
var mtdefs = MTDefs.new()
condition_conditionlabel.text = mtdefs.Condition_PrintFail(data.condition_type, data.condition_values)
func create_dialog_edit():
if not dialog_edit:
dialog_edit = template_DialogEdit.instantiate() as Window
add_child(dialog_edit)
dialog_edit.get_node("Panel/BtnConditionType").item_selected.connect(_on_DialogEdit_BtnConditionType_item_selected)
dialog_edit.get_node("Panel/BottomBar/BtnSave").pressed.connect(_on_DialogEdit_BtnSave_pressed)
dialog_edit.get_node("Panel/BottomBar/BtnCancel").pressed.connect(_on_DialogEdit_BtnCancel_pressed)
edit_condition_type = dialog_edit.get_node("Panel/BtnConditionType")
edit_specificlist = dialog_edit.get_node("Panel/SpecificFields")
edit_btntip = dialog_edit.get_node("Panel/BtnTip")
for item in edit_specificlist.get_children():
item.hide()
func dispose_dialog_edit():
if dialog_edit:
dialog_edit.queue_free()
dialog_edit = null
func create_popup_menu():
if not popup_menu:
popup_menu = template_PopupMenu.instantiate() as PopupMenu
add_child(popup_menu)
popup_menu.id_pressed.connect(_on_PopupMenu_id_pressed)
func dispose_popup_menu():
if popup_menu:
popup_menu.queue_free()
popup_menu = null
func _on_DialogNodeItem_condition_gui_input(event):
if (event is InputEventMouseButton):
if (event.pressed):
if (event.button_index == MOUSE_BUTTON_LEFT):
if event.double_click:
_on_PopupMenu_id_pressed(PopupOptions.Edit)
else:
drag_started.emit(self)
if (event.button_index == MOUSE_BUTTON_RIGHT):
var cursor_position = get_viewport().get_mouse_position() if get_viewport().gui_embed_subwindows else DisplayServer.mouse_get_position()
create_popup_menu()
popup_menu.popup(Rect2(cursor_position,Vector2(10,10)))
else:
if (event.button_index == MOUSE_BUTTON_LEFT):
drag_ended.emit(self)
func _on_PopupMenu_id_pressed(id):
dispose_popup_menu()
match id:
PopupOptions.Edit:
create_dialog_edit()
edit_condition_type.selected = data.condition_type
var values_size = data.condition_values.size()
# Nodes not commonly used so get_node is used directly for simplicity
# (They are only used here and when saving)
for j in range(edit_specificlist_items.size()):
var num_args = MTDefs.ConditionData[j]["num_args"]
var node_name = edit_specificlist_items[j]
for i in range(num_args):
var data_type = MTDefs.ConditionData[j]["data_types"][i]
var print_type = MTDefs.ConditionData[j]["print_types"][i] if MTDefs.ConditionData[j]["print_types"].size() > i else TYPE_STRING
var value = data.condition_values[i] if (values_size > i) else MTDefs.ConditionData[j]["default"][i]
if print_type == MTDefs.TYPE_WEEKDAY:
var node = get_node_or_null("DialogEdit/Panel/SpecificFields/%s/Option%d" % [node_name, i])
if node:
value = int(value)
while value > 6:
value -= 7
while value < 0:
value += 7
node.select(int(value))
elif print_type == MTDefs.TYPE_CHECK:
var node = get_node_or_null("DialogEdit/Panel/SpecificFields/%s/Option%d" % [node_name, i])
if node:
value = float(value)
if value != 0:
node.select(0)
else:
node.select(1)
elif print_type != null:
var node = get_node_or_null("DialogEdit/Panel/SpecificFields/%s/EditValue%d" % [node_name, i])
if node:
node.text = str(value)
update_DialogEdit_contents(data.condition_type)
dialog_edit.popup_centered()
PopupOptions.MoveUp:
emit_signal("move_up_requested", self)
PopupOptions.MoveDown:
emit_signal("move_down_requested", self)
PopupOptions.Remove:
emit_signal("remove_requested", self)
func _on_DialogEdit_BtnConditionType_item_selected(index):
update_DialogEdit_contents(edit_condition_type.selected)
func _on_DialogEdit_BtnCancel_pressed():
dispose_dialog_edit()
func _on_DialogEdit_BtnSave_pressed():
data.condition_type = edit_condition_type.selected
var num_args = MTDefs.ConditionData[data.condition_type]["num_args"]
var node_name = edit_specificlist_items[data.condition_type]
data.condition_values.resize(num_args)
for i in range(num_args):
var data_type = MTDefs.ConditionData[data.condition_type]["data_types"][i]
var print_type = MTDefs.ConditionData[data.condition_type]["print_types"][i] if MTDefs.ConditionData[data.condition_type]["print_types"].size() > i else TYPE_STRING
var value
if print_type == MTDefs.TYPE_WEEKDAY:
value = get_node("DialogEdit/Panel/SpecificFields/%s/Option%d" % [node_name, i]).selected
elif print_type == MTDefs.TYPE_CHECK:
value = 1 if get_node("DialogEdit/Panel/SpecificFields/%s/Option%d" % [node_name, i]).selected == 0 else 0
else:
value = get_node("DialogEdit/Panel/SpecificFields/%s/EditValue%d" % [node_name, i]).text
# Data type is not the same as print type
# data type is usually int, float or string, even if the print type is
# something else such as checks or day of week
# (as those are stored as integers)
match data_type:
TYPE_INT:
data.condition_values[i] = int(value)
TYPE_FLOAT:
data.condition_values[i] = float(value)
TYPE_STRING:
data.condition_values[i] = value
update_from_data()
dispose_dialog_edit()
func update_DialogEdit_contents(condition):
var fieldboxes = edit_specificlist.get_children()
for i in range(fieldboxes.size()):
if i == condition:
fieldboxes[i].show()
else:
fieldboxes[i].hide()
edit_btntip.tip_title = MTDefs.ConditionData[condition]["description"] #edit_condition_type.get_item_text(edit_condition_type.selected)
edit_btntip.tip_text = MTDefs.ConditionData[condition]["help"]

View File

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

View File

@@ -0,0 +1,61 @@
[gd_scene load_steps=5 format=3 uid="uid://bjmg67jkhsynh"]
[ext_resource type="Texture2D" uid="uid://kcw14ykn5tp" path="res://addons/madtalk/images/header_condition.png" id="1"]
[ext_resource type="Texture2D" uid="uid://b37ib00lc25o1" path="res://addons/madtalk/images/header_condition_arrow.png" id="2"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="3"]
[ext_resource type="Script" uid="uid://bkwtkyyvciuk0" path="res://addons/madtalk/components/DialogNodeItem_condition.gd" id="4"]
[node name="DialogNodeItem_condition" type="Control"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 3
anchors_preset = 0
offset_left = 16.0
offset_top = 130.0
offset_right = 284.0
offset_bottom = 164.0
script = ExtResource("4")
[node name="BG" type="TextureRect" parent="."]
layout_mode = 0
offset_top = 1.0
offset_right = 128.0
offset_bottom = 33.0
texture = ExtResource("1")
[node name="BGArrow" type="TextureRect" parent="."]
layout_mode = 0
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -96.0
offset_top = -12.0
offset_bottom = 12.0
texture = ExtResource("2")
[node name="ConditionLabel" type="Label" parent="."]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 29.0
offset_top = 13.0
offset_right = -38.0
offset_bottom = -3.0
theme_override_colors/font_color = Color(1, 0.501961, 0, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 12
text = "Condition "
horizontal_alignment = 2
clip_text = true
[node name="DragDropLine" type="ColorRect" parent="."]
visible = false
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_top = -2.0
offset_bottom = 2.0
grow_horizontal = 2
color = Color(1, 0, 0, 1)
[connection signal="gui_input" from="." to="." method="_on_DialogNodeItem_condition_gui_input"]

View File

@@ -0,0 +1,217 @@
@tool
extends Control
class_name DialogNodeItem_effect
signal remove_requested(requester)
signal move_up_requested(requester)
signal move_down_requested(requester)
signal drag_started(requester)
signal drag_ended(requester)
@export var data: Resource
enum PopupOptions {
Edit,
MoveUp,
MoveDown,
Remove
}
var edit_effect_type
var edit_specificlist
var edit_btntip
# names of the nodes holding the controls in edit box
const edit_specificlist_items = [
"ChangeSheet",
"SetVariable",
"AddVariable",
"RandomizeVariable",
"StampTime",
"SpendMinutes",
"SpendDays",
"SkipToTime",
"SkipToWeekday",
"WaitAnim",
"Custom",
]
@onready var effect_effectlabel = get_node("EffectLabel")
var template_DialogEdit: PackedScene = preload("res://addons/madtalk/components/popups/Effect_DialogEdit.tscn")
var dialog_edit: Window
var template_PopupMenu: PackedScene = preload("res://addons/madtalk/components/popups/DialogNodeItem_PopupMenu.tscn")
var popup_menu: PopupMenu
@onready var dragdrop_line := $DragDropLine
var sequence_node = null
func _ready():
if data:
set_data(data)
func set_data(new_data):
data = new_data
update_from_data()
func update_from_data():
if data:
var mtdefs = MTDefs.new()
effect_effectlabel.text = mtdefs.Effect_PrintShort(data.effect_type, data.effect_values)
#mtdefs.free()
func create_dialog_edit():
if not dialog_edit:
dialog_edit = template_DialogEdit.instantiate() as Window
add_child(dialog_edit)
dialog_edit.get_node("Panel/BtnEffectType").item_selected.connect(_on_DialogEdit_BtnEffectType_item_selected)
dialog_edit.get_node("Panel/BottomBar/BtnSave").pressed.connect(_on_DialogEdit_BtnSave_pressed)
dialog_edit.get_node("Panel/BottomBar/BtnCancel").pressed.connect(_on_DialogEdit_BtnCancel_pressed)
edit_effect_type = dialog_edit.get_node("Panel/BtnEffectType")
edit_specificlist = dialog_edit.get_node("Panel/SpecificFields")
edit_btntip = dialog_edit.get_node("Panel/BtnTip")
for item in edit_specificlist.get_children():
item.hide()
func dispose_dialog_edit():
if dialog_edit:
dialog_edit.queue_free()
dialog_edit = null
func create_popup_menu():
if not popup_menu:
popup_menu = template_PopupMenu.instantiate() as PopupMenu
add_child(popup_menu)
popup_menu.id_pressed.connect(_on_PopupMenu_id_pressed)
func dispose_popup_menu():
if popup_menu:
popup_menu.queue_free()
popup_menu = null
func _on_DialogNodeItem_effect_gui_input(event):
if (event is InputEventMouseButton):
if (event.pressed):
if (event.button_index == MOUSE_BUTTON_LEFT):
if event.double_click:
_on_PopupMenu_id_pressed(PopupOptions.Edit)
else:
drag_started.emit(self)
if (event.button_index == MOUSE_BUTTON_RIGHT):
var cursor_position = get_viewport().get_mouse_position() if get_viewport().gui_embed_subwindows else DisplayServer.mouse_get_position()
create_popup_menu()
popup_menu.popup(Rect2(cursor_position,Vector2(10,10)))
else:
if (event.button_index == MOUSE_BUTTON_LEFT):
drag_ended.emit(self)
func _on_PopupMenu_id_pressed(id):
dispose_popup_menu()
match id:
PopupOptions.Edit:
create_dialog_edit()
edit_effect_type.selected = data.effect_type
var values_size = data.effect_values.size()
# Nodes not commonly used so get_node is used directly for simplicity
# (They are only used here and when saving)
for j in range(edit_specificlist_items.size()):
var num_args = MTDefs.EffectData[j]["num_args"]
var node_name = edit_specificlist_items[j]
for i in range(num_args):
var data_type = MTDefs.EffectData[j]["data_types"][i]
var print_type = MTDefs.EffectData[j]["print_types"][i] if MTDefs.EffectData[j]["print_types"].size() > i else TYPE_STRING
var value = data.effect_values[i] if (values_size > i) else MTDefs.EffectData[j]["default"][i]
if print_type == MTDefs.TYPE_WEEKDAY:
var node = get_node_or_null("DialogEdit/Panel/SpecificFields/%s/Option%d" % [node_name, i])
if node:
value = int(value)
while value > 6:
value -= 7
while value < 0:
value += 7
node.select(int(value))
elif print_type != null:
var node = get_node_or_null("DialogEdit/Panel/SpecificFields/%s/EditValue%d" % [node_name, i])
if node:
node.text = str(value)
update_DialogEdit_contents(data.effect_type)
dialog_edit.popup_centered()
PopupOptions.MoveUp:
emit_signal("move_up_requested", self)
PopupOptions.MoveDown:
emit_signal("move_down_requested", self)
PopupOptions.Remove:
emit_signal("remove_requested", self)
func _on_DialogEdit_BtnEffectType_item_selected(index):
update_DialogEdit_contents(edit_effect_type.selected)
func _on_DialogEdit_BtnCancel_pressed():
dispose_dialog_edit()
func _on_DialogEdit_BtnSave_pressed():
data.effect_type = edit_effect_type.selected
var num_args = MTDefs.EffectData[data.effect_type]["num_args"]
var node_name = edit_specificlist_items[data.effect_type]
data.effect_values.resize(num_args)
for i in range(num_args):
var data_type = MTDefs.EffectData[data.effect_type]["data_types"][i]
var print_type = MTDefs.EffectData[data.effect_type]["print_types"][i] if MTDefs.EffectData[data.effect_type]["print_types"].size() > i else TYPE_STRING
var value
if print_type == MTDefs.TYPE_WEEKDAY:
value = get_node("DialogEdit/Panel/SpecificFields/%s/Option%d" % [node_name, i]).selected
else:
value = get_node("DialogEdit/Panel/SpecificFields/%s/EditValue%d" % [node_name, i]).text
match data_type:
TYPE_INT:
data.effect_values[i] = int(value)
TYPE_FLOAT:
data.effect_values[i] = float(value)
TYPE_STRING:
data.effect_values[i] = value
update_from_data()
dispose_dialog_edit()
func update_DialogEdit_contents(effect):
var fieldboxes = edit_specificlist.get_children()
for i in range(fieldboxes.size()):
if i == effect:
fieldboxes[i].show()
else:
fieldboxes[i].hide()
edit_btntip.tip_title = MTDefs.EffectData[effect]["description"]
edit_btntip.tip_text = MTDefs.EffectData[effect]["help"]

View File

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

View File

@@ -0,0 +1,48 @@
[gd_scene load_steps=4 format=3 uid="uid://vkj7uamlpxxp"]
[ext_resource type="Script" uid="uid://iqqxlumksl02" path="res://addons/madtalk/components/DialogNodeItem_effect.gd" id="1"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="8"]
[ext_resource type="Texture2D" uid="uid://cg463wmvppw0u" path="res://addons/madtalk/images/header_effect.png" id="14"]
[node name="DialogNodeItem_effect" type="Control"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 3
anchors_preset = 0
offset_left = 16.0
offset_top = 165.0
offset_right = 284.0
offset_bottom = 199.0
script = ExtResource("1")
[node name="BG" type="TextureRect" parent="."]
layout_mode = 0
offset_top = 1.0
offset_right = 128.0
offset_bottom = 33.0
texture = ExtResource("14")
[node name="EffectLabel" type="Label" parent="."]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 29.0
offset_top = 13.0
offset_right = -6.0
offset_bottom = -3.0
theme_override_colors/font_color = Color(0, 1, 1, 1)
theme_override_fonts/font = ExtResource("8")
theme_override_font_sizes/font_size = 12
text = "Effect"
clip_text = true
[node name="DragDropLine" type="ColorRect" parent="."]
visible = false
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_top = -2.0
offset_bottom = 2.0
grow_horizontal = 2
color = Color(1, 0, 0, 1)
[connection signal="gui_input" from="." to="." method="_on_DialogNodeItem_effect_gui_input"]

View File

@@ -0,0 +1,242 @@
@tool
extends Control
class_name DialogNodeItem_message
signal remove_requested(requester)
signal move_up_requested(requester)
signal move_down_requested(requester)
signal drag_started(requester)
signal drag_ended(requester)
@export var data: Resource
#@onready var popup_menu = get_node("PopupMenu")
#@onready var dialog_edit = get_node("DialogEdit")
var edit_speaker_id
var edit_speaker_var
var edit_voiceclip
var edit_message_editor
var edit_preview
var edit_previewtimer
var edit_previewbg
var edit_btn_hide_on_end
#@onready var dialog_voiceclip = get_node("VoiceClipDialog")
var template_VoiceClipDialog: PackedScene = preload("res://addons/madtalk/components/popups/Messages_VoiceClipDialog.tscn")
var dialog_voiceclip: FileDialog
var template_DialogEdit: PackedScene = preload("res://addons/madtalk/components/popups/Messages_DialogEdit.tscn")
var dialog_edit: Window
var template_PopupMenu: PackedScene = preload("res://addons/madtalk/components/popups/DialogNodeItem_PopupMenu.tscn")
var popup_menu: PopupMenu
enum PopupOptions {
Edit,
MoveUp,
MoveDown,
Remove
}
@onready var box_height_margins = size.y - get_node("Panel/MessageLabel").size.y
@onready var dragdrop_line := $DragDropLine
var sequence_node = null
var message_speakervarlabel = null
var message_speakerlabel = null
var message_voicelabel = null
var message_msglabel = null
var message_hideonendlabel = null
var message_locale_list = null
func _ready():
if data:
set_data(data)
func set_data(new_data):
data = new_data
message_speakerlabel = get_node("SpeakerNameLabel")
message_speakervarlabel = get_node("SpeakerVariantLabel")
message_voicelabel = get_node("VoiceFileLabel")
message_msglabel = get_node("Panel/MessageLabel")
message_hideonendlabel = get_node("HideOnEndLabel")
message_locale_list = get_node("LocalesLabel")
update_from_data()
func update_height():
if is_inside_tree():
custom_minimum_size.y = min(
box_height_margins + message_msglabel.get_content_height(),
120
)
func update_from_data():
if data:
message_speakerlabel.text = data.message_speaker_id
message_speakervarlabel.text = data.message_speaker_variant
message_voicelabel.text = data.message_voice_clip
if data.message_voice_clip_locales.size() > 0:
message_voicelabel.text += " (" + (",".join(data.message_voice_clip_locales.keys())) + ")"
if message_voicelabel.text.length() > 40:
message_voicelabel.text = "..." + message_voicelabel.text.right(40)
message_msglabel.text = data.message_text
message_hideonendlabel.visible = (data.message_hide_on_end != 0)
if data.message_text_locales.size() == 0:
message_locale_list.text = ""
else:
message_locale_list.text = ",".join(data.message_text_locales.keys())
var variant_title = get_node("SpeakerVarLabel")
variant_title.visible = (data.message_speaker_variant != "")
var panel = get_node("Panel")
if message_voicelabel.text != "":
panel.offset_top = 40
else:
panel.offset_top = 28
update_height()
func create_dialog_edit():
if not dialog_edit:
dialog_edit = template_DialogEdit.instantiate() as Window
add_child(dialog_edit)
dialog_edit.get_node("Panel/MessageEditor").tab_changed.connect(_on_DialogEdit_MessageEdit_text_changed)
dialog_edit.get_node("Panel/MessageEditor").voice_clip_dialog_requested.connect(_on_BtnSelectClip_pressed)
dialog_edit.get_node("Panel/MessageEditor/MessageEdit").text_changed.connect(_on_DialogEdit_MessageEdit_text_changed)
dialog_edit.get_node("Panel/BtnTextColor").color_changed.connect(_on_DialogEdit_BtnTextColor_color_changed)
dialog_edit.get_node("Panel/BtnBGColor").color_changed.connect(_on_DialogEdit_BtnBGColor_color_changed)
dialog_edit.get_node("Panel/PreviewBox/PreviewTimer").timeout.connect(_on_DialogEdit_PreviewTimer_timeout)
dialog_edit.get_node("Panel/BottomBar/BtnSave").pressed.connect(_on_DialogEdit_BtnSave_pressed)
dialog_edit.get_node("Panel/BottomBar/BtnCancel").pressed.connect(_on_DialogEdit_BtnCancel_pressed)
edit_speaker_id = dialog_edit.get_node("Panel/SpeakerEdit")
edit_speaker_var = dialog_edit.get_node("Panel/VariantEdit")
#edit_voiceclip = dialog_edit.get_node("Panel/VoiceEdit")
edit_message_editor = dialog_edit.get_node("Panel/MessageEditor")
edit_preview = dialog_edit.get_node("Panel/PreviewBox/PreviewLabel")
edit_previewtimer = dialog_edit.get_node("Panel/PreviewBox/PreviewTimer")
edit_previewbg = dialog_edit.get_node("Panel/PreviewBox")
edit_btn_hide_on_end = dialog_edit.get_node("Panel/BtnHideOnEnd")
func dispose_dialog_edit():
if dialog_edit:
dialog_edit.queue_free()
dialog_edit = null
func create_voice_clip_dialog():
if not dialog_voiceclip:
dialog_voiceclip = template_VoiceClipDialog.instantiate()
add_child(dialog_voiceclip)
dialog_voiceclip.file_selected.connect(_on_FileDialog_voiceclip_selected)
func dispose_voice_clip_dialog():
if dialog_voiceclip:
dialog_voiceclip.queue_free()
dialog_voiceclip = null
func create_popup_menu():
if not popup_menu:
popup_menu = template_PopupMenu.instantiate() as PopupMenu
add_child(popup_menu)
popup_menu.id_pressed.connect(_on_PopupMenu_id_pressed)
func dispose_popup_menu():
if popup_menu:
popup_menu.queue_free()
popup_menu = null
func _on_DialogNodeItem_gui_input(event):
if (event is InputEventMouseButton):
if (event.pressed):
if (event.button_index == MOUSE_BUTTON_LEFT):
if event.double_click:
_on_PopupMenu_id_pressed(PopupOptions.Edit)
else:
drag_started.emit(self)
if (event.button_index == MOUSE_BUTTON_RIGHT):
var cursor_position = get_viewport().get_mouse_position() if get_viewport().gui_embed_subwindows else DisplayServer.mouse_get_position()
create_popup_menu()
popup_menu.popup(Rect2(cursor_position,Vector2(10,10)))
else:
if (event.button_index == MOUSE_BUTTON_LEFT):
drag_ended.emit(self)
func _on_PopupMenu_id_pressed(id):
dispose_popup_menu() # Handles null gracefully
match id:
PopupOptions.Edit:
create_dialog_edit()
edit_speaker_id.text = data.message_speaker_id
edit_speaker_var.text = data.message_speaker_variant
edit_message_editor.setup(data.message_text, data.message_text_locales, data.message_voice_clip, data.message_voice_clip_locales)
edit_btn_hide_on_end.button_pressed = (data.message_hide_on_end != 0)
_on_DialogEdit_PreviewTimer_timeout()
dialog_edit.popup_centered()
PopupOptions.MoveUp:
emit_signal("move_up_requested", self)
PopupOptions.MoveDown:
emit_signal("move_down_requested", self)
PopupOptions.Remove:
emit_signal("remove_requested", self)
func _on_DialogEdit_BtnCancel_pressed():
dispose_dialog_edit()
func _on_DialogEdit_BtnSave_pressed():
data.message_speaker_id = edit_speaker_id.text
data.message_speaker_variant = edit_speaker_var.text
edit_message_editor.finalize_editor()
data.message_text = edit_message_editor.get_default_locale_message()
data.message_text_locales = edit_message_editor.get_locale_messages_without_default()
data.message_voice_clip = edit_message_editor.get_default_locale_voiceclip()
data.message_voice_clip_locales = edit_message_editor.get_locale_voiceclips_without_default()
data.message_hide_on_end = 1 if edit_btn_hide_on_end.button_pressed else 0
update_from_data()
dispose_dialog_edit()
func _on_DialogEdit_PreviewTimer_timeout():
edit_preview.text = edit_message_editor.message_edit.text
func _on_DialogEdit_MessageEdit_text_changed():
edit_previewtimer.start(1.0)
func _on_DialogEdit_BtnTextColor_color_changed(color):
edit_preview.set("theme_override_colors/default_color", color)
func _on_DialogEdit_BtnBGColor_color_changed(color):
edit_previewbg.color = color
func _on_BtnSelectClip_pressed():
create_voice_clip_dialog()
dialog_voiceclip.popup_centered()
func _on_FileDialog_voiceclip_selected(path):
edit_message_editor.set_voice_clip(path)
dispose_voice_clip_dialog()

View File

@@ -0,0 +1 @@
uid://338g851v1cl

View File

@@ -0,0 +1,232 @@
[gd_scene load_steps=12 format=3 uid="uid://sks6j6y53n1k"]
[ext_resource type="Script" uid="uid://338g851v1cl" path="res://addons/madtalk/components/DialogNodeItem_message.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://dgal43srcee1q" path="res://addons/madtalk/images/panel_bg.png" id="2"]
[ext_resource type="FontFile" uid="uid://bhcws34lw0ak5" path="res://addons/madtalk/fonts/FreeSans_tiny.tres" id="3"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_italic_small.tres" id="5"]
[ext_resource type="FontVariation" uid="uid://18mk4r2e01la" path="res://addons/madtalk/fonts/MessagePreview.tres" id="5_c4t4d"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bolditalic_small.tres" id="6"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="7"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/RichLabelPreviewStyle.tres" id="15"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSansBold_tiny.tres" id="17"]
[sub_resource type="StyleBoxFlat" id="1"]
bg_color = Color(0.741176, 0.741176, 0.741176, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.486275, 0.486275, 0.486275, 1)
[sub_resource type="FontVariation" id="FontVariation_wa622"]
[node name="DialogNodeItem" type="Control"]
custom_minimum_size = Vector2(0, 100)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1")
[node name="NinePatchRect" type="NinePatchRect" parent="."]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource("2")
patch_margin_left = 10
patch_margin_top = 10
patch_margin_right = 10
patch_margin_bottom = 10
[node name="TitleLine" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 8.0
offset_top = 14.0
offset_right = -8.0
offset_bottom = 15.0
grow_horizontal = 2
mouse_filter = 2
color = Color(0.282353, 0.258824, 0.301961, 1)
[node name="TitleLabel" type="Label" parent="."]
layout_mode = 0
offset_left = 4.0
offset_top = 1.0
offset_right = 49.0
offset_bottom = 20.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 9
text = "Message"
[node name="LocalesLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 63.0
offset_right = -6.0
offset_bottom = 16.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0, 0.192157, 0.223529, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 9
text = "de,en,es,jp,pt,ru"
horizontal_alignment = 2
[node name="SpeakerLabel" type="Label" parent="."]
layout_mode = 0
offset_left = 12.0
offset_top = 11.0
offset_right = 61.0
offset_bottom = 31.0
theme_override_colors/font_color = Color(0.2, 0.2, 0.2, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 10
text = "Speaker:"
[node name="SpeakerNameLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_right = 0.5
offset_left = 60.0
offset_top = 12.0
offset_right = 24.0
offset_bottom = 31.0
theme_override_colors/font_color = Color(0, 0.192157, 0.223529, 1)
theme_override_fonts/font = ExtResource("17")
theme_override_font_sizes/font_size = 12
text = "Speaker"
[node name="SpeakerVarLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = 32.0
offset_top = 11.0
offset_right = 81.0
offset_bottom = 31.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0.2, 0.2, 0.2, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 10
text = "Variant:"
[node name="SpeakerVariantLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.5
anchor_right = 1.0
offset_left = 70.0
offset_top = 9.5796
offset_right = -12.0
offset_bottom = 32.5796
theme_override_colors/font_color = Color(0, 0.192157, 0.223529, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 12
text = "Variant"
[node name="VoiceLabel" type="Label" parent="."]
layout_mode = 0
offset_left = 12.0
offset_top = 24.0
offset_right = 61.0
offset_bottom = 44.0
theme_override_colors/font_color = Color(0.2, 0.2, 0.2, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 10
text = "Voice clip:"
[node name="VoiceFileLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 60.0
offset_top = 24.0
offset_right = -16.0
offset_bottom = 44.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0.2, 0.373333, 0.4, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 10
text = "Speaker"
[node name="Panel" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 5.0
offset_top = 41.0
offset_right = -5.0
offset_bottom = -5.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_styles/panel = SubResource("1")
[node name="MessageLabel" type="RichTextLabel" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 2.0
offset_top = 2.0
offset_right = -2.0
offset_bottom = -2.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_colors/default_color = Color(0, 0, 0, 1)
theme_override_fonts/normal_font = ExtResource("5_c4t4d")
theme_override_fonts/italics_font = ExtResource("5")
theme_override_fonts/bold_italics_font = ExtResource("6")
theme_override_fonts/bold_font = ExtResource("7")
theme_override_font_sizes/bold_italics_font_size = 12
theme_override_font_sizes/italics_font_size = 10
theme_override_font_sizes/mono_font_size = 10
theme_override_font_sizes/normal_font_size = 10
theme_override_font_sizes/bold_font_size = 12
theme_override_styles/focus = ExtResource("15")
theme_override_styles/normal = ExtResource("15")
bbcode_enabled = true
text = "Lorem ipsum
more lore ipsum
Lorem ipsum for the whole family!"
[node name="HideOnEndLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -57.0
offset_top = -18.0
offset_right = -6.0
offset_bottom = 2.0
grow_horizontal = 0
grow_vertical = 0
theme_override_colors/font_color = Color(0.2, 0.2, 0.2, 1)
theme_override_fonts/font = SubResource("FontVariation_wa622")
theme_override_font_sizes/font_size = 9
text = "Hide after"
horizontal_alignment = 2
[node name="DragDropLine" type="ColorRect" parent="."]
visible = false
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_top = -2.0
offset_bottom = 2.0
grow_horizontal = 2
color = Color(1, 0, 0, 1)
[connection signal="gui_input" from="." to="." method="_on_DialogNodeItem_gui_input"]
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]

View File

@@ -0,0 +1,12 @@
@tool
extends Control
class_name DialogNodeItem_option
@export var text: String = "": set = text_set
func text_set(value: String) -> void:
text = value
get_node("OptionLabel").text = value
func set_conditional(is_conditional: bool) -> void:
get_node("Condition").visible = is_conditional

View File

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

View File

@@ -0,0 +1,47 @@
[gd_scene load_steps=5 format=3 uid="uid://y6s6jwiawub6"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="1"]
[ext_resource type="Texture2D" uid="uid://3tpmqrmfqg6t" path="res://addons/madtalk/images/header_option.png" id="2"]
[ext_resource type="Script" uid="uid://djr5ixsiysemo" path="res://addons/madtalk/components/DialogNodeItem_option.gd" id="3"]
[ext_resource type="Texture2D" uid="uid://7ohtlu4cvfph" path="res://addons/madtalk/images/header_option_condition.png" id="4"]
[node name="DialogNodeItem_option" type="Control"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 3
anchors_preset = 0
offset_left = 16.0
offset_top = 150.0
offset_right = 284.0
offset_bottom = 184.0
script = ExtResource("3")
[node name="BG" type="TextureRect" parent="."]
layout_mode = 0
offset_top = 1.0
offset_right = 128.0
offset_bottom = 33.0
texture = ExtResource("2")
[node name="OptionLabel" type="Label" parent="."]
auto_translate_mode = 2
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 29.0
offset_top = 14.0
offset_right = -2.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 12
[node name="Condition" type="TextureRect" parent="."]
visible = false
layout_mode = 0
offset_left = 9.0
offset_top = 18.0
offset_right = 21.0
offset_bottom = 30.0
texture = ExtResource("4")

View File

@@ -0,0 +1,36 @@
@tool
extends Control
const MIN_SIZE_CLOSED := 36
const MIN_SIZE_OPEN := 160
var connected_id = -1
var item_data = null # Reference, not a copy - DO NOT MODIFY IN THIS SCRIPT (use as if read-only)
@onready var cond_panel = $Condition
@onready var cond_op_button = $Condition/ButtonOperation
@onready var cond_auto_disable = $Condition/BtnOptionAutodisable
@onready var inactive_mode = $Condition/BtnOptionInactiveMode
func _ready():
cond_panel.visible = false
update_condition_visible()
func _on_BtnOptionCondition_pressed() -> void:
cond_panel.visible = not cond_panel.visible
update_condition_visible()
func update_condition_visible() -> void:
custom_minimum_size.y = MIN_SIZE_OPEN if cond_panel.visible else MIN_SIZE_CLOSED
size.y = custom_minimum_size.y
func select_operator(op_text: String) -> void:
for i in range(cond_op_button.get_item_count()):
if cond_op_button.get_item_text(i) == op_text:
cond_op_button.select(i)
return
cond_op_button.select(0)
func get_selected_operator() -> String:
return cond_op_button.get_item_text(cond_op_button.selected)

View File

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

View File

@@ -0,0 +1,305 @@
[gd_scene load_steps=11 format=3 uid="uid://c5mhhbui1jcfd"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="1"]
[ext_resource type="Texture2D" uid="uid://dgal43srcee1q" path="res://addons/madtalk/images/panel_bg.png" id="2"]
[ext_resource type="StyleBox" uid="uid://dk8cb0qbpag2d" path="res://addons/madtalk/components/resources/InputStyle_grey.tres" id="3"]
[ext_resource type="Texture2D" uid="uid://dxgulu8lvnwrr" path="res://addons/madtalk/images/icon_x.png" id="4"]
[ext_resource type="Texture2D" uid="uid://6iclvaqbm5dl" path="res://addons/madtalk/images/icon_up.png" id="5"]
[ext_resource type="Texture2D" uid="uid://c4xg8811uuoq6" path="res://addons/madtalk/images/icon_down.png" id="6"]
[ext_resource type="Script" uid="uid://h51781skrpvi" path="res://addons/madtalk/components/DialogNodeOptionsButton.gd" id="7"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans.tres" id="8"]
[ext_resource type="Texture2D" uid="uid://cxwd6i3apjou8" path="res://addons/madtalk/images/icon_opt_condition.png" id="9"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="9_4brdj"]
[node name="DialogNodeOptionsButton" type="Control"]
clip_contents = true
custom_minimum_size = Vector2(0, 160)
layout_mode = 3
anchors_preset = 0
offset_right = 486.0
offset_bottom = 36.0
script = ExtResource("7")
[node name="Panel" type="NinePatchRect" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 36.0
grow_horizontal = 2
texture = ExtResource("2")
patch_margin_left = 12
patch_margin_top = 12
patch_margin_right = 12
patch_margin_bottom = 12
[node name="ButtonTextEdit" type="LineEdit" parent="Panel"]
layout_mode = 0
anchor_right = 1.0
offset_left = 42.0
offset_top = 5.0
offset_right = -77.0
offset_bottom = 31.0
theme_override_colors/font_color = Color(0, 0.160784, 0.180392, 1)
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 12
theme_override_styles/focus = ExtResource("3")
theme_override_styles/normal = ExtResource("3")
placeholder_text = "Type button text here"
[node name="BtnUp" type="TextureButton" parent="Panel"]
modulate = Color(0.207843, 0.207843, 0.207843, 1)
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
offset_left = -73.0
offset_top = 9.0
offset_right = -57.0
offset_bottom = 25.0
texture_normal = ExtResource("5")
[node name="BtnDown" type="TextureButton" parent="Panel"]
modulate = Color(0.207843, 0.207843, 0.207843, 1)
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
offset_left = -53.0
offset_top = 10.0
offset_right = -37.0
offset_bottom = 26.0
texture_normal = ExtResource("6")
[node name="BtnRemove" type="TextureButton" parent="Panel"]
modulate = Color(0.207843, 0.207843, 0.207843, 1)
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
offset_left = -25.0
offset_top = 10.0
offset_right = -9.0
offset_bottom = 26.0
texture_normal = ExtResource("4")
[node name="Condition" type="NinePatchRect" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_top = 33.0
offset_bottom = 159.0
grow_horizontal = 2
texture = ExtResource("2")
region_rect = Rect2(0, 4, 128, 124)
patch_margin_left = 12
patch_margin_top = 12
patch_margin_right = 12
patch_margin_bottom = 12
[node name="Label" type="Label" parent="Condition"]
layout_mode = 0
offset_left = 8.0
offset_top = 1.0
offset_right = 148.0
offset_bottom = 16.0
theme_override_colors/font_color = Color(0.32, 0.32, 0.32, 1)
theme_override_fonts/font = ExtResource("9_4brdj")
theme_override_font_sizes/font_size = 11
text = "When is this option active?"
[node name="BtnOptionAutodisable" type="OptionButton" parent="Condition"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -297.0
offset_top = 53.0
offset_right = -17.0
offset_bottom = 81.0
grow_horizontal = 0
theme_override_colors/font_color = Color(0.195545, 0.195545, 0.195545, 1)
theme_override_fonts/font = ExtResource("8")
theme_override_font_sizes/font_size = 12
flat = true
selected = 0
item_count = 3
popup/item_0/text = "Do not auto-disable"
popup/item_0/id = 0
popup/item_1/text = "Auto-disable, reset when starting new dialog"
popup/item_1/id = 1
popup/item_2/text = "Auto-disable permanently"
popup/item_2/id = 2
metadata/_edit_group_ = true
[node name="Panel" type="Panel" parent="Condition/BtnOptionAutodisable"]
show_behind_parent = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_styles/panel = ExtResource("3")
[node name="Label5" type="Label" parent="Condition/BtnOptionAutodisable"]
layout_mode = 0
offset_left = -173.0
offset_top = -1.0
offset_right = -3.0
offset_bottom = 29.0
theme_override_colors/font_color = Color(0.32, 0.32, 0.32, 1)
theme_override_constants/line_spacing = -8
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 11
text = "Automatically disable after this
option is selected:"
vertical_alignment = 1
[node name="VariableEdit" type="LineEdit" parent="Condition"]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 118.0
offset_top = 21.0
offset_right = -225.0
offset_bottom = 48.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0, 0.160784, 0.180392, 1)
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 11
theme_override_styles/focus = ExtResource("3")
theme_override_styles/normal = ExtResource("3")
placeholder_text = "Type variable name here"
[node name="Label2" type="Label" parent="Condition/VariableEdit"]
layout_mode = 0
offset_left = -102.0
offset_top = -1.0
offset_right = -1.0
offset_bottom = 18.0
theme_override_colors/font_color = Color(0.32, 0.32, 0.32, 1)
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 11
text = "Variable condition:"
[node name="Label3" type="Label" parent="Condition/VariableEdit/Label2"]
layout_mode = 0
offset_top = 12.0
offset_right = 101.0
offset_bottom = 31.0
theme_override_colors/font_color = Color(0.32, 0.32, 0.32, 1)
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 9
text = "(leave blank for always)"
[node name="ButtonOperation" type="OptionButton" parent="Condition"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -219.0
offset_top = 20.0
offset_right = -168.0
offset_bottom = 48.0
grow_horizontal = 0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_fonts/font = ExtResource("8")
theme_override_font_sizes/font_size = 12
flat = true
selected = 0
item_count = 6
popup/item_0/text = "="
popup/item_0/id = 0
popup/item_1/text = "!="
popup/item_1/id = 1
popup/item_2/text = ">"
popup/item_2/id = 2
popup/item_3/text = ">="
popup/item_3/id = 3
popup/item_4/text = "<"
popup/item_4/id = 4
popup/item_5/text = "<="
popup/item_5/id = 5
[node name="ValueEdit" type="LineEdit" parent="Condition"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -166.0
offset_top = 21.0
offset_right = -17.0
offset_bottom = 48.0
grow_horizontal = 0
theme_override_colors/font_color = Color(0, 0.160784, 0.180392, 1)
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 11
theme_override_styles/focus = ExtResource("3")
theme_override_styles/normal = ExtResource("3")
placeholder_text = "Value or variable name"
[node name="BtnOptionInactiveMode" type="OptionButton" parent="Condition"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -297.0
offset_top = 90.0
offset_right = -17.0
offset_bottom = 118.0
grow_horizontal = 0
theme_override_colors/font_color = Color(0.195545, 0.195545, 0.195545, 1)
theme_override_fonts/font = ExtResource("8")
theme_override_font_sizes/font_size = 12
flat = true
selected = 0
item_count = 2
popup/item_0/text = "Show as a disabled item"
popup/item_0/id = 0
popup/item_1/text = "Hide the item entirely"
popup/item_1/id = 1
metadata/_edit_group_ = true
[node name="Panel" type="Panel" parent="Condition/BtnOptionInactiveMode"]
show_behind_parent = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_styles/panel = ExtResource("3")
[node name="Label4" type="Label" parent="Condition/BtnOptionInactiveMode"]
layout_mode = 0
offset_left = -174.0
offset_top = 7.0
offset_right = -11.0
offset_bottom = 22.0
theme_override_colors/font_color = Color(0.32, 0.32, 0.32, 1)
theme_override_fonts/font = ExtResource("9_4brdj")
theme_override_font_sizes/font_size = 11
text = "When this option is NOT active:"
[node name="SeparatorLine" type="ColorRect" parent="Condition"]
modulate = Color(1, 1, 1, 0.301961)
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 8.0
offset_top = 85.0
offset_right = -8.0
offset_bottom = 86.0
grow_horizontal = 2
mouse_filter = 2
color = Color(0.282353, 0.258824, 0.301961, 1)
[node name="BtnOptionCondition" type="Button" parent="."]
layout_mode = 0
offset_left = 7.0
offset_top = 6.0
offset_right = 35.0
offset_bottom = 28.0
icon = ExtResource("9")
flat = true
[connection signal="pressed" from="BtnOptionCondition" to="." method="_on_BtnOptionCondition_pressed"]

View File

@@ -0,0 +1,258 @@
@tool
extends Window
signal saved(source_dialog)
signal tab_changed
const DEFAULT_TAB_TITLE = "Default"
var button_template = preload("res://addons/madtalk/components/DialogNodeOptionsButton.tscn")
@onready var buttonlist = get_node("Panel/ScrollContainer/VBox")
@onready var locale_bar := $Panel/LocaleBar
@onready var panel_new_locale := $Panel/PanelNewLocale
@onready var locale_edit := $Panel/PanelNewLocale/LocaleEdit
var data_resource # holds reference to the node data
# This is a Dictonary of Dictionaries
# btn_temporary_locales {
# button_node: {
# "": "default text",
# "locale": "text",
# ...
# }
# }
var btn_temporary_locales: Dictionary = {}
var locale_list: Array = []
var current_locale := ""
var is_updating_tabs := false
func _ready() -> void:
pass
# Hides the close button
#get_close_button().hide()
func open(data: DialogNodeData) -> void:
is_updating_tabs = true
data_resource = data
btn_temporary_locales.clear()
locale_list.clear()
locale_list.append("")
# Remove previous items
var old_items = buttonlist.get_children()
for item in old_items:
buttonlist.remove_child(item)
item.queue_free()
# Add new items
for item in data.options:
add_item(item)
for locale in item.text_locales:
if not locale in locale_list:
locale_list.append(locale)
locale_bar.clear_tabs()
locale_bar.add_tab(DEFAULT_TAB_TITLE)
for tab_name in locale_list:
if tab_name != "":
locale_bar.add_tab(tab_name)
locale_bar.current_tab = 0
current_locale = ""
is_updating_tabs = false
popup_centered()
func add_item(item_data: DialogNodeOptionData) -> void:
var new_btn = button_template.instantiate()
new_btn.item_data = item_data # Should be used as read-only there
buttonlist.add_child(new_btn)
btn_temporary_locales[new_btn] = {
"": item_data.text
}
for locale in item_data.text_locales:
btn_temporary_locales[new_btn][locale] = item_data.text_locales[locale]
new_btn.connected_id = item_data.connected_to_id
new_btn.get_node("Panel/ButtonTextEdit").text = item_data.text
new_btn.get_node("Condition").visible = item_data.is_conditional
new_btn.update_condition_visible()
if item_data.is_conditional:
new_btn.get_node("Condition/VariableEdit").text = item_data.condition_variable
new_btn.get_node("Condition/ValueEdit").text = item_data.condition_value
new_btn.select_operator(item_data.condition_operator)
new_btn.get_node("Condition/BtnOptionAutodisable").selected = int(item_data.autodisable_mode)
new_btn.get_node("Condition/BtnOptionInactiveMode").selected = int(item_data.inactive_mode)
else:
new_btn.get_node("Condition/VariableEdit").text = ""
new_btn.get_node("Condition/ValueEdit").text = ""
new_btn.select_operator("=")
new_btn.get_node("Condition/BtnOptionAutodisable").selected = 0
new_btn.get_node("Condition/BtnOptionInactiveMode").selected = 0
new_btn.get_node("Panel/BtnUp").connect("pressed", Callable(self, "_on_Button_BtnUp").bind(new_btn))
new_btn.get_node("Panel/BtnDown").connect("pressed", Callable(self, "_on_Button_BtnDown").bind(new_btn))
new_btn.get_node("Panel/BtnRemove").connect("pressed", Callable(self, "_on_Button_BtnRemove").bind(new_btn))
func load_items_from_locale(locale: String):
var items = buttonlist.get_children()
for btn_item in items:
if btn_item in btn_temporary_locales:
var locale_data = btn_temporary_locales[btn_item]
if locale in locale_data:
btn_item.get_node("Panel/ButtonTextEdit").text = locale_data[locale]
else:
btn_item.get_node("Panel/ButtonTextEdit").text = ""
else:
btn_item.get_node("Panel/ButtonTextEdit").text = ""
func store_items_into_locale(locale: String):
var items = buttonlist.get_children()
for btn_item in items:
if not btn_item in btn_temporary_locales:
btn_temporary_locales[btn_item] = {"":""}
btn_temporary_locales[btn_item][locale] = btn_item.get_node("Panel/ButtonTextEdit").text
func get_used_locales() -> Array:
# Operates on temporary storage
var used_locales := [""] # default can never be erased
var items = buttonlist.get_children()
for btn_item in items:
if btn_item in btn_temporary_locales:
for locale in btn_temporary_locales[btn_item]:
if btn_temporary_locales[btn_item][locale] != "":
if not locale in used_locales:
used_locales.append(locale)
return used_locales
func save_button_locale_data():
store_items_into_locale(current_locale)
locale_list.clear()
var used_locales: Array = get_used_locales()
var items = buttonlist.get_children()
for btn_item in items:
if btn_item in btn_temporary_locales:
btn_item.item_data.text = btn_temporary_locales[btn_item][""]
var locale_dict := {}
for locale in btn_temporary_locales[btn_item]:
if locale in used_locales:
locale_dict[locale] = btn_temporary_locales[btn_item][locale]
if not locale in locale_list:
locale_list.append(locale)
btn_item.item_data.text_locales = locale_dict
func _on_BtnAdd_pressed() -> void:
add_item(DialogNodeOptionData.new())
func _on_Button_BtnUp(button) -> void:
var current_order = button.get_index()
if current_order > 0:
buttonlist.move_child(button, current_order-1)
func _on_Button_BtnDown(button) -> void:
var current_order = button.get_index()
buttonlist.move_child(button, current_order+1)
func _on_Button_BtnRemove(button) -> void:
button.hide()
button.queue_free()
func _on_BtnCancel_pressed() -> void:
hide()
queue_free()
func _on_BtnSave_pressed() -> void:
save_button_locale_data() # Updates locale_list
var new_items = buttonlist.get_children()
# If we reduced the number of options, delete unused resources
#if new_items.size() < data_resource.options.size():
#data_resource.options.resize(new_items.size())
#
# # If we increased the number of options, create new resources
#while new_items.size() > data_resource.options.size():
#data_resource.options.append( DialogNodeOptionData.new() )
data_resource.options = []
# Set resource to new data
for i in range(new_items.size()):
var item: DialogNodeOptionData = new_items[i].item_data
item.connected_to_id = new_items[i].connected_id
item.is_conditional = new_items[i].get_node("Condition").visible
if item.is_conditional:
item.condition_variable = new_items[i].get_node("Condition/VariableEdit").text
item.condition_operator = new_items[i].get_selected_operator()
item.condition_value = new_items[i].get_node("Condition/ValueEdit").text
item.autodisable_mode = new_items[i].get_node("Condition/BtnOptionAutodisable").selected
item.inactive_mode = new_items[i].get_node("Condition/BtnOptionInactiveMode").selected
else:
item.condition_variable = ""
item.condition_operator = "="
item.condition_value = ""
item.autodisable_mode = item.AutodisableModes.NEVER
item.inactive_mode = item.InactiveMode.DISABLED
data_resource.options.append(item)
emit_signal("saved", self)
hide()
queue_free()
func _on_locale_bar_tab_changed(tab: int) -> void:
if is_updating_tabs:
return
store_items_into_locale(current_locale)
current_locale = locale_bar.get_tab_title(tab)
if current_locale == DEFAULT_TAB_TITLE:
current_locale = ""
load_items_from_locale(current_locale)
tab_changed.emit()
func _on_btn_locale_new_pressed() -> void:
locale_edit.text = ""
panel_new_locale.show()
func _on_btn_locale_new_cancel_pressed() -> void:
panel_new_locale.hide()
func _on_btn_locale_new_confirm_pressed() -> void:
var new_locale = locale_edit.text
if not new_locale in locale_list:
locale_list.append(new_locale)
locale_bar.add_tab(new_locale)
panel_new_locale.hide()

View File

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

View File

@@ -0,0 +1,252 @@
[gd_scene load_steps=8 format=3 uid="uid://bwa38eqib7e25"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="1"]
[ext_resource type="Script" uid="uid://dg6brgs82d11e" path="res://addons/madtalk/components/DialogNode_DialogOptions.gd" id="2"]
[ext_resource type="Texture2D" uid="uid://xt0wkyrex027" path="res://addons/madtalk/images/icon_plus.png" id="3"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="4_lns1l"]
[ext_resource type="PackedScene" uid="uid://c5mhhbui1jcfd" path="res://addons/madtalk/components/DialogNodeOptionsButton.tscn" id="5"]
[ext_resource type="PackedScene" uid="uid://dyepkyvo6sodg" path="res://addons/madtalk/components/BtnTip.tscn" id="5_jiu2v"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="7_m44w6"]
[node name="DialogOptions" type="Window"]
initial_position = 2
size = Vector2i(650, 450)
transient = true
exclusive = true
popup_window = true
script = ExtResource("2")
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
[node name="HelpLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 16.0
offset_top = 11.0
offset_right = 616.0
offset_bottom = 91.0
theme_override_constants/line_spacing = 0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 12
text = "Options below will be presented as buttons in the end of this dialog sequence.
If option buttons are not desired, just leave this list empty. A dialog sequence without buttons will have a default leaving output. If the default leaving output is not connected, the dialog will end."
autowrap_mode = 3
[node name="TitleLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 16.0
offset_top = 105.55
offset_right = 57.0
offset_bottom = 125.55
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 12
text = "Buttons"
[node name="BtnAdd" type="TextureButton" parent="Panel"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -38.875
offset_top = 105.55
offset_right = -22.875
offset_bottom = 121.55
grow_horizontal = 0
texture_normal = ExtResource("3")
[node name="LabelLocale" type="Label" parent="Panel"]
modulate = Color(1, 1, 1, 0.501961)
layout_mode = 0
offset_left = 24.13
offset_top = 136.205
offset_right = 63.13
offset_bottom = 159.205
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 10
text = "Locale:"
[node name="LocaleBar" type="TabBar" parent="Panel"]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 62.095
offset_top = 134.045
offset_right = -123.905
offset_bottom = 156.045
grow_horizontal = 2
focus_mode = 0
theme_override_font_sizes/font_size = 10
current_tab = 0
tab_count = 1
tab_0/title = "Default"
tab_0/tooltip = "Default locale. Will also be used if the user's locale is not in this list."
[node name="BtnLocaleNew" type="Button" parent="Panel"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -122.0
offset_top = 133.92
offset_right = -44.0
offset_bottom = 155.92
grow_horizontal = 0
focus_mode = 0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 10
theme_override_styles/normal = ExtResource("4_lns1l")
text = "New Locale"
[node name="TipLocale" parent="Panel" instance=ExtResource("5_jiu2v")]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -36.0627
offset_top = 130.965
offset_right = -8.06274
offset_bottom = 154.965
grow_horizontal = 0
tip_title = "Message Locale"
tip_text = "You can optionally specify different option titles for internationalization. MadTalk does not use Godot's CSV system for localizing dialog messages because it would be very confusing to edit dialog diagrams seeing message IDs instead of actual text, and also allows exporting and importing dialog text from other formats.
Creating locale versions is optional and is done PER ITEM. The default tab should be the main language of your game, and other tabs are alternate (localized) translations. If a specific option title doesn't have a version for the locale the player is using, the default one is used. You don't have to create any lists of available locales anywhere. To remove a locale tab from a message, simply erase the text under all items in that tab and save.
To configure which locale MadTalk will use, see the help message for localizing message items."
[node name="ScrollContainer" type="ScrollContainer" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 12.0
offset_top = 156.0
offset_right = -12.0
offset_bottom = -39.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBox" type="VBoxContainer" parent="Panel/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="DialogNodeOptionsButton2" parent="Panel/ScrollContainer/VBox" instance=ExtResource("5")]
custom_minimum_size = Vector2(0, 36)
layout_mode = 2
[node name="PanelNewLocale" type="Panel" parent="Panel"]
visible = false
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -211.0
offset_top = 133.855
offset_right = -4.0
offset_bottom = 228.855
grow_horizontal = 0
theme_override_styles/panel = ExtResource("7_m44w6")
[node name="Label" type="Label" parent="Panel/PanelNewLocale"]
layout_mode = 0
offset_left = 7.0
offset_top = 2.0
offset_right = 76.0
offset_bottom = 25.0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 12
text = "Create new locale for this menu:"
[node name="LocaleEdit" type="LineEdit" parent="Panel/PanelNewLocale"]
layout_mode = 1
anchors_preset = -1
anchor_right = 0.5
offset_left = 8.0
offset_top = 24.0
offset_right = 93.5
offset_bottom = 55.0
theme_override_colors/font_placeholder_color = Color(0.299547, 0.299547, 0.299547, 1)
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 14
placeholder_text = "locale (e.g. \"es\")"
[node name="BtnLocaleNewConfirm" type="Button" parent="Panel/PanelNewLocale"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -152.0
offset_top = 63.0
offset_right = -82.0
offset_bottom = 87.0
grow_horizontal = 0
focus_mode = 0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 12
theme_override_styles/normal = ExtResource("4_lns1l")
text = "Create"
[node name="BtnLocaleNewCancel" type="Button" parent="Panel/PanelNewLocale"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -77.0
offset_top = 63.0
offset_right = -7.0
offset_bottom = 87.0
grow_horizontal = 0
focus_mode = 0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 12
theme_override_styles/normal = ExtResource("4_lns1l")
text = "Cancel"
[node name="BottomBar" type="Control" parent="."]
layout_mode = 3
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -35.0
offset_bottom = -11.0
grow_horizontal = 2
grow_vertical = 0
[node name="BtnSave" type="Button" parent="BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -100.5
offset_top = -10.0
offset_right = -59.5
offset_bottom = 10.0
focus_mode = 0
text = "OK"
[node name="BtnCancel" type="Button" parent="BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 53.0
offset_top = -10.0
offset_right = 107.0
offset_bottom = 10.0
focus_mode = 0
text = "Cancel"
[connection signal="pressed" from="Panel/BtnAdd" to="." method="_on_BtnAdd_pressed"]
[connection signal="tab_changed" from="Panel/LocaleBar" to="." method="_on_locale_bar_tab_changed"]
[connection signal="pressed" from="Panel/BtnLocaleNew" to="." method="_on_btn_locale_new_pressed"]
[connection signal="pressed" from="Panel/PanelNewLocale/BtnLocaleNewConfirm" to="." method="_on_btn_locale_new_confirm_pressed"]
[connection signal="pressed" from="Panel/PanelNewLocale/BtnLocaleNewCancel" to="." method="_on_btn_locale_new_cancel_pressed"]
[connection signal="pressed" from="BottomBar/BtnSave" to="." method="_on_BtnSave_pressed"]
[connection signal="pressed" from="BottomBar/BtnCancel" to="." method="_on_BtnCancel_pressed"]

View File

@@ -0,0 +1,29 @@
[gd_scene load_steps=0 format=3 uid="uid://b7ojwbheitven"]
[node name="DialogSearchInspectorSheetIDField" type="Control"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ValueLineEdit" type="LineEdit" parent="."]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -26.0
text = "dfgsdfgs"
placeholder_text = "MadTalk Sheet ID"
editable = false
caret_blink = true
caret_blink_interval = 0.5
[node name="BtnSearch" type="Button" parent="."]
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -24.0
text = "..."

View File

@@ -0,0 +1,102 @@
[gd_scene load_steps=6 format=3 uid="uid://yyd1a2x4mmop"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="2"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="4"]
[ext_resource type="PackedScene" uid="uid://bxm7bq8a3137t" path="res://addons/madtalk/components/DialogSearchSheetItem.tscn" id="5"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/SheetItemStyle.tres" id="7"]
[sub_resource type="StyleBoxFlat" id="1"]
bg_color = Color(0.186, 0.172, 0.2, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.06, 0.06, 0.06, 1)
border_blend = true
[node name="DialogSearchSheet" type="Window"]
initial_position = 2
size = Vector2i(600, 400)
visible = false
transient = true
exclusive = true
popup_window = true
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_styles/panel = ExtResource("4")
[node name="SearchEdit" type="LineEdit" parent="Panel"]
layout_mode = 0
anchor_right = 1.0
offset_left = 8.0
offset_top = 5.0
offset_right = -8.0
offset_bottom = 29.0
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 12
theme_override_styles/normal = ExtResource("7")
placeholder_text = "Search ID or description"
[node name="IDLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 12.0
offset_top = 36.0
offset_right = 69.0
offset_bottom = 50.0
theme_override_font_sizes/font_size = 12
text = "Sheet ID"
[node name="DescLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 144.0
offset_top = 36.0
offset_right = 253.0
offset_bottom = 50.0
theme_override_font_sizes/font_size = 12
text = "Short description"
[node name="SearchResultsPanel" type="Panel" parent="Panel"]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 52.0
offset_right = -8.0
offset_bottom = -30.0
theme_override_styles/panel = SubResource("1")
[node name="Scroll" type="ScrollContainer" parent="Panel/SearchResultsPanel"]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="VBoxResults" type="VBoxContainer" parent="Panel/SearchResultsPanel/Scroll"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="DialogSearchSheetItem" parent="Panel/SearchResultsPanel/Scroll/VBoxResults" instance=ExtResource("5")]
layout_mode = 2
[node name="BottomBar" type="Control" parent="Panel"]
anchors_preset = 0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -24.0
[node name="BtnCancel" type="Button" parent="Panel/BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -27.0
offset_top = -10.0
offset_right = 27.0
offset_bottom = 10.0
focus_mode = 0
text = "Cancel"

View File

@@ -0,0 +1,63 @@
[gd_scene load_steps=6 format=3 uid="uid://bxm7bq8a3137t"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="1"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="2"]
[ext_resource type="FontFile" uid="uid://bhcws34lw0ak5" path="res://addons/madtalk/fonts/FreeSans_tiny.tres" id="3"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="4"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/SheetItemStyle.tres" id="5"]
[node name="DialogSearchSheetItem" type="Panel"]
custom_minimum_size = Vector2(0, 48)
offset_right = 437.0
offset_bottom = 48.0
theme_override_styles/panel = ExtResource("5")
[node name="SheetIDLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 9
anchor_bottom = 1.0
offset_left = 9.0
offset_top = 10.0
offset_right = 172.0
offset_bottom = -10.0
grow_vertical = 2
theme_override_colors/font_color = Color(0.470588, 0.898039, 1, 1)
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 12
text = "sheet_id"
vertical_alignment = 1
autowrap_mode = 1
clip_text = true
[node name="DescLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 180.0
offset_top = 2.0
offset_right = -50.0
offset_bottom = -3.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/font_color = Color(0.772549, 0.772549, 0.772549, 1)
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 12
text = "Simple decription text"
vertical_alignment = 1
autowrap_mode = 3
clip_text = true
[node name="BtnPick" type="Button" parent="."]
layout_mode = 0
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -45.0
offset_top = -11.0
offset_right = -3.0
offset_bottom = 9.0
theme_override_fonts/font = ExtResource("1")
theme_override_styles/normal = ExtResource("4")
text = "Pick"

View File

@@ -0,0 +1,62 @@
[gd_scene load_steps=6 format=3 uid="uid://c1a8yn1guaowt"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/SheetItemStyle.tres" id="1_w11ta"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="2_oqjov"]
[ext_resource type="FontFile" uid="uid://bhcws34lw0ak5" path="res://addons/madtalk/fonts/FreeSans_tiny.tres" id="3_rgkct"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="4_i0ry5"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="5_en1rw"]
[node name="ExportSheetListItem" type="Panel"]
custom_minimum_size = Vector2(0, 48)
theme_override_styles/panel = ExtResource("1_w11ta")
[node name="SheetIDLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 9
anchor_bottom = 1.0
offset_left = 39.0
offset_top = 10.0
offset_right = 241.0
offset_bottom = -10.0
grow_vertical = 2
theme_override_colors/font_color = Color(0.470588, 0.898039, 1, 1)
theme_override_fonts/font = ExtResource("2_oqjov")
theme_override_font_sizes/font_size = 12
text = "sheet_id"
vertical_alignment = 1
autowrap_mode = 1
clip_text = true
[node name="DescLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 250.0
offset_top = 2.0
offset_right = -10.0
offset_bottom = -3.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/font_color = Color(0.772549, 0.772549, 0.772549, 1)
theme_override_fonts/font = ExtResource("3_rgkct")
theme_override_font_sizes/font_size = 12
text = "Simple decription text"
vertical_alignment = 1
autowrap_mode = 3
clip_text = true
[node name="BtnSelect" type="CheckBox" parent="."]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 8.0
offset_top = -15.0
offset_right = 28.0
offset_bottom = 16.0
grow_vertical = 2
theme_override_fonts/font = ExtResource("4_i0ry5")
theme_override_styles/normal = ExtResource("5_en1rw")
flat = true
icon_alignment = 2

View File

@@ -0,0 +1,26 @@
@tool
extends Panel
@export var SizeClosed: int = 24
@export var SizeOpen: int = 200
@onready var content = get_node_or_null("Content")
func _ready():
size.y = SizeClosed
if content:
content.hide()
func _on_BtnTogglePanel_pressed():
if (size.y == SizeClosed):
# Open:
size.y = SizeOpen
if content:
content.show()
else:
# Close:
size.y = SizeClosed
if content:
content.hide()

View File

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

View File

@@ -0,0 +1,40 @@
[gd_scene load_steps=5 format=3 uid="uid://cx148tfhw6ida"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="1_0agko"]
[ext_resource type="Script" uid="uid://brqywa4kaelfg" path="res://addons/madtalk/components/ImportBar.gd" id="2_vberv"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="2_xeiq2"]
[ext_resource type="Texture2D" uid="uid://c4xg8811uuoq6" path="res://addons/madtalk/images/icon_down.png" id="3_vberv"]
[node name="ImportBar" type="Panel"]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -424.0
offset_top = 16.0
offset_right = -224.0
offset_bottom = 216.0
grow_horizontal = 0
theme_override_styles/panel = ExtResource("1_0agko")
script = ExtResource("2_vberv")
[node name="TitleLabel" type="Label" parent="."]
layout_mode = 0
offset_left = 3.0
offset_right = 177.0
offset_bottom = 20.0
theme_override_fonts/font = ExtResource("2_xeiq2")
theme_override_font_sizes/font_size = 12
text = "Import / Export"
[node name="BtnTogglePanel" type="TextureButton" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -24.0
offset_bottom = 24.0
grow_horizontal = 0
texture_normal = ExtResource("3_vberv")
stretch_mode = 3
[connection signal="pressed" from="BtnTogglePanel" to="." method="_on_BtnTogglePanel_pressed"]

View File

@@ -0,0 +1,34 @@
@tool
class_name MadTalkImportExport
extends Node
const IMP_EXP_PATH := "res://addons/madtalk/importers/"
var importers_list := {}
var exporters_list := {}
func refresh_list_importers():
importers_list.clear()
exporters_list.clear()
var dir = DirAccess.open(IMP_EXP_PATH)
if dir:
dir.list_dir_begin()
var file_name = dir.get_next()
while file_name != "":
if (not dir.current_is_dir()) and (file_name.ends_with(".gd")):
var full_path: String = IMP_EXP_PATH + file_name
var script_instance = load(full_path).new()
if file_name.begins_with("imp_"):
importers_list[full_path] = script_instance.name
elif file_name.begins_with("exp_"):
exporters_list[full_path] = script_instance.name
else:
pass # Subdirs are ignored
file_name = dir.get_next()
else:
print("Error refreshing importers/exporters")

View File

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

View File

@@ -0,0 +1,18 @@
extends EditorInspectorPlugin
func can_handle(object):
# We don't know the class of the node since it will be defined by user
# so we just accept anything
return true
func parse_property(object, type, path, hint, hint_text, usage):
# This component is used in String fields starting with "madtalk_sheet_id"
if (type == TYPE_STRING) and (path.begins_with("madtalk_sheet_id")):
# Register *an instance* of the custom property editor that we'll define next.
add_property_editor(path, InspectorPluginSheetIDFieldItem.new())
# We return `true` to notify the inspector that we'll be handling
# this property, so it doesn't need to parse other plugins
# (including built-in ones) for an appropriate editor.
return true
else:
return false

View File

@@ -0,0 +1 @@
uid://61pqdj3pwedn

View File

@@ -0,0 +1,102 @@
extends EditorProperty
class_name InspectorPluginSheetIDFieldItem
signal sheet_selected(sheet_id)
var search_box_template = preload("res://addons/madtalk/components/DialogSearchSheet.tscn")
var search_item_template = preload("res://addons/madtalk/components/DialogSearchSheetItem.tscn")
var property_editor_object = preload("res://addons/madtalk/components/DialogSearchInspectorSheetIDField.tscn").instantiate()
var dialog_data : Resource = preload("res://addons/madtalk/runtime/madtalk_data.tres")
var updating = false
func _init():
add_child(property_editor_object)
# To remember focus when selected back:
add_focusable(property_editor_object.get_node("ValueLineEdit"))
property_editor_object.get_node("ValueLineEdit").connect("text_changed", Callable(self, "_on_text_changed"))
property_editor_object.get_node("BtnSearch").connect("pressed", Callable(self, "_on_search_requested"))
func _on_text_changed(text):
if (updating):
return
emit_changed(get_edited_property(), text)
func update_property():
var new_text = get_edited_object()[get_edited_property()]
updating = true
property_editor_object.get_node("ValueLineEdit").set_text(new_text)
updating = false
func _on_search_requested():
var text = get_edited_object()[get_edited_property()]
var new_search_box = set_search_window(text)
new_search_box.popup_centered()
search(text, new_search_box)
var result = await self.sheet_selected
if result and (result is String):
updating = true
property_editor_object.get_node("ValueLineEdit").set_text(result)
emit_changed(get_edited_property(), result)
updating = false
func set_search_window(text):
var new_search_box = search_box_template.instantiate()
add_child(new_search_box)
new_search_box.get_node("Panel/BottomBar/BtnCancel").connect("pressed", Callable(self, "_on_BtnCancel_pressed").bind(new_search_box))
new_search_box.get_node("Panel/SearchEdit").connect("text_changed", Callable(self, "search").bind(new_search_box))
new_search_box.get_node("Panel/SearchEdit").text = text
return new_search_box
func add_item(sheet_id, window_object):
if not sheet_id in dialog_data.sheets:
return
if not window_object:
return
var new_item = search_item_template.instantiate()
window_object.get_node("Panel/SearchResultsPanel/Scroll/VBoxResults").add_child(new_item)
new_item.get_node("SheetIDLabel").text = sheet_id
new_item.get_node("DescLabel").text = dialog_data.sheets[sheet_id].sheet_description
new_item.get_node("BtnPick").connect("pressed", Callable(self, "_on_SheetItem_pick").bind(sheet_id, window_object))
func _on_SheetItem_pick(sheet_id, window_object):
if not window_object:
return
window_object.hide()
emit_signal("sheet_selected", sheet_id)
window_object.queue_free()
func _on_BtnCancel_pressed(window_object):
if not window_object:
return
window_object.hide()
emit_signal("sheet_selected", null)
window_object.queue_free()
func search(search_term, window_object):
var vbox_results = window_object.get_node("Panel/SearchResultsPanel/Scroll/VBoxResults")
var old_items = vbox_results.get_children()
for item in old_items:
vbox_results.remove_child(item)
item.queue_free()
for this_sheet_id in dialog_data.sheets:
var desc = dialog_data.sheets[this_sheet_id].sheet_description
# If there is no search, or search shows up in eiter id or description:
if (search_term == "") or (search_term.is_subsequence_ofi(this_sheet_id)) or (search_term.is_subsequence_ofi(desc)):
add_item(this_sheet_id, window_object)

View File

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

View File

@@ -0,0 +1,461 @@
@tool
# This file is used for global defintions used across the MadTalk plugin
class_name MTDefs
extends RefCounted
const WeekdayNames = {
0: "Sunday",
1: "Monday",
2: "Tuesday",
3: "Wednesday",
4: "Thursday",
5: "Friday",
6: "Saturday"
}
const WeekdayNamesShort = {
0: "Sun",
1: "Mon",
2: "Tue",
3: "Wed",
4: "Thu",
5: "Fri",
6: "Sat"
}
const MonthNames = {
1: "January",
2: "February",
3: "March",
4: "April",
5: "May",
6: "June",
7: "July",
8: "August",
9: "September",
10: "October",
11: "November",
12: "December"
}
const MonthNamesShort = {
1: "Jan",
2: "Feb",
3: "Mar",
4: "Apr",
5: "May",
6: "Jun",
7: "Jul",
8: "Aug",
9: "Sep",
10: "Oct",
11: "Nov",
12: "Dec"
}
func zero_pad(value, num_digits) -> String:
var res = str(value)
while res.length() < num_digits:
res = "0"+res
return res
func zero_unpad(value) -> String:
if float(value) == 0:
return "0"
if float(value) == 1:
return "1"
if value.find('.') > -1:
value = value.rstrip('0')
if value.ends_with('.'):
value += "0"
value = value.lstrip('0')
return value
func ShowFloat(value) -> String:
return zero_unpad("%f" % float(value))
################################################################################
# CONDITIONS
# ==============================================================================
enum ConditionTypes { # arguments:
Random, # float percentage of change (0.0 - 100.0)
VarBool, # "var_name", bool value
VarAtLeast, # "var_name", float min value (inclusive)
VarUnder, # "var_name", float max value (not inclusive)
VarString, # "var_name", string value (comparison)
Time, # time min, time max (inclusive, format "HH:mm")
DayOfWeek, # day min, day max (inclusive, int 0-6)
DayOfMonth, # day min, day max (inclusive, int 1-31)
Date, # date min, date max (inclusive, format DD/MM)
ElapsedFromVar, # variable name, number of minutes
Custom # custom ID, newline separated string list
# (converted to array of string in callback)
}
const TYPE_RANDOM = 1000
const TYPE_WEEKDAY = 1001
const TYPE_CHECK = 1002
const TYPE_STRING_SHORT = 1003
const ConditionData = {
ConditionTypes.Random: {
"num_args": 1,
"default": [50],
"data_types": [TYPE_FLOAT],
"print_types": [TYPE_RANDOM],
"description": "Random",
"print_text": "Random chance %s %%",
"print_short": "Random %s%%",
"print_short_fail": "Random %s%%",
"help": "Percentage of chance to continue (branching when fails), as float.\n\nExample: for 30% chance, use 30.0 (and not 0.3)."
},
ConditionTypes.VarBool: {
"num_args": 2,
"default": ["", 1],
"data_types": [TYPE_STRING, TYPE_INT],
"print_types": [TYPE_STRING, TYPE_CHECK],
"description": "Variable check",
"print_text": "Variable [color=yellow]%s[/color] is [color=aqua]%s[/color]",
"print_short": "%s",
"print_short_fail": "%s",
"help": "Continues if variable is equal to a target boolean value, branching otherwise."
},
ConditionTypes.VarAtLeast: {
"num_args": 2,
"default": ["", 0],
"data_types": [TYPE_STRING, TYPE_FLOAT],
"print_types": [TYPE_STRING, TYPE_FLOAT],
"description": "Variable at least",
"print_text": "Variable [color=yellow]%s[/color] >= [color=aqua]%s[/color]",
"print_short": "%s >= %s",
"print_short_fail": "%s < %s",
"help": "Continues if variable is equal or larger than a target value (as float), branching otherwise."
},
ConditionTypes.VarUnder: {
"num_args": 2,
"default": ["", 0],
"data_types": [TYPE_STRING, TYPE_FLOAT],
"print_types": [TYPE_STRING, TYPE_FLOAT],
"description": "Variable under",
"print_text": "Variable [color=yellow]%s[/color] < [color=aqua]%s[/color]",
"print_short": "%s < %s",
"print_short_fail": "%s >= %s",
"help": "Continues if variable is lower (and not equal) than a target value (as float), branching otherwise."
},
ConditionTypes.VarString: {
"num_args": 2,
"default": ["",""],
"data_types": [TYPE_STRING, TYPE_STRING],
"print_types": [TYPE_STRING, TYPE_STRING],
"description": "Variable equals",
"print_text": "Variable [color=yellow]%s[/color] equals \"[color=aqua]%s[/color]\"",
"print_short": "%s = \"%s\"",
"print_short_fail": "%s != \"%s\"",
"help": "Continues if a variable contains an exact string (case sensitive), branching otherwise."
},
ConditionTypes.Time: {
"num_args": 2,
"default": ["07:00","08:00"],
"data_types": [TYPE_STRING, TYPE_STRING],
"print_types": [TYPE_STRING, TYPE_STRING],
"description": "Time range",
"print_text": "Time between \"[color=blue]%s[/color]\" and [color=blue]%s[/color]",
"print_short": "Time [%s - %s]",
"print_short_fail": "Time not [%s - %s]",
"help": "Continues if current in-game time is within a given range (inclusive), branching otherwise. Format is \"HH:mm\".\n\nExample, for an event valid in range [6 PM, 7 PM) (that is, including 6PM, not including 7 PM), use:\"18:00\" and \"18:59\"."
},
ConditionTypes.DayOfWeek: {
"num_args": 2,
"default": [1,5],
"data_types": [TYPE_INT, TYPE_INT],
"print_types": [TYPE_WEEKDAY, TYPE_WEEKDAY],
"description": "Day of Week Range",
"print_text": "Day of Week between \"[color=blue]%s[/color]\" and [color=blue]%s[/color]",
"print_short": "W.Day [%s - %s]",
"print_short_fail": "W.Day not [%s - %s]",
"help": "Continues if current in-game day of week is within a given range (inclusive), branching otherwise." # Week starts on 0 = Sunday and goes to 6 = Saturday, but repeats indefinitely (2 = 9 = 16 = Tuesday). Week days:\n0 = Sunday\n1 = Monday\n2 = Tuesday\n3 = Wednesday\n4 = Thursday\n5 = Friday\n6 = Saturday\n7 = Also Sunday\n\nExample, for an event valid in week days, use:\n1\n5\n\nFor an event valid from Friday to Tuesday, use:\n5\n9"
},
ConditionTypes.DayOfMonth: {
"num_args": 2,
"default": [1,1],
"data_types": [TYPE_INT, TYPE_INT],
"print_types": [TYPE_INT, TYPE_INT],
"description": "Day of Month Range",
"print_text": "Day of Month between \"[color=blue]%s[/color]\" and [color=blue]%s[/color]",
"print_short": "Day [%s - %s]",
"print_short_fail": "Day not [%s - %s]",
"help": "Continues if current in-game day of month is within a given range (inclusive), branching otherwise."
},
ConditionTypes.Date: {
"num_args": 2,
"default": ["01/01","01/01"],
"data_types": [TYPE_STRING, TYPE_STRING],
"print_types": [TYPE_STRING, TYPE_STRING],
"description": "Date range",
"print_text": "Date between \"[color=blue]%s[/color]\" and [color=blue]%s[/color]",
"print_short": "Date [%s - %s]",
"print_short_fail": "Date not [%s - %s]",
"help": "Continues if current in-game date is within a given range (inclusive), branching otherwise. Does not include the year, which means the range is valid in any year of in-game date.\n\nFormat \"DD/MM\". Example, for an event taking place between 25 Feb and 02 Mar (inclusive), use \"25/02\" and \"02/03\""
},
ConditionTypes.ElapsedFromVar: {
"num_args": 2,
"default": [0, ""],
"data_types": [TYPE_FLOAT, TYPE_STRING],
"print_types": [TYPE_FLOAT, TYPE_STRING],
"description": "Minutes elapsed since variable",
"print_text": "Elapsed [color=blue]%s[/color] minutes after time stamped in variable [color=yellow]%s[/color]",
"print_short": "%s mins after var %s",
"print_short_fail": "Until %s mins after var %s",
"help": "Continues if current in-game time is equal or later than a given number of minutes, when compared to a variable, branching otherwise. Used in conjunction with timestamping effects.",
},
ConditionTypes.Custom: {
"num_args": 2,
"default": ["",""],
"data_types": [TYPE_STRING, TYPE_STRING],
"print_types": [TYPE_STRING],
"description": "Custom condition",
"print_text": "Custom condition [color=yellow]%s[/color] successful",
"print_short": "%s successful",
"print_short_fail": "%s fails",
"help": "Continues if a custom condition (implemented in user code) evaluates as true, branching otherwise.\n\nA custom ID is passed to the callback (to be used as condition type, e.g. \"combat\", \"inventory\", \"char\", or anything representable with a single string), as well as a list of strings separated here by line breaks (to be used as general purpose fixed data, e.g. item id, monster id, etc). The list of strings will be passed to the callback as Array of Strings.\n\nThe callback is whatever is connected to the \"evaluate_custom_condition\" signal in the MadTalk node. If more than one method is connected, only the first one is used.",
}
}
func Condition_PrintFail(condition: int, values: Array) -> String:
var text_items = []
# Bool condition is an exception
if condition == ConditionTypes.VarBool:
# Bool has 2 arguments: variable name and a boolean value represented as
# float (where anything non-zero is true)
# however the boolean value is not printed. Instead the word "not" is
# prepended. Hence the separated logic
if (values[1] == 0):
# A successful check is false, therefore the fail message is true
text_items.append(values[0])
else:
# A successful check is true, therefore the fail message is false
text_items.append("not "+values[0])
else:
var types = ConditionData[condition]["print_types"]
for i in range(types.size()):
match types[i]:
TYPE_RANDOM:
text_items.append(str(100.0 - values[i]))
TYPE_INT:
text_items.append(str(values[i]))
TYPE_FLOAT:
text_items.append(ShowFloat(values[i]))
TYPE_WEEKDAY:
var wday = values[i]
while wday > 6:
wday -= 7
text_items.append(WeekdayNamesShort[wday])
TYPE_STRING:
text_items.append(values[i])
return ConditionData[condition]["print_short_fail"] % text_items
################################################################################
# EFFECTS
# ==============================================================================
enum EffectTypes { # arguments:
ChangeSheet, # "sheet_id" sequence_id=0
SetVariable, # "var_name", value
AddVariable, # "var_name" value
RandomizeVariable, # "var_name", value_min, value_max
StampTime, # "var_name"
SpendMinutes, # value_minutes
SpendDays, # value_days
SkipToTime, # value_time
SkipToWeekDay, # value_weekday
WaitAnim, # Animation name
Custom # "effect_id", newline separated string list
# (converted to array of string in callback)
}
const EffectData = {
EffectTypes.ChangeSheet: {
"num_args": 2,
"default": ["",0],
"data_types": [TYPE_STRING, TYPE_INT],
"print_types": [TYPE_STRING, TYPE_INT],
"description": "Change Sheet",
"print_text": "Change dialog to sheet \"%s\", sequence ID %s",
"print_short": "Sheet %s (ID %s)",
"help": "Abandons this dialog (items in this sequence below this effect are not executed) and runs dialog in another sheet.\n\nDefault starting point is ID 0, but a custom ID can be set instead."
},
EffectTypes.SetVariable: {
"num_args": 2,
"default": ["",0.0],
"data_types": [TYPE_STRING, TYPE_FLOAT],
"print_types": [TYPE_STRING, TYPE_FLOAT],
"description": "Set Variable",
"print_text": "Set the variable %s to the value %s",
"print_short": "Set %s = %s",
"help": "Sets the internal variable to a predefined value. If you want to use it in true/false checks, use zero for false, any other number for true.\n\nThis variable is stored inside MadTalk subsystem, and is not a GDScript variable. (It can be accessed from GDScript if required.)"
},
EffectTypes.AddVariable: {
"num_args": 2,
"default": ["",0.0],
"data_types": [TYPE_STRING, TYPE_FLOAT],
"print_types": [TYPE_STRING, TYPE_FLOAT],
"description": "Add Value to Variable",
"print_text": "Add to the variable %s a value of %s",
"print_short": "To %s, add %s",
"help": "Adds to the internal variable a given value.\n\nThis can be used to make counters (e.g. how many times the player has spoken to this NPC), to subtract money (e.g. in shops) using negative values, etc.\n\nThis variable is stored inside MadTalk subsystem, and is not a GDScript variable. (It can be accessed from GDScript if required.)"
},
EffectTypes.RandomizeVariable: {
"num_args": 3,
"default": ["",0.0, 1.0],
"data_types": [TYPE_STRING, TYPE_FLOAT, TYPE_FLOAT],
"print_types": [TYPE_STRING, TYPE_FLOAT, TYPE_FLOAT],
"description": "Randomizes Variable",
"print_text": "Set the variable %s to a random value between %s and %s",
"print_short": "Set %s = rand(%s, %s)",
"help": "Sets the internal variable to a random value, withing the given range (inclusive).\n\nThis can be used to generate random scenarios which will remain the same during the gameplay until randomized again (unlike a random condition, which is randomized again every time the sequence runs and the result is not accessible anywhere else).\n\nThis variable is stored inside MadTalk subsystem, and is not a GDScript variable. (It can be accessed from GDScript if required.)"
},
EffectTypes.StampTime: {
"num_args": 1,
"default": [""],
"data_types": [TYPE_STRING],
"print_types": [TYPE_STRING],
"description": "Stamp Current Time to Variable",
"print_text": "Set the variable %s to current timestamp",
"print_short": "Var %s = timestamp",
"help": "Stores the current in-game timestamp into the internal variable.\n\nThis should be used in conjunction with the timestamp condition to make dialog behavior dependent on a time window since this effect (e.g. a branch is only accessible during some minutes after talking to some NPC).\n\nThis variable is stored inside MadTalk subsystem as number of in-game seconds elapsed since start of gameplay, and is not a GDScript variable. (It can be accessed from GDScript if required.)"
},
EffectTypes.SpendMinutes: {
"num_args": 1,
"default": [0],
"data_types": [TYPE_FLOAT],
"print_types": [TYPE_FLOAT],
"description": "Advance Minutes in In-Game Time",
"print_text": "Add %s minutes to current in-game time",
"print_short": "Spend %s minutes",
"help": "Adds the specified number of minutes to the in-game time variable. Use this in conjunction with time-checking conditions to cause events to only happen in certain time windows (e.g. a shop keeper only sells during the day on business days)."
},
EffectTypes.SpendDays: {
"num_args": 1,
"default": [0],
"data_types": [TYPE_FLOAT],
"print_types": [TYPE_FLOAT],
"description": "Advance Days in In-Game Time",
"print_text": "Add %s days to current in-game time",
"print_short": "Spend %s day(s)",
"help": "Adds the specified number of days to the in-game time variable. Use this in conjunction with time-checking conditions to cause events to only happen in certain date ranges (e.g. an event is only available during weekends)."
},
EffectTypes.SkipToTime: {
"num_args": 1,
"default": ["07:00"],
"data_types": [TYPE_STRING],
"print_types": [TYPE_STRING],
"description": "Skip until a certain time",
"print_text": "Advances time until in-game time is %s",
"print_short": "Skip to %s",
"help": "Spends time until the next time the in-game time is at the specified value (in 24h format, e.g. \"07:00\").\n\nExample: if current in-game time is Wed 18:35, an effect to skip to \"07:00\" will spend time until the in-game time is at Thu 07:00.",
},
EffectTypes.SkipToWeekDay: {
"num_args": 1,
"default": [0],
"data_types": [TYPE_INT],
"print_types": [TYPE_WEEKDAY],
"description": "Skip time until a certain weekday",
"print_text": "Advances time until in-game weekday is %s midnight",
"print_short": "Skip to %s 00:00",
"help": "Spends time until the next day the in-game time is at the specified value. Time will be set to midnight (00:00) at the beginning of the given day."
},
EffectTypes.WaitAnim: {
"num_args": 1,
"default": [""],
"data_types": [TYPE_STRING],
"print_types": [TYPE_STRING],
"description": "Play and wait for an animation",
"print_text": "Play animation \"%s\" and wait for it to finish",
"print_short": "Play \"%s\"",
"help": "Plays the specified animation in the AnimationPlayer set in the MadTalk node, and holds the dialog until it completes."
},
EffectTypes.Custom: {
"num_args": 2,
"default": ["",""],
"data_types": [TYPE_STRING, TYPE_STRING],
"print_types": [TYPE_STRING, TYPE_STRING_SHORT],
"description": "Custom Effect",
"print_text": "Custom effect [color=yellow]%s[/color] (data: %s)",
"print_short": "%s (%s)",
"help": "Calls a custom effect (implemented in user code).\n\nA custom ID is passed to the callback (to be used as effect type, e.g. \"give_item\", \"teleport_player\", \"game_over\", or anything representable with a single string), as well as a list of strings separated here by line breaks (to be used as general purpose fixed data, e.g. item id, room id, etc). The list of strings will be passed to the callback as Array of Strings.\n\nThe callback is whatever is connected to the \"activate_custom_effect\" signal in the MadTalk node. If more than one method is connected, only the first one is used."
}
}
func Effect_PrintShort(effect: int, values: Array) -> String:
var text_items = []
var types = EffectData[effect]["print_types"]
for i in range(types.size()):
match types[i]:
TYPE_RANDOM:
text_items.append(str(100.0 - values[i]))
TYPE_INT:
text_items.append(str(values[i]))
TYPE_FLOAT:
text_items.append(ShowFloat(values[i]))
TYPE_WEEKDAY:
var wday = values[i]
while wday > 6:
wday -= 7
text_items.append(WeekdayNamesShort[wday])
TYPE_STRING:
text_items.append(values[i])
TYPE_STRING_SHORT:
var text = values[i].replace("\n", " ")
if text.length() > 20:
text = text.left(17) + "..."
text_items.append(text)
return EffectData[effect]["print_short"] % text_items
func debug_resource(res: Resource, indent = ""):
if res == null:
return
var list = res.get_property_list()
print(indent+"> %s - %s" % [str(res),str(res.resource_path)])
for item in list:
match item.type:
TYPE_INT:
print(indent+" %s = %s" % [str(item.name), str(res[item.name])])
TYPE_STRING:
if not item.name in ["resource_name","resource_path"]:
print(indent+" %s = \"%s\"" % [str(item.name), str(res[item.name])])
TYPE_ARRAY:
print(indent+" %s:" % str(item.name))
for a_item in res[item.name]:
#print(" %s" % str(a_item))
debug_resource(a_item, indent+" ")
TYPE_DICTIONARY:
print(indent+" %s:" % str(item.name))
for a_item in res[item.name]:
print(" [%s]:" % str(a_item))
debug_resource(res[item.name][a_item], indent+" ")

View File

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

View File

@@ -0,0 +1,157 @@
@tool
extends Window
var mt_ie := MadTalkImportExport.new()
var dialog_data: DialogData
var current_sheet_id: String = ""
var template_ExportSheetListItem := preload("res://addons/madtalk/components/Export_SheetListItem.tscn")
@onready var panel_options := $PanelOptions
@onready var panel_sheets := $PanelSheets
@onready var panel_output := $PanelOutput
@onready var btn_exporter := $PanelOptions/BtnExporter
@onready var exporter_desc := $PanelOptions/ExporterDesc
@onready var panel_locales := $PanelOptions/LocalesPanel
@onready var locales_edit := $PanelOptions/LocalesPanel/LocalesEdit
@onready var output_edit := $PanelOutput/OutputEdit
@onready var label_sheets := $PanelOptions/LabelSheets
@onready var sheet_list := $PanelSheets/SheetScroll/VBox
var export_sheets := []
func setup(data: DialogData, sheet_id: String):
dialog_data = data
current_sheet_id = sheet_id
export_sheets = [sheet_id]
update_exported_sheets()
mt_ie.refresh_list_importers()
# mt_ie.exporters_list = { "absolute path to .gd": "Friendly Name", }
btn_exporter.clear()
for path in mt_ie.exporters_list:
btn_exporter.add_item(mt_ie.exporters_list[path])
btn_exporter.select(-1)
panel_options.show()
panel_sheets.hide()
panel_output.hide()
func set_current_sheet(sheet: String, reset_export_sheet: bool = false):
current_sheet_id = sheet
if reset_export_sheet:
export_sheets = [current_sheet_id]
update_exported_sheets()
func _on_btn_close_pressed() -> void:
hide()
# ------------------------------------------
func extract_locales() -> Array:
var a := Array(locales_edit.text.split("\n"))
var result := []
for i in range(a.size()):
var locale: String = a[i].strip_edges()
if locale.length() > 0:
result.append(locale)
return result
func export():
if (not dialog_data) or (btn_exporter.selected < 0) or (btn_exporter.selected >= mt_ie.exporters_list.size()):
print("MadTalk exporter error")
return
var exporter_script = mt_ie.exporters_list.keys()[ btn_exporter.selected ]
var exporter = load(exporter_script).new()
var locales: Array = extract_locales() if panel_locales.visible else []
var result := ""
for sheet_id: String in export_sheets:
if (not sheet_id in dialog_data.sheets):
continue
if result.length() > 0:
result += "\n\n"
result += exporter.export(dialog_data.sheets[sheet_id], locales)
output_edit.text = result
panel_options.hide()
panel_sheets.hide()
panel_output.show()
output_edit.select_all()
output_edit.grab_focus()
func refresh_export_sheet_list():
for child in sheet_list.get_children():
child.queue_free()
for sheet_id in dialog_data.sheets:
var sheet_data: DialogSheetData = dialog_data.sheets[sheet_id]
var new_item := template_ExportSheetListItem.instantiate()
sheet_list.add_child(new_item)
new_item.get_node("SheetIDLabel").text = sheet_id
new_item.get_node("DescLabel").text = sheet_data.sheet_description
new_item.get_node("BtnSelect").button_pressed = (sheet_id in export_sheets)
func update_exported_sheets(load_from_list: bool = false):
if load_from_list:
export_sheets.clear()
for item in sheet_list.get_children():
if item.get_node("BtnSelect").button_pressed:
export_sheets.append(item.get_node("SheetIDLabel").text)
var s := ""
for sheet_id in export_sheets:
s += "[color=#ffcc55][b]%s[/b][/color]\n" % sheet_id
label_sheets.text = s
func _on_btn_exporter_item_selected(index: int) -> void:
if (btn_exporter.selected < 0) or (btn_exporter.selected >= mt_ie.exporters_list.size()):
print("MadTalk exporter error")
return
var exporter_script = mt_ie.exporters_list.keys()[ btn_exporter.selected ]
var exporter = load(exporter_script).new()
exporter_desc.text = exporter.description
func _on_btn_force_locales_toggled(toggled_on: bool) -> void:
panel_locales.visible = toggled_on
func _on_btn_back_pressed() -> void:
panel_output.hide()
panel_sheets.hide()
panel_options.show()
func _on_btn_export_pressed() -> void:
export()
func _on_btn_manage_sheets_pressed() -> void:
refresh_export_sheet_list()
panel_options.hide()
panel_sheets.show()
panel_output.hide()
func _on_sheets_to_export_btn_ok_pressed() -> void:
update_exported_sheets(true)
panel_options.show()
panel_sheets.hide()
panel_output.hide()

View File

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

View File

@@ -0,0 +1,315 @@
[gd_scene load_steps=5 format=3 uid="uid://difhfxods7ra3"]
[ext_resource type="Script" uid="uid://bokaxoyjm2ddg" path="res://addons/madtalk/components/MainEditor_DialogExport.gd" id="1_0m3dk"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="1_gyveq"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="2_0m3dk"]
[ext_resource type="PackedScene" uid="uid://c1a8yn1guaowt" path="res://addons/madtalk/components/Export_SheetListItem.tscn" id="4_4xg1u"]
[node name="DialogExport" type="Window"]
auto_translate_mode = 1
title = "Export Dialog Sheet"
position = Vector2i(0, 36)
size = Vector2i(700, 500)
transient = true
exclusive = true
popup_window = true
script = ExtResource("1_0m3dk")
[node name="PanelOptions" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = ExtResource("1_gyveq")
[node name="BottomBar" type="Control" parent="PanelOptions"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -36.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 0
[node name="BtnClose" type="Button" parent="PanelOptions/BottomBar"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -28.0
offset_top = -13.5
offset_right = 28.0
offset_bottom = 13.5
grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
theme_override_styles/focus = ExtResource("2_0m3dk")
theme_override_styles/hover = ExtResource("2_0m3dk")
theme_override_styles/normal = ExtResource("2_0m3dk")
text = "Close"
[node name="BtnExporter" type="OptionButton" parent="PanelOptions"]
layout_mode = 0
offset_left = 16.0
offset_top = 32.0
offset_right = 276.0
offset_bottom = 52.0
[node name="Label" type="Label" parent="PanelOptions/BtnExporter"]
layout_mode = 0
offset_top = -22.0
offset_right = 87.0
offset_bottom = -5.0
theme_override_font_sizes/font_size = 12
text = "Export Format:"
[node name="CaptionSheets" type="Label" parent="PanelOptions"]
layout_mode = 0
offset_left = 16.0
offset_top = 68.0
offset_right = 274.0
offset_bottom = 85.0
theme_override_font_sizes/font_size = 12
text = "Sheets to export:"
[node name="BtnManageSheets" type="Button" parent="PanelOptions/CaptionSheets"]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -32.0
offset_top = -11.5
offset_bottom = 15.5
grow_horizontal = 0
grow_vertical = 2
focus_mode = 0
theme_override_styles/focus = ExtResource("2_0m3dk")
theme_override_styles/hover = ExtResource("2_0m3dk")
theme_override_styles/normal = ExtResource("2_0m3dk")
text = "..."
[node name="LabelSheets" type="RichTextLabel" parent="PanelOptions"]
layout_mode = 0
offset_left = 16.0
offset_top = 90.0
offset_right = 276.0
offset_bottom = 212.0
theme_override_font_sizes/bold_italics_font_size = 12
theme_override_font_sizes/italics_font_size = 12
theme_override_font_sizes/mono_font_size = 12
theme_override_font_sizes/normal_font_size = 12
theme_override_font_sizes/bold_font_size = 12
bbcode_enabled = true
text = "sheet name"
[node name="ExporterDesc" type="RichTextLabel" parent="PanelOptions"]
layout_mode = 0
offset_left = 308.0
offset_top = 24.0
offset_right = 687.0
offset_bottom = 435.0
bbcode_enabled = true
[node name="BtnForceLocales" type="CheckButton" parent="PanelOptions"]
layout_mode = 0
offset_left = 21.0
offset_top = 232.0
offset_right = 281.0
offset_bottom = 257.0
theme_override_font_sizes/font_size = 12
text = "Force Locales"
[node name="LocalesPanel" type="Control" parent="PanelOptions"]
visible = false
anchors_preset = 0
offset_left = 21.0
offset_top = 263.0
offset_right = 281.0
offset_bottom = 455.0
[node name="Label" type="Label" parent="PanelOptions/LocalesPanel"]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 71.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0.617455, 0.617455, 0.617455, 1)
theme_override_font_sizes/font_size = 10
text = "Messages will include only and exactly the locales listed below. If there is no content for them yet, a blank line will be included. (This is meant to be sent to translators, so they fill the blank items.)"
autowrap_mode = 3
[node name="Label2" type="Label" parent="PanelOptions/LocalesPanel"]
layout_mode = 1
offset_left = 8.0
offset_top = 83.0
offset_right = 128.0
offset_bottom = 97.0
theme_override_colors/font_color = Color(0.617455, 0.617455, 0.617455, 1)
theme_override_font_sizes/font_size = 10
text = "Enter one locale per line."
horizontal_alignment = 1
[node name="LocalesEdit" type="TextEdit" parent="PanelOptions/LocalesPanel"]
layout_mode = 0
offset_left = 8.0
offset_top = 103.0
offset_right = 248.0
offset_bottom = 180.0
theme_override_colors/font_placeholder_color = Color(1, 1, 1, 0.184314)
theme_override_font_sizes/font_size = 12
placeholder_text = "es
pt
jp"
[node name="BtnExport" type="Button" parent="PanelOptions"]
layout_mode = 1
offset_left = 485.0
offset_top = 466.0
offset_right = 685.0
offset_bottom = 493.0
focus_mode = 0
theme_override_styles/focus = ExtResource("2_0m3dk")
theme_override_styles/hover = ExtResource("2_0m3dk")
theme_override_styles/normal = ExtResource("2_0m3dk")
text = "Export"
[node name="PanelSheets" type="Panel" parent="."]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = ExtResource("1_gyveq")
[node name="BottomBar" type="Control" parent="PanelSheets"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -36.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 0
[node name="BtnOk" type="Button" parent="PanelSheets/BottomBar"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -28.0
offset_top = -13.5
offset_right = 28.0
offset_bottom = 13.5
grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
theme_override_styles/focus = ExtResource("2_0m3dk")
theme_override_styles/hover = ExtResource("2_0m3dk")
theme_override_styles/normal = ExtResource("2_0m3dk")
text = "OK"
[node name="Label" type="Label" parent="PanelSheets"]
layout_mode = 0
offset_left = 20.0
offset_top = 12.0
offset_right = 152.0
offset_bottom = 35.0
text = "Sheets to export:"
[node name="SheetScroll" type="ScrollContainer" parent="PanelSheets"]
layout_mode = 0
offset_left = 23.0
offset_top = 53.0
offset_right = 678.0
offset_bottom = 443.0
[node name="VBox" type="VBoxContainer" parent="PanelSheets/SheetScroll"]
layout_mode = 2
size_flags_horizontal = 3
[node name="ExportSheetListItem" parent="PanelSheets/SheetScroll/VBox" instance=ExtResource("4_4xg1u")]
layout_mode = 2
[node name="PanelOutput" type="Panel" parent="."]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = ExtResource("1_gyveq")
[node name="BottomBar" type="Control" parent="PanelOutput"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -36.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 0
[node name="BtnBack" type="Button" parent="PanelOutput/BottomBar"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -28.0
offset_top = -13.5
offset_right = 28.0
offset_bottom = 13.5
grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
theme_override_styles/focus = ExtResource("2_0m3dk")
theme_override_styles/hover = ExtResource("2_0m3dk")
theme_override_styles/normal = ExtResource("2_0m3dk")
text = "Back"
[node name="OutputEdit" type="TextEdit" parent="PanelOutput"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 34.0
offset_bottom = -38.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/font_size = 12
editable = false
emoji_menu_enabled = false
deselect_on_focus_loss_enabled = false
drag_and_drop_selection_enabled = false
middle_mouse_paste_enabled = false
draw_tabs = true
draw_spaces = true
[node name="Label" type="Label" parent="PanelOutput"]
layout_mode = 0
offset_left = 4.0
offset_top = 4.0
offset_right = 136.0
offset_bottom = 27.0
text = "Exported output:"
[connection signal="pressed" from="PanelOptions/BottomBar/BtnClose" to="." method="_on_btn_close_pressed"]
[connection signal="item_selected" from="PanelOptions/BtnExporter" to="." method="_on_btn_exporter_item_selected"]
[connection signal="pressed" from="PanelOptions/CaptionSheets/BtnManageSheets" to="." method="_on_btn_manage_sheets_pressed"]
[connection signal="toggled" from="PanelOptions/BtnForceLocales" to="." method="_on_btn_force_locales_toggled"]
[connection signal="pressed" from="PanelOptions/BtnExport" to="." method="_on_btn_export_pressed"]
[connection signal="pressed" from="PanelSheets/BottomBar/BtnOk" to="." method="_on_sheets_to_export_btn_ok_pressed"]
[connection signal="pressed" from="PanelOutput/BottomBar/BtnBack" to="." method="_on_btn_back_pressed"]

View File

@@ -0,0 +1,760 @@
@tool
extends Window
signal import_executed(destination_sheet: String) # destination_sheet = "" when not collapsing
var mt_ie := MadTalkImportExport.new()
var dialog_data: DialogData
var current_sheet_id: String = ""
var template_CheckBoxLocale := preload("res://addons/madtalk/components/CheckBoxLocale.tscn")
@onready var panel_input := $PanelInput
@onready var panel_options := $PanelOptions
@onready var btn_importer := $PanelInput/BtnImporter
@onready var input_edit := $PanelInput/InputEdit
@onready var importer_desc := $PanelInput/ImporterDesc
@onready var import_summary := $PanelOptions/ImportSummary
@onready var btn_destination := $PanelOptions/BtnDestination
@onready var label_sheets := $PanelOptions/BtnDestination/LabelSheets
@onready var locale_listbox := $PanelOptions/LocaleListScroll/LocaleList
var prepared_data := {}
var resource_map := {}
var sheet_info := {}
func setup(data: DialogData, sheet_id: String):
dialog_data = data
current_sheet_id = sheet_id
mt_ie.refresh_list_importers()
# mt_ie.importers_list = { "absolute path to .gd": "Friendly Name", }
btn_importer.clear()
for path in mt_ie.importers_list:
btn_importer.add_item(mt_ie.importers_list[path])
btn_importer.select(-1)
resource_map.clear()
sheet_info.clear()
input_edit.text = ""
panel_input.show()
panel_options.hide()
func set_current_sheet(sheet: String):
current_sheet_id = sheet
update_resource_map()
func reset_and_show():
panel_input.show()
panel_options.hide()
popup_centered()
func update_resource_map(extra_sheets: Array = []):
resource_map.clear()
sheet_info.clear()
if (not dialog_data):
return
var sheet_list := [current_sheet_id]
sheet_list.append_array(extra_sheets)
for sheet_id in sheet_list:
if sheet_id in dialog_data.sheets:
var sheet_data = dialog_data.sheets[sheet_id]
resource_map[sheet_id] = {}
sheet_info[sheet_id] = {}
for dialog_node: DialogNodeData in sheet_data.nodes:
resource_map[sheet_id][dialog_node.resource_scene_unique_id] = dialog_node
sheet_info[sheet_id][dialog_node.resource_scene_unique_id] = {
"type": "sequence",
"sequence_id": dialog_node.sequence_id
}
for item_index in range(dialog_node.items.size()):
var dialog_item: DialogNodeItemData = dialog_node.items[item_index]
if dialog_item.item_type == DialogNodeItemData.ItemTypes.Message:
resource_map[sheet_id][dialog_item.resource_scene_unique_id] = dialog_item
sheet_info[sheet_id][dialog_item.resource_scene_unique_id] = {
"type": "message",
"item_index": item_index,
"sequence_id": dialog_node.sequence_id,
}
func _resource_map_append_sheet(sheet_id: String):
# Only appends the sheet itself, not the contents
var sheet_data = dialog_data.sheets[sheet_id]
resource_map[sheet_id] = {}
sheet_info[sheet_id] = {}
func _resource_map_append_sequence(sheet_id: String, dialog_node: DialogNodeData):
# Only appends the sequence itself, not the items
resource_map[sheet_id][dialog_node.resource_scene_unique_id] = dialog_node
sheet_info[sheet_id][dialog_node.resource_scene_unique_id] = {
"type": "sequence",
"sequence_id": dialog_node.sequence_id
}
func _resource_map_append_message(sheet_id: String, sequence_uid: String, item_index: int, dialog_item: DialogNodeItemData):
if not sequence_uid in resource_map[sheet_id]:
return
if not dialog_item.item_type == DialogNodeItemData.ItemTypes.Message:
return
var dialog_node: DialogNodeData = resource_map[sheet_id][sequence_uid]
resource_map[sheet_id][dialog_item.resource_scene_unique_id] = dialog_item
sheet_info[sheet_id][dialog_item.resource_scene_unique_id] = {
"type": "message",
"item_index": item_index,
"sequence_id": dialog_node.sequence_id,
}
func _on_btn_close_pressed() -> void:
hide()
# ---------------------------------------
func _mark_locale_as_mentioned(locale: String):
if not locale in prepared_data["locales_mentioned"]:
prepared_data["locales_mentioned"].append(locale)
func _refresh_locale_listbox(locales: Array):
for child in locale_listbox.get_children():
child.queue_free()
# Default is always included
var new_checkbox := template_CheckBoxLocale.instantiate()
new_checkbox.locale = ""
new_checkbox.text = "Default locale"
locale_listbox.add_child(new_checkbox)
new_checkbox.toggled.connect(_on_check_box_locale_toggled)
for locale in locales:
if locale != "":
new_checkbox = template_CheckBoxLocale.instantiate()
new_checkbox.locale = locale
new_checkbox.text = locale
locale_listbox.add_child(new_checkbox)
new_checkbox.toggled.connect(_on_check_box_locale_toggled)
func prepare(text: String, restricted_locales: Array = []):
var restrict_locales: bool = (restricted_locales.size() > 0)
prepared_data.clear()
if (not dialog_data) or (not current_sheet_id in dialog_data.sheets) or (btn_importer.selected < 0) or (btn_importer.selected >= mt_ie.importers_list.size()):
print("MadTalk importer error")
return false
var importer_script = mt_ie.importers_list.keys()[ btn_importer.selected ]
var importer = load(importer_script).new()
var imported_data = importer.import(dialog_data, text)
if (not "status" in imported_data) or (imported_data["status"] != importer.ImportResults.OK):
print("MadTalk importer error")
return false
# Sort destination sheets and make sure they exist
var collapse_destination := false
var destination_sheet := "" # Only used if sollapsing destination
var destination_desc := ""
match btn_destination.selected:
0:
# Respect original sheets
collapse_destination = false
1:
collapse_destination = true
destination_sheet = current_sheet_id
2:
collapse_destination = true
destination_sheet = _make_sheet_name()
destination_desc = "(Sheet created while importing dialog data - please rename and change description)"
_:
return false
prepared_data["collapse_destination"] = collapse_destination
prepared_data["destination_sheet"] = destination_sheet
prepared_data["to_modify"] = {} # sheet_id: { sequence_uid: { message_uid: message_item, ... } }
prepared_data["to_append"] = {} # sheet_id: { sequence_uid: [ message_item, message_item, ... ] }
prepared_data["new"] = {} # sheet_id: { array (sequence) of array (message) }
prepared_data["stats"] = {
"modified_sequences": 0,
"modified_messages": 0,
"appended_sequences": 0,
"appended_messages": 0,
"new_sequences": 0,
"new_messages": 0,
"missing_sequences": 0,
"missing_messages": 0,
}
prepared_data["locales_mentioned"] = []
prepared_data["affected_sheets"] = []
prepared_data["sheet_info"] = {}
var original_sheet_list: Array = imported_data["sheets"].keys().duplicate()
if collapse_destination:
prepared_data["affected_sheets"] = [destination_sheet]
prepared_data["sheet_info"] = { destination_sheet: {
"sheet_id": destination_sheet,
"sheet_desc": destination_desc,
}}
else:
prepared_data["affected_sheets"] = original_sheet_list
for sheet_id in imported_data["sheets"]:
prepared_data["sheet_info"][sheet_id] = {
"sheet_id": imported_data["sheets"][sheet_id]["sheet_id"],
"sheet_desc": imported_data["sheets"][sheet_id]["sheet_desc"]
}
update_resource_map(prepared_data["affected_sheets"])
if collapse_destination:
if not destination_sheet in resource_map:
resource_map[destination_sheet] = {} # Just so key access doesn't crash - it's ok to be empty
if not destination_sheet in prepared_data["to_modify"]:
prepared_data["to_modify"][destination_sheet] = {}
if not destination_sheet in prepared_data["to_append"]:
prepared_data["to_append"][destination_sheet] = {}
if not destination_sheet in prepared_data["new"]:
prepared_data["new"][destination_sheet] = []
for source_sheet_id in imported_data["sheets"]:
var sheet_id: String = destination_sheet if collapse_destination else source_sheet_id
# source_sheet_id is used when reading source (imported_data)
# sheet_id is used when writing to prepateddata or checking resource_map
if not collapse_destination:
if not sheet_id in resource_map:
resource_map[sheet_id] = {} # Just so key access doesn't crash - it's ok to be empty
if not sheet_id in prepared_data["to_modify"]:
prepared_data["to_modify"][sheet_id] = {}
if not sheet_id in prepared_data["to_append"]:
prepared_data["to_append"][sheet_id] = {}
if not sheet_id in prepared_data["new"]:
prepared_data["new"][sheet_id] = []
for node: Dictionary in imported_data["sheets"][source_sheet_id]["nodes"]:
if (node["sequence_uid"] != ""):
if node["sequence_uid"] in resource_map[sheet_id]:
node["sequence_resource"] = resource_map[sheet_id][node["sequence_uid"]]
#prepared_data["stats"]["modified_sequences"] += 1
else:
node["sequence_uid"] = ""
prepared_data["stats"]["missing_sequences"] += 1
# Existing sequence
if (node["sequence_uid"] != "") and (node["sequence_uid"] in resource_map[sheet_id]):
# Sequence exists in this sheet
prepared_data["to_modify"][sheet_id][node["sequence_uid"]] = {}
prepared_data["to_append"][sheet_id][node["sequence_uid"]] = []
var sequence_message_modified_count := 0
for item: Dictionary in node["items"]:
# Locales mentioned is recorded even if message is discarded
for locale in item["locales"]:
_mark_locale_as_mentioned(locale)
if restrict_locales and (not "" in restricted_locales):
var has_at_least_one_locale := false
for locale in restricted_locales:
if locale in item["locales"]:
has_at_least_one_locale = true
break
if not has_at_least_one_locale:
continue
# Delete unwanted locales - except default
if restrict_locales:
item = item.duplicate(true)
var orig_locales = item["locales"].keys().duplicate()
for locale in orig_locales:
if not locale in restricted_locales:
item["locales"].erase(locale)
if (item["message_uid"] != ""):
if item["message_uid"] in resource_map[sheet_id]:
item["message_resource"] = resource_map[sheet_id][item["message_uid"]]
prepared_data["stats"]["modified_messages"] += 1
prepared_data["to_modify"][sheet_id][node["sequence_uid"]][item["message_uid"]] = item
else:
item["message_uid"] = ""
prepared_data["stats"]["missing_messages"] += 1
prepared_data["stats"]["new_messages"] += 1
prepared_data["to_append"][sheet_id][node["sequence_uid"]].append(item)
else:
prepared_data["stats"]["new_messages"] += 1
prepared_data["to_append"][sheet_id][node["sequence_uid"]].append(item)
sequence_message_modified_count += 1
if sequence_message_modified_count > 0:
prepared_data["stats"]["modified_sequences"] += 1
# New sequence
else:
# Either it's a new sequence, or the sequence was specified, but not found
# this happens when importing a file exported from a different sheet
# should be treated as a new sequence
var new_sequence_array := []
for item: Dictionary in node["items"]:
# Locales mentioned is recorded even if message is discarded
for locale in item["locales"]:
_mark_locale_as_mentioned(locale)
if restrict_locales and (not "" in restricted_locales):
var has_at_least_one_locale := false
for locale in restricted_locales:
if locale in item["locales"]:
has_at_least_one_locale = true
break
if not has_at_least_one_locale:
continue
if restrict_locales:
item = item.duplicate(true)
var orig_locales = item["locales"].keys().duplicate()
for locale in orig_locales:
if not locale in restricted_locales:
item["locales"].erase(locale)
prepared_data["stats"]["new_messages"] += 1
new_sequence_array.append(item)
if new_sequence_array.size() > 0:
prepared_data["new"][sheet_id].append(new_sequence_array)
prepared_data["stats"]["new_sequences"] += 1
# Sanitize empty lists:
var sheet_ids = prepared_data["to_modify"].keys()
for sheet_id in sheet_ids:
var seq_ids: Array = prepared_data["to_modify"][sheet_id].keys()
for sequence_uid: String in seq_ids:
if prepared_data["to_modify"][sheet_id][sequence_uid].size() == 0:
prepared_data["to_modify"][sheet_id].erase(sequence_uid)
if prepared_data["to_modify"][sheet_id].size() == 0:
prepared_data["to_modify"].erase(sheet_id)
sheet_ids = prepared_data["to_append"].keys()
for sheet_id in sheet_ids:
var seq_ids: Array = prepared_data["to_append"][sheet_id].keys()
for sequence_uid: String in seq_ids:
if prepared_data["to_append"][sheet_id][sequence_uid].size() == 0:
prepared_data["to_append"][sheet_id].erase(sequence_uid)
if prepared_data["to_append"][sheet_id].size() == 0:
prepared_data["to_append"].erase(sheet_id)
sheet_ids = prepared_data["new"].keys()
for sheet_id in sheet_ids:
if prepared_data["new"][sheet_id].size() == 0:
prepared_data["new"].erase(sheet_id)
import_summary.text = generate_summary(restricted_locales)
func reload(restrict_locales: bool = false):
if restrict_locales:
var restricted_locales := []
var is_restricted := false
for checkbox in locale_listbox.get_children():
if checkbox.button_pressed:
restricted_locales.append(checkbox.locale)
else:
is_restricted = true
if not is_restricted:
restricted_locales.clear()
prepare(input_edit.text, restricted_locales)
else:
prepare(input_edit.text)
_update_destination_text(btn_destination.selected)
func _cardinal_number(value: int) -> String:
match value:
0:
return "1st"
1:
return "2nd"
2:
return "3rd"
_:
return str(value)+"th"
func _print_message_item(item: Dictionary, show_default_locale: bool = true) -> String:
var result := ""
result += "Speaker: \"[color=#ff9955]%s[/color]\" Variant: \"[color=#ff9955]%s[/color]\"\nText:\n" % [item["speaker_id"], item["variant"]]
if show_default_locale:
result += " [color=#aacc55][lb]default locale[rb][/color]\n"
result += " [color=#55ffff]%s[/color]\n" % item["message_text"]
for locale in item["locales"]:
result += " [color=#aacc55][lb]%s[rb][/color]\n" % locale
result += " [color=#55ffff]%s[/color]\n" % item["locales"][locale]
return result
func generate_summary(restricted_locales: Array = []) -> String:
var show_default_locale: bool = (restricted_locales.size() == 0) or ("" in restricted_locales)
var result := "[color=#ff3333][b]=== WARNING: THERE IS NO UNDO ===[/b][/color]\n\n"
if prepared_data["stats"]["modified_sequences"] > 0:
result += "[color=#ff5555][b]%d sequence(s) will be modified[/b][/color]\n" % prepared_data["stats"]["modified_sequences"]
if prepared_data["stats"]["modified_messages"] > 0:
result += "[color=#ff5555][b]%d message(s) items will be modified[/b][/color]\n" % prepared_data["stats"]["modified_messages"]
if prepared_data["stats"]["appended_sequences"] > 0:
result += "[color=#ff5555][b]%d sequence(s) will have new messages appended[/b][/color]\n" % prepared_data["stats"]["appended_sequences"]
if prepared_data["stats"]["appended_messages"] > 0:
result += "[color=#ff5555][b]%d message(s) items will be appended to existing sequences[/b][/color]\n" % prepared_data["stats"]["appended_messages"]
if prepared_data["stats"]["missing_sequences"] > 0:
result += "[color=#ffbb55][b]%d sequence(s) were supposed to be modified, but the codes they refer to were not found. They will be inserted as new sequences instead.[/b][/color]\n" % prepared_data["stats"]["missing_sequences"]
if prepared_data["stats"]["missing_messages"] > 0:
result += "[color=#ffbb55][b]%d message(s) items were supposed to be modified, but the codes they refer to were not found. They will be inserted as new messages instead.[/b][/color]\n" % prepared_data["stats"]["missing_messages"]
if prepared_data["stats"]["new_sequences"] > 0:
result += "[color=#55ff55][b]%d new sequence(s) will be created[/b][/color]\n" % prepared_data["stats"]["new_sequences"]
if prepared_data["stats"]["new_messages"] > 0:
result += "[color=#55ff55][b]%d new messages will be created[/b][/color]\n" % prepared_data["stats"]["new_messages"]
# Modified messages:
if prepared_data["stats"]["modified_messages"] > 0:
result += "\n========================================================\n"
result += "SEQUENCES/MESSAGES TO BE MODIFIED\n"
result += "--------------------------------------------------------\n\n"
for sheet_id in prepared_data["to_modify"]:
if prepared_data["to_modify"][sheet_id].size() == 0:
continue
result += "[color=#9999ff]Sheet ID: [b]%s[/b][/color]\n\n" % (sheet_id if (sheet_id != "") else "(not specified)")
for sequence_uid: String in prepared_data["to_modify"][sheet_id]:
var node: Dictionary = prepared_data["to_modify"][sheet_id][sequence_uid]
var node_resource: DialogNodeData = resource_map[sheet_id][sequence_uid]
result += " === Sequence ID [b]%d[/b] ===\n\n" % node_resource.sequence_id
for message_uid: String in node:
var item: Dictionary = node[message_uid]
var message_info: Dictionary = sheet_info[sheet_id][message_uid]
result += "--- Item index %d (the %s item in the sequence) ---\n" % [
message_info["item_index"],
_cardinal_number(message_info["item_index"])
]
result += _print_message_item(item, show_default_locale)
result += "\n---\n\n"
if prepared_data["to_append"].size() > 0:
result += "\n========================================================\n"
result += "SEQUENCES TO HAVE MESSAGES APPENDED\n"
result += "--------------------------------------------------------\n\n"
for sheet_id in prepared_data["to_append"]:
if prepared_data["to_append"][sheet_id].size() == 0:
continue
result += "[color=#9999ff]Sheet ID: [b]%s[/b][/color]\n\n" % (sheet_id if (sheet_id != "") else "(not specified)")
for sequence_uid: String in prepared_data["to_append"][sheet_id]:
var node: Array = prepared_data["to_append"][sheet_id][sequence_uid]
var node_resource: DialogNodeData = resource_map[sheet_id][sequence_uid]
result += " === Sequence ID [b]%d[/b] ===\n\n" % node_resource.sequence_id
for item: Dictionary in node:
result += _print_message_item(item, show_default_locale)
result += "\n---\n\n"
if prepared_data["new"].size() > 0:
result += "\n========================================================\n"
result += "NEW SEQUENCES/MESSAGES\n"
result += "--------------------------------------------------------\n\n"
for sheet_id in prepared_data["new"]:
if prepared_data["new"][sheet_id].size() == 0:
continue
result += "[color=#9999ff]Sheet ID: [b]%s[/b][/color]\n\n" % (sheet_id if (sheet_id != "") else "(not specified)")
for node: Array in prepared_data["new"][sheet_id]:
result += " === New sequence ===\n\n"
for item: Dictionary in node:
result += _print_message_item(item, show_default_locale)
result += "\n---\n\n"
return result
func execute(restricted_locales: Array = []) -> bool:
var include_default_locale: bool = (restricted_locales.size() == 0) or ("" in restricted_locales)
if prepared_data["stats"]["modified_messages"] > 0:
for sheet_id in prepared_data["to_modify"]:
for sequence_uid: String in prepared_data["to_modify"][sheet_id]:
var node: Dictionary = prepared_data["to_modify"][sheet_id][sequence_uid]
for message_uid: String in node:
var item: Dictionary = node[message_uid]
_execute_modify_message(sheet_id, sequence_uid, message_uid, item, include_default_locale)
if prepared_data["to_append"].size() > 0:
for sheet_id in prepared_data["to_append"]:
for sequence_uid: String in prepared_data["to_append"][sheet_id]:
var node: Array = prepared_data["to_append"][sheet_id][sequence_uid]
for item: Dictionary in node:
_execute_create_message(sheet_id, sequence_uid, item, include_default_locale)
if prepared_data["new"].size() > 0:
for sheet_id in prepared_data["new"]:
var sheet_desc: String = prepared_data["sheet_info"][sheet_id]["sheet_desc"] if sheet_id in prepared_data["sheet_info"] else ""
_execute_create_sheet_if_needed(sheet_id, sheet_desc, false)
for node: Array in prepared_data["new"][sheet_id]:
var dialog_node: DialogNodeData = _execute_create_sequence(sheet_id, false)
var sequence_uid: String = dialog_node.resource_scene_unique_id
for item: Dictionary in node:
_execute_create_message(sheet_id, sequence_uid, item, include_default_locale)
var signal_sheet_id := ""
if prepared_data["collapse_destination"]:
signal_sheet_id = prepared_data["destination_sheet"]
import_executed.emit(signal_sheet_id)
return true
func _make_sheet_name() -> String:
var sheet_num = 1
var new_sheet_name = "new_imported_sheet_1"
while new_sheet_name in dialog_data.sheets:
sheet_num += 1
new_sheet_name = "new_imported_sheet_%d" % sheet_num
return new_sheet_name
func _execute_create_sheet_if_needed(sheet_id: String, desc: String = "", create_id_zero: bool = true) -> DialogSheetData:
if not sheet_id in dialog_data.sheets:
var new_sheet_data = DialogSheetData.new() # default next_sequence_id=0
new_sheet_data.resource_scene_unique_id = Resource.generate_scene_unique_id()
new_sheet_data.sheet_id = sheet_id
new_sheet_data.sheet_description = desc
new_sheet_data.nodes = [] # Forces a new array to avoid reference sharing
dialog_data.sheets[sheet_id] = new_sheet_data
_resource_map_append_sheet(sheet_id)
if create_id_zero:
# Sequence MUST have ID 0
# this can only be bypassed if the code invoking this method
# will take care of creating it externally
_execute_create_sequence(sheet_id, false)
return dialog_data.sheets[sheet_id]
func _execute_create_sequence(sheet_id: String, create_sheet_if_needed: bool = true) -> DialogNodeData:
var sheet_data: DialogSheetData
if create_sheet_if_needed:
sheet_data = _execute_create_sheet_if_needed(sheet_id, "", false)
elif sheet_id in dialog_data.sheets:
sheet_data = dialog_data.sheets[sheet_id]
else:
return null
# Find next available sequence id
var next_available_id = sheet_data.next_sequence_id
for this_node in sheet_data.nodes:
if this_node.sequence_id >= next_available_id:
next_available_id = this_node.sequence_id+1
var new_data = DialogNodeData.new()
new_data.resource_scene_unique_id = Resource.generate_scene_unique_id()
new_data.position = Vector2(30,30) * next_available_id
new_data.sequence_id = next_available_id
new_data.items = [] # New Array to avoid sharing references
new_data.options = [] # New Array to avoid sharing references
_resource_map_append_sequence(sheet_id, new_data)
sheet_data.nodes.append(new_data)
sheet_data.next_sequence_id = next_available_id+1
return new_data
func _execute_create_message(sheet_id: String, sequence_uid: String, dict: Dictionary = {}, include_default_locale: bool = true) -> DialogNodeItemData:
if not sheet_id in dialog_data.sheets:
return null
if not sequence_uid in resource_map[sheet_id]:
return null
var sheet_data: DialogSheetData = dialog_data.sheets[sheet_id]
var dialog_node: DialogNodeData = resource_map[sheet_id][sequence_uid]
var new_data_item = DialogNodeItemData.new()
new_data_item.resource_scene_unique_id = Resource.generate_scene_unique_id()
new_data_item.item_type = DialogNodeItemData.ItemTypes.Message
if dict.size() == 0:
new_data_item.message_speaker_id = ""
new_data_item.message_text = ""
else:
new_data_item.message_speaker_id = dict["speaker_id"]
new_data_item.message_speaker_variant = dict["variant"]
if include_default_locale:
new_data_item.message_text = dict["message_text"]
for locale in dict["locales"]:
new_data_item.message_text_locales[locale] = dict["locales"][locale]
dialog_node.items.append(new_data_item)
var item_index = dialog_node.items.find(new_data_item)
_resource_map_append_message(sheet_id, sequence_uid, item_index, new_data_item)
return new_data_item
func _execute_modify_message(sheet_id: String, sequence_uid: String, message_uid: String, dict: Dictionary, include_default_locale: bool = true):
if not sheet_id in dialog_data.sheets:
return null
if not sequence_uid in resource_map[sheet_id]:
return null
if not message_uid in resource_map[sheet_id]:
return null
var sheet_data: DialogSheetData = dialog_data.sheets[sheet_id]
var dialog_node: DialogNodeData = resource_map[sheet_id][sequence_uid]
var dialog_item: DialogNodeItemData = resource_map[sheet_id][message_uid]
dialog_item.message_speaker_id = dict["speaker_id"]
dialog_item.message_speaker_variant = dict["variant"]
if include_default_locale:
dialog_item.message_text = dict["message_text"]
for locale in dict["locales"]:
dialog_item.message_text_locales[locale] = dict["locales"][locale]
# ---------------------------------------
func _on_btn_importer_item_selected(index: int) -> void:
if (btn_importer.selected < 0) or (btn_importer.selected >= mt_ie.importers_list.size()):
print("MadTalk importer error")
return
var importer_script = mt_ie.importers_list.keys()[ btn_importer.selected ]
var importer = load(importer_script).new()
importer_desc.text = importer.description
func _on_btn_load_pressed() -> void:
btn_destination.select(0)
reload()
_refresh_locale_listbox(prepared_data["locales_mentioned"])
panel_input.hide()
panel_options.show()
func _on_options_btn_back_pressed() -> void:
panel_input.show()
panel_options.hide()
import_summary.text = ""
prepared_data.clear()
func _on_btn_destination_item_selected(index: int) -> void:
reload(true)
func _update_destination_text(index: int):
var s := ""
match index:
0:
s = "Destination sheets from the imported data will be respected. Messages with unspecified sheet ID will affect currenty selected sheet ([color=#ffcc55]%s[/color]).\n\nThe following sheets will be affected:\n" % current_sheet_id
for sheet_id in prepared_data["affected_sheets"]:
s += "[color=#ffcc55][b]%s[/b][/color]\n" % (sheet_id if sheet_id != "" else ("Current sheet (%s)" % current_sheet_id))
1:
s = "All content will be imported into current sheet ([color=#ffcc55]%s[/color]), ignoring the sheets mentioned in imported data.\n\nThe following sheets will be affected:\n" % current_sheet_id
s += "[color=#ffcc55][b]%s[/b][/color]\n" % current_sheet_id
2:
s = "All content will be imported into a brand new sheet, ignoring the sheets mentioned in imported data.\n\nThe following sheets will be affected:\n"
s += "[color=#ffcc55][b](new sheet will be created)[/b][/color]\n"
label_sheets.text = s
func _on_check_box_locale_toggled(_toggled_on: bool) -> void:
reload(true)
func _on_btn_import_pressed() -> void:
var restricted_locales := []
var is_restricted := false
for checkbox in locale_listbox.get_children():
if checkbox.button_pressed:
restricted_locales.append(checkbox.locale)
else:
is_restricted = true
if not is_restricted:
restricted_locales.clear()
execute(restricted_locales)
hide()

View File

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

View File

@@ -0,0 +1,228 @@
[gd_scene load_steps=6 format=3 uid="uid://b22lta4yhfhgu"]
[ext_resource type="Script" uid="uid://cix5fmirlacwr" path="res://addons/madtalk/components/MainEditor_DialogImport.gd" id="1_8rwin"]
[ext_resource type="FontFile" uid="uid://dp7os1mai8le8" path="res://addons/madtalk/fonts/droid-sans-mono.regular.ttf" id="4_gx77l"]
[ext_resource type="PackedScene" uid="uid://cfxq3ddd234s5" path="res://addons/madtalk/components/CheckBoxLocale.tscn" id="5_ll683"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="8_0k7gi"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="13_45pmk"]
[node name="DialogImport" type="Window"]
auto_translate_mode = 1
title = "Import Dialog Sheet"
position = Vector2i(0, 36)
size = Vector2i(700, 500)
transient = true
exclusive = true
popup_window = true
script = ExtResource("1_8rwin")
[node name="PanelInput" type="Panel" parent="."]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = ExtResource("13_45pmk")
[node name="BtnImporter" type="OptionButton" parent="PanelInput"]
layout_mode = 0
offset_left = 122.0
offset_top = 16.0
offset_right = 330.0
offset_bottom = 36.0
[node name="Label" type="Label" parent="PanelInput/BtnImporter"]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -104.0
offset_top = -8.5
offset_right = -15.0
offset_bottom = 8.5
grow_vertical = 2
theme_override_font_sizes/font_size = 12
text = "Import Format:"
[node name="Label" type="Label" parent="PanelInput"]
layout_mode = 0
offset_left = 16.0
offset_top = 52.0
offset_right = 164.0
offset_bottom = 69.0
theme_override_font_sizes/font_size = 12
text = "Paste content to import:"
[node name="InputEdit" type="TextEdit" parent="PanelInput"]
layout_mode = 1
offset_left = 8.0
offset_top = 72.0
offset_right = 356.0
offset_bottom = 461.0
theme_override_font_sizes/font_size = 12
emoji_menu_enabled = false
deselect_on_focus_loss_enabled = false
draw_tabs = true
draw_spaces = true
[node name="BtnLoad" type="Button" parent="PanelInput"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -52.0
offset_top = -32.0
offset_right = 4.0
offset_bottom = -5.0
grow_horizontal = 2
grow_vertical = 0
focus_mode = 0
theme_override_styles/focus = ExtResource("8_0k7gi")
theme_override_styles/hover = ExtResource("8_0k7gi")
theme_override_styles/normal = ExtResource("8_0k7gi")
text = "Load"
[node name="ImporterDesc" type="RichTextLabel" parent="PanelInput"]
layout_mode = 0
offset_left = 374.0
offset_top = 17.0
offset_right = 689.0
offset_bottom = 436.0
bbcode_enabled = true
[node name="PanelOptions" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = ExtResource("13_45pmk")
[node name="ImportSummary" type="RichTextLabel" parent="PanelOptions"]
layout_mode = 0
offset_left = 307.0
offset_top = 24.0
offset_right = 687.0
offset_bottom = 435.0
theme_override_fonts/normal_font = ExtResource("4_gx77l")
bbcode_enabled = true
[node name="BtnDestination" type="OptionButton" parent="PanelOptions"]
layout_mode = 0
offset_left = 10.0
offset_top = 46.0
offset_right = 295.0
offset_bottom = 66.0
theme_override_font_sizes/font_size = 12
selected = 0
item_count = 3
popup/item_0/text = "Sheets mentioned in imported data"
popup/item_0/id = 0
popup/item_1/text = "Current editting sheet"
popup/item_1/id = 1
popup/item_2/text = "A brand new sheet"
popup/item_2/id = 2
[node name="Label" type="Label" parent="PanelOptions/BtnDestination"]
layout_mode = 0
offset_top = -24.0
offset_right = 169.0
offset_bottom = -7.0
theme_override_font_sizes/font_size = 12
text = "Import sequences into:"
[node name="LabelSheets" type="RichTextLabel" parent="PanelOptions/BtnDestination"]
layout_mode = 0
offset_top = 36.0
offset_right = 284.0
offset_bottom = 199.0
theme_override_font_sizes/bold_italics_font_size = 10
theme_override_font_sizes/italics_font_size = 10
theme_override_font_sizes/mono_font_size = 10
theme_override_font_sizes/normal_font_size = 10
theme_override_font_sizes/bold_font_size = 10
bbcode_enabled = true
text = "Destination sheets from the imported data will be respected. The following sheets will be affected:"
[node name="BtnImport" type="Button" parent="PanelOptions"]
layout_mode = 1
offset_left = 21.0
offset_top = 398.0
offset_right = 221.0
offset_bottom = 425.0
focus_mode = 0
theme_override_styles/focus = ExtResource("8_0k7gi")
theme_override_styles/hover = ExtResource("8_0k7gi")
theme_override_styles/normal = ExtResource("8_0k7gi")
text = "Import"
[node name="BtnBack" type="Button" parent="PanelOptions"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -332.0
offset_top = -32.0
offset_right = -276.0
offset_bottom = -5.0
grow_horizontal = 2
grow_vertical = 0
focus_mode = 0
theme_override_styles/focus = ExtResource("8_0k7gi")
theme_override_styles/hover = ExtResource("8_0k7gi")
theme_override_styles/normal = ExtResource("8_0k7gi")
text = "Back"
[node name="LabelLocales" type="Label" parent="PanelOptions"]
layout_mode = 2
offset_left = 10.0
offset_top = 250.0
offset_right = 144.0
offset_bottom = 267.0
theme_override_font_sizes/font_size = 12
text = "Locales to import:"
[node name="LocaleListScroll" type="ScrollContainer" parent="PanelOptions"]
layout_mode = 0
offset_left = 10.0
offset_top = 274.0
offset_right = 294.0
offset_bottom = 382.0
[node name="LocaleList" type="VBoxContainer" parent="PanelOptions/LocaleListScroll"]
layout_mode = 2
size_flags_horizontal = 3
[node name="CheckBoxLocale" parent="PanelOptions/LocaleListScroll/LocaleList" instance=ExtResource("5_ll683")]
layout_mode = 2
[node name="BtnClose" type="Button" parent="."]
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -64.0
offset_top = -32.0
offset_right = -8.0
offset_bottom = -5.0
grow_horizontal = 0
grow_vertical = 0
focus_mode = 0
theme_override_styles/focus = ExtResource("8_0k7gi")
theme_override_styles/hover = ExtResource("8_0k7gi")
theme_override_styles/normal = ExtResource("8_0k7gi")
text = "Close"
[connection signal="item_selected" from="PanelInput/BtnImporter" to="." method="_on_btn_importer_item_selected"]
[connection signal="pressed" from="PanelInput/BtnLoad" to="." method="_on_btn_load_pressed"]
[connection signal="item_selected" from="PanelOptions/BtnDestination" to="." method="_on_btn_destination_item_selected"]
[connection signal="pressed" from="PanelOptions/BtnImport" to="." method="_on_btn_import_pressed"]
[connection signal="pressed" from="PanelOptions/BtnBack" to="." method="_on_options_btn_back_pressed"]
[connection signal="toggled" from="PanelOptions/LocaleListScroll/LocaleList/CheckBoxLocale" to="." method="_on_check_box_locale_toggled"]
[connection signal="pressed" from="BtnClose" to="." method="_on_btn_close_pressed"]

View File

@@ -0,0 +1,30 @@
@tool
extends Window
signal sheet_saved(sheet_id, sheet_desc, delete_word)
@onready var sheet_id_edit = get_node("Panel/SheetIDEdit")
@onready var sheet_desc_edit = get_node("Panel/SheedDescEdit")
@onready var sheet_delete_word = get_node("Panel/SheetDeleteEdit")
func _ready():
pass
# Hides the close button
#get_close_button().hide()
func open(data):
sheet_id_edit.text = data.sheet_id
sheet_desc_edit.text = data.sheet_description
sheet_delete_word.text = ""
popup_centered()
func _on_BtnSave_pressed():
# We do not hide the window here as the parent takes care of it
# since a renaming collision raises a warning instead of closing it
emit_signal("sheet_saved", sheet_id_edit.text, sheet_desc_edit.text, sheet_delete_word.text)
func _on_BtnCancel_pressed():
hide()

View File

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

View File

@@ -0,0 +1,153 @@
[gd_scene load_steps=6 format=3 uid="uid://cc7b2xbic6kf8"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="1"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="2"]
[ext_resource type="Script" uid="uid://x2ao4uxl8x3o" path="res://addons/madtalk/components/MainEditor_DialogSheetEdit.gd" id="3"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/InputDarkStyle.tres" id="4"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="5"]
[node name="DialogSheetEdit" type="Window"]
size = Vector2i(600, 300)
transient = true
exclusive = true
popup_window = true
script = ExtResource("3")
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_styles/panel = ExtResource("1")
[node name="BottomBar" type="Control" parent="Panel"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -36.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 0
[node name="BtnSave" type="Button" parent="Panel/BottomBar"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -100.5
offset_top = -14.0
offset_right = -59.5
offset_bottom = 13.0
grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
theme_override_styles/focus = ExtResource("5")
theme_override_styles/hover = ExtResource("5")
theme_override_styles/normal = ExtResource("5")
text = "OK"
[node name="BtnCancel" type="Button" parent="Panel/BottomBar"]
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 = -14.0
offset_right = 109.0
offset_bottom = 13.0
grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
theme_override_styles/focus = ExtResource("5")
theme_override_styles/hover = ExtResource("5")
theme_override_styles/normal = ExtResource("5")
text = "Cancel"
[node name="IDLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 24.0
offset_top = 21.5796
offset_right = 83.0
offset_bottom = 35.5796
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 12
text = "Sheet ID:"
[node name="IDLabel2" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 216.0
offset_top = 44.0
offset_right = 490.0
offset_bottom = 56.0
theme_override_colors/font_color = Color(0.592157, 0.592157, 0.592157, 1)
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 12
text = "<- Renaming the sheet ID might break existing
dialog logic if it relies on this ID"
[node name="SheetIDEdit" type="LineEdit" parent="Panel"]
layout_mode = 0
offset_left = 23.6254
offset_top = 40.3746
offset_right = 201.625
offset_bottom = 64.3746
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 14
theme_override_styles/focus = ExtResource("4")
theme_override_styles/normal = ExtResource("4")
placeholder_text = "e.g. npc_forest_wizard"
[node name="DescLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 24.0
offset_top = 85.5796
offset_right = 122.0
offset_bottom = 99.5796
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 12
text = "Sheet description:"
[node name="SheedDescEdit" type="LineEdit" parent="Panel"]
layout_mode = 0
offset_left = 24.0
offset_top = 104.0
offset_right = 502.0
offset_bottom = 128.0
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 14
theme_override_styles/focus = ExtResource("4")
theme_override_styles/normal = ExtResource("4")
placeholder_text = "e.g. Wizard NPC in the forest (information and shop)"
[node name="DeleteLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 304.0
offset_top = 149.58
offset_right = 402.0
offset_bottom = 163.58
theme_override_colors/font_color = Color(0.662745, 0.662745, 0.662745, 1)
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 12
text = "To delete this sheet, type the word
\"delete\" in the box below"
[node name="SheetDeleteEdit" type="LineEdit" parent="Panel"]
layout_mode = 0
offset_left = 308.0
offset_top = 200.0
offset_right = 500.0
offset_bottom = 225.0
theme_override_colors/font_color = Color(1, 0.498039, 0, 1)
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 12
theme_override_styles/focus = ExtResource("4")
theme_override_styles/normal = ExtResource("4")
placeholder_text = "type \"delete\" here to delete sheet"
[connection signal="pressed" from="Panel/BottomBar/BtnSave" to="." method="_on_BtnSave_pressed"]
[connection signal="pressed" from="Panel/BottomBar/BtnCancel" to="." method="_on_BtnCancel_pressed"]

View File

@@ -0,0 +1,189 @@
extends RefCounted
class_name MessageCodeParser
const tag_if_start = "{{if "
const tag_if_start_len = 5
const tag_if_end = "}}"
const tag_if_end_len = 2
const cond_sep = ": "
const cond_sep_len = 2
const operators = [" >= ", " <= ", " != ", " > ", " < ", " = "]
func process(source_text: String, variables: Dictionary) -> Array:
var result = ""
var message_list = parse(source_text, variables)
for msg in message_list:
if msg is String:
result += msg
elif (msg is Dictionary) and (msg["condition"] in variables):
var var_value = variables[msg["condition"]]
var message_approved = false
match msg["operator"]:
"=":
message_approved = (var_value == msg["value"])
"!=":
message_approved = (var_value != msg["value"])
">":
message_approved = (var_value > msg["value"])
">=":
message_approved = (var_value >= msg["value"])
"<":
message_approved = (var_value < msg["value"])
"<=":
message_approved = (var_value <= msg["value"])
_:
message_approved = false
if message_approved:
result += msg["text"]
# Find pause points
var text_segments = result.split("<pause>")
if (not text_segments is PackedStringArray) or (text_segments.size() <= 1):
return [result, [1.0]] # 1.0 means one text with 100% of characters
# Calculate total length of text
# This text is potentially BB code, and therefore must be properly
# parsed since text progression is based only on visible characters
# For this we need a RichTextLabel to parse the BBCode, but it doesn't
# have to be added anyhere
var bbcode_parser = RichTextLabel.new()
bbcode_parser.bbcode_enabled = true
bbcode_parser.text = ""
var charcount_per_segment = []
result = ""
for item in text_segments:
result += item
bbcode_parser.text += item
var characters_up_to_here = bbcode_parser.text.length() #get_total_character_count()
charcount_per_segment.append(characters_up_to_here)
var total_characters = float(bbcode_parser.text.length())
bbcode_parser.queue_free()
var percentages = []
for charcount in charcount_per_segment:
percentages.append(float(charcount) / total_characters)
return [result, percentages]
func parse(source_text: String, variables: Dictionary) -> Array:
# variables is a Dictionary mapping "variable name" to a value (int, float or String)
# result is an Array of text segments, where each segment is in the format
# segment = "String" ---> means text is not conditional
# segment = {
# "condition": "variable name",
# "operator": "=" | "!=" | ">" | ">=" | "<" | "<="
# "value": <value> or "variable name",
# "text": "text"
# }
var result = []
var s_tmp = source_text
var tag_pos = s_tmp.find("{{if")
while tag_pos > -1:
var text_before = s_tmp.left(tag_pos)
var text_after = s_tmp.substr(tag_pos + tag_if_start_len)
var tag_endpos = text_after.find(tag_if_end)
# if we don't have a closing tag, this is malformatted syntax and we
# just assume it's not meant to be parsed
if tag_endpos == -1:
break
var text_cond = text_after.left(tag_endpos)
text_after = text_after.substr(tag_endpos + tag_if_end_len)
# Now we have:
# text_before -> text before the start tag
# text_cond -> everything between both tags (not including)
# text_after -> text after the end tag
# both tags are not included anywhere
result.append(_replace_variables(text_before, variables))
result.append(_parse_condition(text_cond, variables))
s_tmp = text_after
tag_pos = s_tmp.find("{{if")
result.append(_replace_variables(s_tmp, variables))
return result
func _parse_condition(text: String, variables: Dictionary):
# Returns a segment to be appended into the array in parse()
var sep_pos = text.find(cond_sep)
if sep_pos == -1:
return text
var text_before = text.left(sep_pos)
var text_after = text.substr(sep_pos + cond_sep_len)
var cond_terms = text_before
for op in operators:
if op in text_before:
# Split text (e.g. "variable >= 5")
cond_terms = text_before.split(op, false, 2)
if cond_terms.size() < 2:
cond_terms = text_before
break
var value = cond_terms[1]
if value.is_valid_int():
value = value.to_int()
elif value.is_valid_float():
value = value.to_float()
return {
"condition": cond_terms[0],
"operator": op.strip_edges(),
"value": value,
"text": _replace_variables(text_after, variables),
}
# If no operator was found, cond_terms remains String
# Boolean check (e.g. "{{if variable: Text here!}}
if cond_terms is String:
return {
"condition": cond_terms,
# Boolean check is implemented as "value != 0"
"operator": "!=",
"value": 0,
"text": _replace_variables(text_after, variables),
}
else:
return ""
func _replace_variables(text, variables):
var s_tmp = text
for var_name in variables:
var var_tag = "<<%s>>" % var_name
if var_tag in s_tmp:
var var_value = variables[var_name]
# Converts 15.0 into 15 for elegant printing
if (var_value is float) and (var_value == floor(var_value)):
var_value = str(int(var_value))
else:
var_value = str(var_value)
s_tmp = s_tmp.replace(var_tag, var_value)
return s_tmp

View File

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

View File

@@ -0,0 +1,147 @@
@tool
extends ReferenceRect
signal tab_changed
signal voice_clip_dialog_requested
const DEFAULT_TAB_TITLE = "Default"
@onready var locale_bar := $LocaleBar
@onready var message_edit := $MessageEdit
@onready var voiceclip_edit := $VoiceEdit
@onready var panel_new_locale := $PanelNewLocale
@onready var locale_edit := $PanelNewLocale/LocaleEdit
var messages_locales := {}
var voiceclips_locales := {}
var current_locale := ""
var is_updating_tabs := false
func setup(default_message: String, locale_messages: Dictionary, default_voiceclip: String, locales_voiceclips: Dictionary):
is_updating_tabs = true
messages_locales.clear()
messages_locales[""] = default_message
voiceclips_locales.clear()
voiceclips_locales[""] = default_voiceclip
var locale_list: Array = locale_messages.keys()
for locale in locales_voiceclips:
if not locale in locale_list:
locale_list.append(locale)
for locale in locale_list:
messages_locales[locale] = locale_messages[locale] if locale in locale_messages else ""
voiceclips_locales[locale] = locales_voiceclips[locale] if locale in locales_voiceclips else ""
locale_list.sort()
locale_bar.clear_tabs()
locale_bar.add_tab(DEFAULT_TAB_TITLE)
for tab_name in locale_list:
if tab_name != "":
locale_bar.add_tab(tab_name)
locale_bar.current_tab = 0
current_locale = ""
load_data_from_locale(current_locale)
is_updating_tabs = false
func load_data_from_locale(locale: String):
if locale in messages_locales:
message_edit.text = messages_locales[locale]
else:
message_edit.text = ""
if locale in voiceclips_locales:
voiceclip_edit.text = voiceclips_locales[locale]
else:
voiceclip_edit.text = ""
func store_data_into_locale(locale: String, text: String, voiceclip: String):
messages_locales[locale] = text
voiceclips_locales[locale] = voiceclip
func finalize_editor():
store_data_into_locale(current_locale, message_edit.text, voiceclip_edit.text)
var locale_list = messages_locales.keys()
for locale in locale_list:
if messages_locales[locale] == "":
messages_locales.erase(locale)
locale_list = voiceclips_locales.keys()
for locale in locale_list:
if voiceclips_locales[locale] == "":
voiceclips_locales.erase(locale)
func _on_locale_bar_tab_changed(tab: int) -> void:
if is_updating_tabs:
return
store_data_into_locale(current_locale, message_edit.text, voiceclip_edit.text)
current_locale = locale_bar.get_tab_title(tab)
if current_locale == DEFAULT_TAB_TITLE:
current_locale = ""
load_data_from_locale(current_locale)
tab_changed.emit()
func _on_btn_locale_new_pressed() -> void:
locale_edit.text = ""
panel_new_locale.show()
func _on_btn_locale_new_cancel_pressed() -> void:
panel_new_locale.hide()
func _on_btn_locale_new_confirm_pressed() -> void:
var new_locale = locale_edit.text
if (not new_locale in messages_locales) and (not new_locale in voiceclips_locales):
locale_bar.add_tab(new_locale)
if (not new_locale in messages_locales):
messages_locales[new_locale] = ""
if (not new_locale in voiceclips_locales):
voiceclips_locales[new_locale] = ""
panel_new_locale.hide()
func get_default_locale_message() -> String:
return messages_locales[""] if "" in messages_locales else ""
func get_default_locale_voiceclip() -> String:
return voiceclips_locales[""] if "" in voiceclips_locales else ""
func get_locale_messages_without_default() -> Dictionary:
var result := {}
for locale in messages_locales:
if locale != "":
result[locale] = messages_locales[locale]
return result
func get_locale_voiceclips_without_default() -> Dictionary:
var result := {}
for locale in voiceclips_locales:
if locale != "":
result[locale] = voiceclips_locales[locale]
return result
func set_voice_clip(clip_path: String):
voiceclip_edit.text = clip_path
func _on_btn_select_clip_pressed() -> void:
voice_clip_dialog_requested.emit()

View File

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

View File

@@ -0,0 +1,247 @@
[gd_scene load_steps=6 format=3 uid="uid://dc46jny8nbbow"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="1_cqlvq"]
[ext_resource type="Script" uid="uid://ducf6plaj7ucd" path="res://addons/madtalk/components/MessageEditorWithLocales.gd" id="1_ip4nx"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="3_fgqru"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="4_hk2wl"]
[ext_resource type="PackedScene" uid="uid://dyepkyvo6sodg" path="res://addons/madtalk/components/BtnTip.tscn" id="4_kgpnd"]
[node name="MessageEditorWithLocales" type="ReferenceRect"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
border_color = Color(0, 0.616891, 0.582496, 1)
border_width = 0.0
script = ExtResource("1_ip4nx")
[node name="MessageEdit" type="TextEdit" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 1.0
offset_top = 29.0
offset_right = -1.0
offset_bottom = -37.0
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 12
caret_blink = true
highlight_all_occurrences = true
highlight_current_line = true
draw_tabs = true
[node name="LabelLocale" type="Label" parent="."]
modulate = Color(1, 1, 1, 0.501961)
layout_mode = 0
offset_left = 14.0
offset_top = 6.0
offset_right = 53.0
offset_bottom = 29.0
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 10
text = "Locale:"
[node name="LocaleBar" type="TabBar" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 55.0
offset_top = 4.0
offset_right = -131.0
offset_bottom = 29.0
grow_horizontal = 2
focus_mode = 0
theme_override_font_sizes/font_size = 12
current_tab = 0
tab_count = 1
tab_0/title = "Default"
tab_0/tooltip = "Default locale. Will also be used if the user's locale is not in this list."
[node name="BtnLocaleNew" type="Button" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -125.0
offset_top = 3.0
offset_right = -47.0
offset_bottom = 27.0
grow_horizontal = 0
focus_mode = 0
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 12
theme_override_styles/normal = ExtResource("3_fgqru")
text = "New Locale"
[node name="TipLocale" parent="." instance=ExtResource("4_kgpnd")]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -36.0627
offset_top = 2.1479
offset_right = -8.06274
offset_bottom = 26.1479
grow_horizontal = 0
tip_title = "Message Locale"
tip_text = "You can optionally specify different messages for internationalization. MadTalk does not use Godot's CSV system for localizing dialog messages because it would be very confusing to edit dialog diagrams seeing message IDs instead of actual text, and also allows exporting and importing dialog text from other formats.
Creating locale versions is optional and is done PER MESSAGE. The default tab should be the main language of your game, and other tabs are alternate (localized) translations. If a specific dialog message doesn't have a version for the locale the player is using, the default one is used. You don't have to create any lists of available locales anywhere. To remove a locale tab from a message, simply erase the text under that tab and save.
Example: if a certain dialog message has locales Default (used e.g. for English), \"es\" (for Spanish) and \"jp\" (for Japanese), and the game is set for Spanish locale, then the text under the \"es\" tab will be used when this message is shown in a dialog. If, instead, the game is set to Portuguese, then the text under the Default tab will be shown, because this particular message doesn't have the \"pt\" version.
This also means if you intended to have a localization but forgot to add a translation to a message somewhere, MadTalk will just use the untranslated text (Default locale tab) for that particular message instead of empty text or crashing the dialog sequence.
To configure which locale MadTalk will use, call the methods below in MadTalkGlobals: set_locale() to set current locale, set_default_locale() to set which locale will use the default tab for messages (default \"en\"), and set_locale_automatic() to set the default and get the current from the system. Getting locale from the system is safe, since if the game doesn't have that language, the default language will be used instead.
Example 1 - the default tab contains English, the game is now set to Spanish:
MadTalkGlobals.set_default_locale(\"en\")
MadTalkGlobals.set_locale(\"es\")
Example 2 - getting locale from the system, doesn't change the default locale:
MadTalkGlobals.set_locale_automatic()
Example 3 - getting locale from the system, also change the default locale to Esperanto:
MadTalkGlobals.set_locale_automatic(\"eo\")
"
[node name="PanelNewLocale" type="Panel" parent="."]
visible = false
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -211.0
offset_top = 5.0
offset_right = -4.0
offset_bottom = 100.0
grow_horizontal = 0
theme_override_styles/panel = ExtResource("4_hk2wl")
[node name="Label" type="Label" parent="PanelNewLocale"]
layout_mode = 0
offset_left = 7.0
offset_top = 2.0
offset_right = 76.0
offset_bottom = 25.0
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 12
text = "Create new locale for this message:"
[node name="LocaleEdit" type="LineEdit" parent="PanelNewLocale"]
layout_mode = 1
anchors_preset = -1
anchor_right = 0.5
offset_left = 8.0
offset_top = 24.0
offset_right = 93.5
offset_bottom = 55.0
theme_override_colors/font_placeholder_color = Color(0.299547, 0.299547, 0.299547, 1)
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 14
placeholder_text = "locale (e.g. \"es\")"
[node name="BtnLocaleNewConfirm" type="Button" parent="PanelNewLocale"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -152.0
offset_top = 63.0
offset_right = -82.0
offset_bottom = 87.0
grow_horizontal = 0
focus_mode = 0
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 12
theme_override_styles/normal = ExtResource("3_fgqru")
text = "Create"
[node name="BtnLocaleNewCancel" type="Button" parent="PanelNewLocale"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -77.0
offset_top = 63.0
offset_right = -7.0
offset_bottom = 87.0
grow_horizontal = 0
focus_mode = 0
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 12
theme_override_styles/normal = ExtResource("3_fgqru")
text = "Cancel"
[node name="VoiceEdit" type="LineEdit" parent="."]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 85.0
offset_top = -31.0
offset_right = -84.0
grow_horizontal = 2
grow_vertical = 0
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 14
placeholder_text = "res://... .../filename.wav"
[node name="BtnSelectClip" type="Button" parent="VoiceEdit"]
layout_mode = 0
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = 3.0
offset_top = -15.0
offset_right = 44.0
offset_bottom = 16.0
focus_mode = 0
text = "..."
[node name="TipVoice" parent="." instance=ExtResource("4_kgpnd")]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -34.0
offset_top = -27.0
offset_right = -6.0
offset_bottom = -3.0
grow_horizontal = 0
grow_vertical = 0
tip_title = "Voice Clip"
tip_text = "The Voice Clip is the path for an audio file (WAV or OGG) which should be played when this message is displayed. Usually it is a voice transcription of the text, but anything can be used (e.g. a robot could have a \"beep bop beep bop\" sound when speaking).
The path is in the resource folder - that is, starts with res:// followed by file location.
Please note the MadTalk plugin will not automatically play the sound. Since different projects will manage audio buses and implement stream players differently, the actual sound playback must be coded separately. MadTalk will emit a signal \"voice_clip_requested\" providing the file path entered here."
[node name="VoiceLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 24.0
offset_top = -27.0
offset_right = 93.0
offset_bottom = -4.0
grow_vertical = 0
theme_override_fonts/font = ExtResource("1_cqlvq")
theme_override_font_sizes/font_size = 12
text = "Voice Clip"
[connection signal="tab_changed" from="LocaleBar" to="." method="_on_locale_bar_tab_changed"]
[connection signal="pressed" from="BtnLocaleNew" to="." method="_on_btn_locale_new_pressed"]
[connection signal="pressed" from="PanelNewLocale/BtnLocaleNewConfirm" to="." method="_on_btn_locale_new_confirm_pressed"]
[connection signal="pressed" from="PanelNewLocale/BtnLocaleNewCancel" to="." method="_on_btn_locale_new_cancel_pressed"]
[connection signal="pressed" from="VoiceEdit/BtnSelectClip" to="." method="_on_btn_select_clip_pressed"]

View File

@@ -0,0 +1,22 @@
@tool
extends Panel
@export var SizeClosed: int = 24
@onready var content = get_node_or_null("Content")
func _on_BtnTogglePanel_pressed():
if (size.y == SizeClosed):
# Open:
anchor_bottom = 1
offset_bottom = -16
if content:
content.show()
else:
# Close:
anchor_bottom = 0
size.y = SizeClosed
if content:
content.hide()

View File

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

View File

@@ -0,0 +1,37 @@
[gd_scene load_steps=5 format=3 uid="uid://c6topqf6spbbw"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="1"]
[ext_resource type="Script" uid="uid://cygmyylxhkxdu" path="res://addons/madtalk/components/SideBar.gd" id="2"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="3"]
[ext_resource type="Texture2D" uid="uid://c4xg8811uuoq6" path="res://addons/madtalk/images/icon_down.png" id="4"]
[node name="SideBar" type="Panel"]
clip_contents = true
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -209.0
offset_top = 31.0
offset_bottom = 431.0
theme_override_styles/panel = ExtResource("3")
script = ExtResource("2")
[node name="TitleLabel" type="Label" parent="."]
layout_mode = 0
offset_left = 3.0
offset_right = 177.0
offset_bottom = 20.0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 12
text = "Dialog Sheets"
[node name="BtnTogglePanel" type="TextureButton" parent="."]
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
offset_left = -24.0
offset_bottom = 24.0
texture_normal = ExtResource("4")
stretch_mode = 3
[connection signal="pressed" from="BtnTogglePanel" to="." method="_on_BtnTogglePanel_pressed"]

View File

@@ -0,0 +1,81 @@
[gd_scene load_steps=6 format=3 uid="uid://cc8hueicocet2"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="1"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="3"]
[ext_resource type="FontFile" uid="uid://cgfeudab78x0q" path="res://addons/madtalk/fonts/FreeSans.ttf" id="3_atm42"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/SheetItemStyle.tres" id="4"]
[sub_resource type="FontVariation" id="FontVariation_1s3xs"]
base_font = ExtResource("3_atm42")
spacing_top = -4
spacing_bottom = -4
[node name="SheetItem" type="Control"]
custom_minimum_size = Vector2(0, 48)
layout_mode = 3
anchors_preset = 0
offset_right = 200.0
offset_bottom = 48.0
[node name="Panel" type="Panel" parent="."]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 1.0
offset_top = 1.0
offset_right = -1.0
offset_bottom = -1.0
size_flags_horizontal = 3
theme_override_styles/panel = ExtResource("4")
[node name="BGTitleLine" type="ColorRect" parent="Panel"]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 4.0
offset_top = 17.0
offset_right = -4.0
offset_bottom = 19.0
grow_horizontal = 2
color = Color(1, 1, 1, 0.12549)
[node name="SheetLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 4.0
offset_top = 1.0
offset_right = 51.0
offset_bottom = 21.0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 10
text = "sheet_id"
[node name="DescriptionLabel" type="Label" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 4.0
offset_top = 20.0
offset_right = -3.0
offset_bottom = -2.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/font_color = Color(0.580392, 0.580392, 0.580392, 1)
theme_override_fonts/font = SubResource("FontVariation_1s3xs")
theme_override_font_sizes/font_size = 9
text = "Short sheet description"
autowrap_mode = 2
clip_text = true
[node name="BtnOpen" type="Button" parent="Panel"]
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
offset_left = -44.0
offset_top = 2.0
offset_right = -2.0
offset_bottom = 22.0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 10
theme_override_styles/normal = ExtResource("3")
text = "Open"

View File

@@ -0,0 +1,939 @@
[gd_scene load_steps=6 format=3 uid="uid://bxbv32bsgov7f"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="1_axotx"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="2_17q4f"]
[ext_resource type="PackedScene" uid="uid://dyepkyvo6sodg" path="res://addons/madtalk/components/BtnTip.tscn" id="3_pak78"]
[ext_resource type="FontFile" uid="uid://bhcws34lw0ak5" path="res://addons/madtalk/fonts/FreeSans_tiny.tres" id="4_4pido"]
[sub_resource type="StyleBoxFlat" id="1"]
bg_color = Color(0.186, 0.172, 0.2, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.06, 0.06, 0.06, 1)
border_blend = true
[node name="DialogEdit" type="Window"]
title = "Condition"
initial_position = 2
size = Vector2i(550, 400)
visible = false
transient = true
exclusive = true
popup_window = true
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_styles/panel = ExtResource("1_axotx")
[node name="Label" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 35.1291
offset_top = 32.5417
offset_right = 130.129
offset_bottom = 46.5417
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Condition Type"
[node name="BtnConditionType" type="OptionButton" parent="Panel"]
layout_mode = 0
anchor_right = 1.0
offset_left = 140.0
offset_top = 25.0
offset_right = -76.0
offset_bottom = 60.0
theme_override_fonts/font = ExtResource("2_17q4f")
item_count = 11
popup/item_0/text = "Random"
popup/item_0/id = 0
popup/item_1/text = "Variable True/False check"
popup/item_1/id = 1
popup/item_2/text = "Variable at least"
popup/item_2/id = 2
popup/item_3/text = "Variable under"
popup/item_3/id = 3
popup/item_4/text = "Variable equal"
popup/item_4/id = 4
popup/item_5/text = "Time range"
popup/item_5/id = 5
popup/item_6/text = "Day of Week range"
popup/item_6/id = 6
popup/item_7/text = "Day of Month range"
popup/item_7/id = 7
popup/item_8/text = "Date range"
popup/item_8/id = 8
popup/item_9/text = "Minutes elapsed since variable"
popup/item_9/id = 9
popup/item_10/text = "Custom condition"
popup/item_10/id = 10
[node name="BtnTip" parent="Panel" instance=ExtResource("3_pak78")]
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
offset_left = -41.599
offset_top = 44.1581
offset_right = -13.599
offset_bottom = 70.1581
[node name="SpecificFields" type="Panel" parent="Panel"]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 72.0
offset_right = -8.0
offset_bottom = -38.0
theme_override_styles/panel = SubResource("1")
[node name="Random" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/Random"]
layout_mode = 0
offset_left = 33.9795
offset_top = 33.0356
offset_right = 261.979
offset_bottom = 47.0356
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Chance of continuing the sequence:"
[node name="Label3" type="Label" parent="Panel/SpecificFields/Random"]
layout_mode = 0
offset_left = 33.9795
offset_top = 65.0356
offset_right = 261.979
offset_bottom = 79.0356
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/Random"]
layout_mode = 0
offset_left = 332.0
offset_top = 33.0
offset_right = 365.0
offset_bottom = 47.0
theme_override_fonts/font = ExtResource("2_17q4f")
text = "%"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/Random"]
layout_mode = 0
offset_left = 243.0
offset_top = 27.0
offset_right = 326.0
offset_bottom = 51.0
theme_override_fonts/font = ExtResource("2_17q4f")
placeholder_text = "e.g. 30.0"
[node name="VarBool" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/VarBool"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Variable named"
[node name="Label4" type="Label" parent="Panel/SpecificFields/VarBool"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 96.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue if:"
[node name="Label3" type="Label" parent="Panel/SpecificFields/VarBool"]
layout_mode = 0
offset_left = 33.9795
offset_top = 113.036
offset_right = 261.979
offset_bottom = 127.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/VarBool"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 178.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "is equal to"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/VarBool"]
layout_mode = 0
offset_left = 147.0
offset_top = 35.0
offset_right = 387.0
offset_bottom = 63.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
placeholder_text = "e.g. has_met_npc1"
[node name="Option1" type="OptionButton" parent="Panel/SpecificFields/VarBool"]
layout_mode = 0
offset_left = 149.0
offset_top = 69.0
offset_right = 338.0
offset_bottom = 89.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
item_count = 2
selected = 0
popup/item_0/text = "True (any non-zero numerical value)"
popup/item_0/id = 1
popup/item_1/text = "False (zero)"
popup/item_1/id = 0
[node name="VarAtLeast" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/VarAtLeast"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Variable named"
[node name="Label4" type="Label" parent="Panel/SpecificFields/VarAtLeast"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 96.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue if:"
[node name="Label3" type="Label" parent="Panel/SpecificFields/VarAtLeast"]
layout_mode = 0
offset_left = 33.9795
offset_top = 113.036
offset_right = 261.979
offset_bottom = 127.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/VarAtLeast"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 178.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "is equal or greater than"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/VarAtLeast"]
layout_mode = 0
offset_left = 147.0
offset_top = 35.0
offset_right = 339.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. player_health"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/VarAtLeast"]
layout_mode = 0
offset_left = 187.0
offset_top = 67.0
offset_right = 270.0
offset_bottom = 91.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 25.0"
[node name="VarUnder" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label5" type="Label" parent="Panel/SpecificFields/VarUnder"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 96.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue if:"
[node name="Label" type="Label" parent="Panel/SpecificFields/VarUnder"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Variable named"
[node name="Label3" type="Label" parent="Panel/SpecificFields/VarUnder"]
layout_mode = 0
offset_left = 33.9795
offset_top = 113.036
offset_right = 261.979
offset_bottom = 127.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/VarUnder"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 202.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "is less (and not equal) than "
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/VarUnder"]
layout_mode = 0
offset_left = 147.0
offset_top = 35.0
offset_right = 339.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. player_health"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/VarUnder"]
layout_mode = 0
offset_left = 210.056
offset_top = 66.0561
offset_right = 293.056
offset_bottom = 90.0561
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 25.0"
[node name="VarString" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label6" type="Label" parent="Panel/SpecificFields/VarString"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 96.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue if:"
[node name="Label" type="Label" parent="Panel/SpecificFields/VarString"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Variable named"
[node name="Label3" type="Label" parent="Panel/SpecificFields/VarString"]
layout_mode = 0
offset_left = 33.9795
offset_top = 113.036
offset_right = 261.979
offset_bottom = 127.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/VarString"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 202.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "contains the string"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/VarString"]
layout_mode = 0
offset_left = 160.0
offset_top = 35.0
offset_right = 367.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. player_location"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/VarString"]
layout_mode = 0
offset_left = 160.0
offset_top = 66.0
offset_right = 367.0
offset_bottom = 90.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. living_room"
[node name="Time" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label7" type="Label" parent="Panel/SpecificFields/Time"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 96.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue when:"
[node name="Label" type="Label" parent="Panel/SpecificFields/Time"]
layout_mode = 0
offset_left = 50.0
offset_top = 41.0
offset_right = 173.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "In-game time between"
[node name="Label4" type="Label" parent="Panel/SpecificFields/Time"]
layout_mode = 0
offset_left = 50.0
offset_top = 73.0
offset_right = 284.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "in any day (use 24h system - 17:00 instead of 5:00pm)"
[node name="Label3" type="Label" parent="Panel/SpecificFields/Time"]
layout_mode = 0
offset_left = 33.9795
offset_top = 113.036
offset_right = 261.979
offset_bottom = 127.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/Time"]
layout_mode = 0
offset_left = 276.0
offset_top = 41.0
offset_right = 297.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "and"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/Time"]
layout_mode = 0
offset_left = 184.0
offset_top = 35.0
offset_right = 264.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 08:00"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/Time"]
layout_mode = 0
offset_left = 312.0
offset_top = 35.0
offset_right = 392.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 17:00"
[node name="DayWeek" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label8" type="Label" parent="Panel/SpecificFields/DayWeek"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 120.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue when:"
[node name="Label" type="Label" parent="Panel/SpecificFields/DayWeek"]
layout_mode = 0
offset_left = 50.0
offset_top = 41.0
offset_right = 216.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "In-game day of week between"
[node name="Label4" type="Label" parent="Panel/SpecificFields/DayWeek"]
layout_mode = 0
offset_left = 50.0
offset_top = 65.0
offset_right = 216.0
offset_bottom = 79.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "(in every week)"
[node name="Label3" type="Label" parent="Panel/SpecificFields/DayWeek"]
layout_mode = 0
offset_left = 33.9795
offset_top = 105.036
offset_right = 261.979
offset_bottom = 119.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/DayWeek"]
layout_mode = 0
offset_left = 345.0
offset_top = 41.0
offset_right = 366.0
offset_bottom = 64.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "and"
[node name="Option0" type="OptionButton" parent="Panel/SpecificFields/DayWeek"]
layout_mode = 0
offset_left = 230.0
offset_top = 36.795
offset_right = 336.0
offset_bottom = 64.795
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
item_count = 7
selected = 0
popup/item_0/text = "Sunday"
popup/item_0/id = 0
popup/item_1/text = "Monday"
popup/item_1/id = 1
popup/item_2/text = "Tuesday"
popup/item_2/id = 2
popup/item_3/text = "Wednesday"
popup/item_3/id = 3
popup/item_4/text = "Thursday"
popup/item_4/id = 4
popup/item_5/text = "Friday"
popup/item_5/id = 5
popup/item_6/text = "Saturday"
popup/item_6/id = 6
[node name="Option1" type="OptionButton" parent="Panel/SpecificFields/DayWeek"]
layout_mode = 0
offset_left = 374.75
offset_top = 36.795
offset_right = 480.75
offset_bottom = 67.795
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
item_count = 7
selected = 0
popup/item_0/text = "Sunday"
popup/item_0/id = 0
popup/item_1/text = "Monday"
popup/item_1/id = 1
popup/item_2/text = "Tuesday"
popup/item_2/id = 2
popup/item_3/text = "Wednesday"
popup/item_3/id = 3
popup/item_4/text = "Thursday"
popup/item_4/id = 4
popup/item_5/text = "Friday"
popup/item_5/id = 5
popup/item_6/text = "Saturday"
popup/item_6/id = 6
[node name="DayMonth" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label9" type="Label" parent="Panel/SpecificFields/DayMonth"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 120.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue when:"
[node name="Label" type="Label" parent="Panel/SpecificFields/DayMonth"]
layout_mode = 0
offset_left = 50.0
offset_top = 41.0
offset_right = 218.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "In-game day of month between"
[node name="Label4" type="Label" parent="Panel/SpecificFields/DayMonth"]
layout_mode = 0
offset_left = 50.0
offset_top = 65.0
offset_right = 218.0
offset_bottom = 79.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "(in every month)"
[node name="Label5" type="Label" parent="Panel/SpecificFields/DayMonth"]
layout_mode = 0
offset_left = 50.0
offset_top = 87.0
offset_right = 257.0
offset_bottom = 101.0
theme_override_fonts/font = ExtResource("4_4pido")
theme_override_font_sizes/font_size = 12
text = "For a single day, use same number on both fields"
[node name="Label3" type="Label" parent="Panel/SpecificFields/DayMonth"]
layout_mode = 0
offset_left = 33.9795
offset_top = 121.036
offset_right = 261.979
offset_bottom = 135.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/DayMonth"]
layout_mode = 0
offset_left = 292.0
offset_top = 41.0
offset_right = 313.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "and"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/DayMonth"]
layout_mode = 0
offset_left = 224.0
offset_top = 35.0
offset_right = 284.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 1"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/DayMonth"]
layout_mode = 0
offset_left = 320.0
offset_top = 35.0
offset_right = 380.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 30"
[node name="Date" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label10" type="Label" parent="Panel/SpecificFields/Date"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 120.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue when:"
[node name="Label" type="Label" parent="Panel/SpecificFields/Date"]
layout_mode = 0
offset_left = 50.0
offset_top = 41.0
offset_right = 173.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "In-game date between"
[node name="Label4" type="Label" parent="Panel/SpecificFields/Date"]
layout_mode = 0
offset_left = 50.0
offset_top = 73.0
offset_right = 347.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "(Format is DD/MM and applies for every in-game year.)"
[node name="Label3" type="Label" parent="Panel/SpecificFields/Date"]
layout_mode = 0
offset_left = 33.9795
offset_top = 113.036
offset_right = 261.979
offset_bottom = 127.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/Date"]
layout_mode = 0
offset_left = 272.0
offset_top = 41.0
offset_right = 293.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "and"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/Date"]
layout_mode = 0
offset_left = 180.0
offset_top = 35.0
offset_right = 260.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 25/01"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/Date"]
layout_mode = 0
offset_left = 304.0
offset_top = 35.0
offset_right = 384.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 31/12"
[node name="ElapsedVar" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label11" type="Label" parent="Panel/SpecificFields/ElapsedVar"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 120.0
offset_bottom = 31.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue when:"
[node name="Label" type="Label" parent="Panel/SpecificFields/ElapsedVar"]
layout_mode = 0
offset_left = 50.0
offset_top = 41.0
offset_right = 133.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "In-game time is"
[node name="Label3" type="Label" parent="Panel/SpecificFields/ElapsedVar"]
layout_mode = 0
offset_left = 33.9795
offset_top = 113.036
offset_right = 261.979
offset_bottom = 127.036
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Otherwise the dialog will branch out."
[node name="Label2" type="Label" parent="Panel/SpecificFields/ElapsedVar"]
layout_mode = 0
offset_left = 212.0
offset_top = 41.0
offset_right = 353.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "minutes later than the time value"
[node name="Label4" type="Label" parent="Panel/SpecificFields/ElapsedVar"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 202.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "timestamped in the variable"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/ElapsedVar"]
layout_mode = 0
offset_left = 141.0
offset_top = 35.0
offset_right = 201.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 30"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/ElapsedVar"]
layout_mode = 0
offset_left = 211.0
offset_top = 67.0
offset_right = 403.0
offset_bottom = 91.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. time_entered_room"
[node name="Custom" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label6" type="Label" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 34.0
offset_top = 17.0
offset_right = 103.0
offset_bottom = 40.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Continue on:"
[node name="Label" type="Label" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "Custom condition code for ID"
[node name="Label3" type="Label" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 33.979
offset_top = 220.0
offset_right = 394.979
offset_bottom = 243.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "If custom condition handler returns false, the dialog will branch out."
[node name="Label4" type="Label" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 52.0
offset_top = 65.0
offset_right = 193.0
offset_bottom = 79.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
text = "called with the data:"
[node name="Label5" type="Label" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 52.0
offset_top = 82.0
offset_right = 253.0
offset_bottom = 90.0
theme_override_fonts/font = ExtResource("4_4pido")
theme_override_font_sizes/font_size = 12
text = "(Each line will be passed as a string in an Array)"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 219.0
offset_top = 35.0
offset_right = 393.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. combat"
[node name="EditValue1" type="TextEdit" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 52.0
offset_top = 110.0
offset_right = 411.0
offset_bottom = 186.0
theme_override_fonts/font = ExtResource("2_17q4f")
theme_override_font_sizes/font_size = 12
placeholder_text = "e.g.: arena1
monster_b"
highlight_current_line = true
draw_tabs = true
caret_blink = true
[node name="BottomBar" type="Control" parent="Panel"]
anchors_preset = 0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -24.0
[node name="BtnSave" type="Button" parent="Panel/BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -100.5
offset_top = -10.0
offset_right = -59.5
offset_bottom = 10.0
focus_mode = 0
theme_override_font_sizes/font_size = 12
text = "OK"
[node name="BtnCancel" type="Button" parent="Panel/BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 53.0
offset_top = -10.0
offset_right = 107.0
offset_bottom = 10.0
focus_mode = 0
theme_override_font_sizes/font_size = 12
text = "Cancel"

View File

@@ -0,0 +1,31 @@
[gd_scene load_steps=5 format=3 uid="uid://m0muqdnnedcu"]
[ext_resource type="Texture2D" uid="uid://ccd654fnsh312" path="res://addons/madtalk/images/icon_edit.png" id="1"]
[ext_resource type="Texture2D" uid="uid://6iclvaqbm5dl" path="res://addons/madtalk/images/icon_up.png" id="2"]
[ext_resource type="Texture2D" uid="uid://c4xg8811uuoq6" path="res://addons/madtalk/images/icon_down.png" id="3"]
[ext_resource type="Texture2D" uid="uid://dxgulu8lvnwrr" path="res://addons/madtalk/images/icon_x.png" id="4"]
[node name="PopupMenu" type="PopupMenu"]
position = Vector2i(0, 36)
size = Vector2i(136, 124)
item_count = 6
item_0/text = "Edit"
item_0/icon = ExtResource("1")
item_0/id = 0
item_1/text = ""
item_1/id = -1
item_1/disabled = true
item_1/separator = true
item_2/text = "Move Up"
item_2/icon = ExtResource("2")
item_2/id = 1
item_3/text = "Move Down"
item_3/icon = ExtResource("3")
item_3/id = 2
item_4/text = ""
item_4/id = -1
item_4/disabled = true
item_4/separator = true
item_5/text = "Remove"
item_5/icon = ExtResource("4")
item_5/id = 3

View File

@@ -0,0 +1,641 @@
[gd_scene load_steps=6 format=3 uid="uid://cip2u1he5glxt"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="1_m0nlj"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="2_wad08"]
[ext_resource type="PackedScene" uid="uid://dyepkyvo6sodg" path="res://addons/madtalk/components/BtnTip.tscn" id="3_62c5d"]
[ext_resource type="FontFile" uid="uid://bhcws34lw0ak5" path="res://addons/madtalk/fonts/FreeSans_tiny.tres" id="4_c5vhq"]
[sub_resource type="StyleBoxFlat" id="1"]
bg_color = Color(0.186, 0.172, 0.2, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.06, 0.06, 0.06, 1)
border_blend = true
[node name="DialogEdit" type="Window"]
title = "Effect"
initial_position = 2
size = Vector2i(500, 400)
visible = false
transient = true
exclusive = true
popup_window = true
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_styles/panel = ExtResource("1_m0nlj")
[node name="Label" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 35.0
offset_top = 33.0
offset_right = 108.0
offset_bottom = 47.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Effect Type"
[node name="BtnEffectType" type="OptionButton" parent="Panel"]
layout_mode = 0
anchor_right = 1.0
offset_left = 112.0
offset_top = 25.0
offset_right = -76.0
offset_bottom = 60.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
item_count = 11
popup/item_0/text = "Change Sheet"
popup/item_0/id = 0
popup/item_1/text = "Set Variable"
popup/item_1/id = 1
popup/item_2/text = "Add Variable"
popup/item_2/id = 2
popup/item_3/text = "Randomize Variable"
popup/item_3/id = 3
popup/item_4/text = "Stamp Time"
popup/item_4/id = 4
popup/item_5/text = "Spend Minutes"
popup/item_5/id = 5
popup/item_6/text = "Spend Days"
popup/item_6/id = 6
popup/item_7/text = "Skip to Given Time"
popup/item_7/id = 7
popup/item_8/text = "Skip to Given Weekday"
popup/item_8/id = 8
popup/item_9/text = "Play Animation and Wait"
popup/item_9/id = 9
popup/item_10/text = "Custom Effect"
popup/item_10/id = 10
[node name="BtnTip" parent="Panel" instance=ExtResource("3_62c5d")]
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
offset_left = -41.599
offset_top = 44.1581
offset_right = -13.599
offset_bottom = 70.1581
[node name="SpecificFields" type="Panel" parent="Panel"]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 72.0
offset_right = -8.0
offset_bottom = -38.0
theme_override_styles/panel = SubResource("1")
[node name="ChangeSheet" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/ChangeSheet"]
layout_mode = 0
offset_left = 33.9795
offset_top = 33.0356
offset_right = 261.979
offset_bottom = 47.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Stop this sequence and change to dialog sheet:"
[node name="Label3" type="Label" parent="Panel/SpecificFields/ChangeSheet"]
layout_mode = 0
offset_left = 33.9795
offset_top = 145.036
offset_right = 317.979
offset_bottom = 159.036
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "(Items in current sequence below this effect will not run.)"
[node name="Label2" type="Label" parent="Panel/SpecificFields/ChangeSheet"]
layout_mode = 0
offset_left = 33.9795
offset_top = 97.0356
offset_right = 291.979
offset_bottom = 111.036
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Optional: start the dialog in sequence ID"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/ChangeSheet"]
layout_mode = 0
offset_left = 35.0
offset_top = 56.0
offset_right = 394.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. city_arrival"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/ChangeSheet"]
layout_mode = 0
offset_left = 260.0
offset_top = 91.0
offset_right = 391.0
offset_bottom = 115.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
text = "0"
placeholder_text = "Start is always zero"
[node name="SetVariable" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/SetVariable"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Set variable named"
[node name="Label2" type="Label" parent="Panel/SpecificFields/SetVariable"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 178.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "to the fixed value"
[node name="Label3" type="Label" parent="Panel/SpecificFields/SetVariable"]
layout_mode = 0
offset_left = 172.0
offset_top = 121.0
offset_right = 298.0
offset_bottom = 135.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "To use this variable in True/False checks,
enter the number:
True: 1 (or any non-zero number)
False: 0
"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/SetVariable"]
layout_mode = 0
offset_left = 166.0
offset_top = 35.0
offset_right = 371.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. player_health"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/SetVariable"]
layout_mode = 0
offset_left = 166.0
offset_top = 69.0
offset_right = 249.0
offset_bottom = 100.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 25.0"
[node name="AddVariable" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/AddVariable"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Add to variable named"
[node name="Label2" type="Label" parent="Panel/SpecificFields/AddVariable"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 178.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "the value (can be negative for subtraction)"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/AddVariable"]
layout_mode = 0
offset_left = 182.0
offset_top = 34.0
offset_right = 387.0
offset_bottom = 65.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. player_health"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/AddVariable"]
layout_mode = 0
offset_left = 303.0
offset_top = 67.0
offset_right = 386.0
offset_bottom = 91.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 25.0"
[node name="RandomizeVariable" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/RandomizeVariable"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Set variable named"
[node name="Label2" type="Label" parent="Panel/SpecificFields/RandomizeVariable"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 200.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "to a random value between"
[node name="Label4" type="Label" parent="Panel/SpecificFields/RandomizeVariable"]
layout_mode = 0
offset_left = 52.0
offset_top = 89.0
offset_right = 200.0
offset_bottom = 103.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "(inclusive)"
[node name="Label3" type="Label" parent="Panel/SpecificFields/RandomizeVariable"]
layout_mode = 0
offset_left = 294.0
offset_top = 73.0
offset_right = 315.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "and"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/RandomizeVariable"]
layout_mode = 0
offset_left = 182.0
offset_top = 32.0
offset_right = 387.0
offset_bottom = 67.0
theme_override_fonts/font = ExtResource("2_wad08")
placeholder_text = "e.g. npc1_love"
[node name="EditValue1" type="LineEdit" parent="Panel/SpecificFields/RandomizeVariable"]
layout_mode = 0
offset_left = 221.0
offset_top = 69.0
offset_right = 282.313
offset_bottom = 104.0
theme_override_fonts/font = ExtResource("2_wad08")
placeholder_text = "e.g. -5.0"
[node name="EditValue2" type="LineEdit" parent="Panel/SpecificFields/RandomizeVariable"]
layout_mode = 0
offset_left = 329.0
offset_top = 69.0
offset_right = 390.313
offset_bottom = 104.0
theme_override_fonts/font = ExtResource("2_wad08")
placeholder_text = "e.g. 10.0"
[node name="StampTime" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/StampTime"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Timestamp current in-game time value"
[node name="Label2" type="Label" parent="Panel/SpecificFields/StampTime"]
layout_mode = 0
offset_left = 52.0
offset_top = 73.0
offset_right = 200.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "to a variable named"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/StampTime"]
layout_mode = 0
offset_left = 182.0
offset_top = 67.0
offset_right = 387.0
offset_bottom = 91.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. player_entered_room3"
[node name="SpendMinutes" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/SpendMinutes"]
layout_mode = 0
offset_left = 65.9795
offset_top = 41.0356
offset_right = 293.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Advance current in-game time in"
[node name="Label2" type="Label" parent="Panel/SpecificFields/SpendMinutes"]
layout_mode = 0
offset_left = 180.0
offset_top = 73.0
offset_right = 328.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "minutes"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/SpendMinutes"]
layout_mode = 0
offset_left = 62.0
offset_top = 67.0
offset_right = 169.0
offset_bottom = 91.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 15"
[node name="SpendDays" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/SpendDays"]
layout_mode = 0
offset_left = 65.9795
offset_top = 41.0356
offset_right = 293.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Advance current in-game time in"
[node name="Label2" type="Label" parent="Panel/SpecificFields/SpendDays"]
layout_mode = 0
offset_left = 180.0
offset_top = 73.0
offset_right = 328.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "days"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/SpendDays"]
layout_mode = 0
offset_left = 62.0
offset_top = 67.0
offset_right = 169.0
offset_bottom = 91.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 2"
[node name="SkipToTime" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/SkipToTime"]
layout_mode = 0
offset_left = 66.0
offset_top = 41.0
offset_right = 274.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Advance in-game time until the time is"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/SkipToTime"]
layout_mode = 0
offset_left = 280.0
offset_top = 35.0
offset_right = 371.0
offset_bottom = 59.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. 07:00"
[node name="SkipToWeekday" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/SkipToWeekday"]
layout_mode = 0
offset_left = 66.0
offset_top = 41.0
offset_right = 274.0
offset_bottom = 55.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Advance in-game time until the weekday is"
[node name="Label2" type="Label" parent="Panel/SpecificFields/SkipToWeekday"]
layout_mode = 0
offset_left = 66.0
offset_top = 73.0
offset_right = 355.0
offset_bottom = 87.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Time will be set to 00:00 (beginning of the given day)."
[node name="Option0" type="OptionButton" parent="Panel/SpecificFields/SkipToWeekday"]
layout_mode = 0
offset_left = 306.657
offset_top = 36.795
offset_right = 377.657
offset_bottom = 56.795
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
item_count = 7
popup/item_0/text = "Sunday"
popup/item_0/id = 0
popup/item_1/text = "Monday"
popup/item_1/id = 1
popup/item_2/text = "Tuesday"
popup/item_2/id = 2
popup/item_3/text = "Wednesday"
popup/item_3/id = 3
popup/item_4/text = "Thursday"
popup/item_4/id = 4
popup/item_5/text = "Friday"
popup/item_5/id = 5
popup/item_6/text = "Saturday"
popup/item_6/id = 6
[node name="WaitAnim" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/WaitAnim"]
layout_mode = 0
offset_left = 65.9795
offset_top = 41.0356
offset_right = 293.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Play animation named"
[node name="Label2" type="Label" parent="Panel/SpecificFields/WaitAnim"]
layout_mode = 0
offset_left = 66.0
offset_top = 73.0
offset_right = 361.0
offset_bottom = 100.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "from the Effects AnimationPlayer set in the MadTalk node,
and wait for it to finish before continuing the sequence."
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/WaitAnim"]
layout_mode = 0
offset_left = 202.0
offset_top = 33.0
offset_right = 350.0
offset_bottom = 57.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. first_cutscene"
[node name="Custom" type="Control" parent="Panel/SpecificFields"]
visible = false
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Label" type="Label" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 49.9795
offset_top = 41.0356
offset_right = 277.979
offset_bottom = 55.0356
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "Custom effect code for ID"
[node name="Label4" type="Label" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 52.0
offset_top = 70.0
offset_right = 193.0
offset_bottom = 93.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
text = "called with the data:"
[node name="Label5" type="Label" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 52.0
offset_top = 89.0
offset_right = 308.0
offset_bottom = 112.0
theme_override_fonts/font = ExtResource("4_c5vhq")
theme_override_font_sizes/font_size = 12
text = "(Each line will be passed as a string in an Array)"
[node name="EditValue0" type="LineEdit" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 196.0
offset_top = 34.0
offset_right = 392.0
offset_bottom = 58.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 14
placeholder_text = "e.g. give_item"
[node name="EditValue1" type="TextEdit" parent="Panel/SpecificFields/Custom"]
layout_mode = 0
offset_left = 52.0
offset_top = 114.0
offset_right = 411.0
offset_bottom = 190.0
theme_override_fonts/font = ExtResource("2_wad08")
theme_override_font_sizes/font_size = 12
highlight_current_line = true
draw_tabs = true
caret_blink = true
[node name="BottomBar" type="Control" parent="Panel"]
anchors_preset = 0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -24.0
[node name="BtnSave" type="Button" parent="Panel/BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -100.5
offset_top = -10.0
offset_right = -59.5
offset_bottom = 10.0
focus_mode = 0
text = "OK"
[node name="BtnCancel" type="Button" parent="Panel/BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 53.0
offset_top = -10.0
offset_right = 107.0
offset_bottom = 10.0
focus_mode = 0
text = "Cancel"

View File

@@ -0,0 +1,269 @@
[gd_scene load_steps=9 format=3 uid="uid://cy4tp1rk7owe8"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/PanelStyle.tres" id="1_ebfqh"]
[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="2_yr8qn"]
[ext_resource type="PackedScene" uid="uid://dyepkyvo6sodg" path="res://addons/madtalk/components/BtnTip.tscn" id="3_fqggi"]
[ext_resource type="PackedScene" uid="uid://dc46jny8nbbow" path="res://addons/madtalk/components/MessageEditorWithLocales.tscn" id="4_b66sd"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="4_w10ta"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_italic_small.tres" id="5_ypyua"]
[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bolditalic_small.tres" id="6_u7epw"]
[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/RichLabelPreviewAlphaStyle.tres" id="7_3pci6"]
[node name="DialogEdit" type="Window"]
initial_position = 2
size = Vector2i(750, 550)
exclusive = true
popup_window = true
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_styles/panel = ExtResource("1_ebfqh")
[node name="SpeakerLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 23.0
offset_top = 16.0
offset_right = 92.0
offset_bottom = 30.0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 12
text = "Speaker ID"
[node name="SpeakerEdit" type="LineEdit" parent="Panel"]
layout_mode = 0
anchor_right = 0.5
offset_left = 92.0
offset_top = 12.0
offset_right = -28.0
offset_bottom = 36.0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 14
placeholder_text = "string id for the character "
[node name="TipSpeaker" parent="Panel" instance=ExtResource("3_fqggi")]
layout_mode = 0
anchor_left = 0.5
anchor_right = 0.5
offset_left = -24.0627
offset_top = 12.1479
offset_right = 3.93732
offset_bottom = 34.1479
tip_title = "Speaker ID"
tip_text = "The speaker ID is a string identifying the character speaking the message. It is used to show the avatar and name.
You have to configure the avatar and name separately."
[node name="VariantLabel" type="Label" parent="Panel"]
layout_mode = 0
anchor_left = 0.5
anchor_right = 0.5
offset_left = 23.0
offset_top = 16.0
offset_right = 92.0
offset_bottom = 30.0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 12
text = "Variant"
[node name="VariantEdit" type="LineEdit" parent="Panel"]
layout_mode = 0
anchor_left = 0.5
anchor_right = 1.0
offset_left = 72.0
offset_top = 12.0
offset_right = -56.0
offset_bottom = 36.0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 14
placeholder_text = "avatar variant - leave blank for default"
[node name="TipVariant" parent="Panel" instance=ExtResource("3_fqggi")]
layout_mode = 0
anchor_left = 1.0
anchor_right = 1.0
offset_left = -52.5627
offset_top = 12.1479
offset_right = -24.5627
offset_bottom = 34.1479
tip_title = "Avatar Variant"
tip_text = "The avatar variant is a string identifying an alternate texture ID for the character avatar. If specified, a texture with this ID will be used instead of the default one. You have to configure the avatar variants separately.
This is used mainly for emotions, so different images can be used for \"angry\", \"happy\", \"sad\", etc, but since the IDs and their interpretations are up to you, they can be anything - e.g. different clothes, different background scenarios, etc."
[node name="BtnHideOnEnd" type="CheckButton" parent="Panel"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -346.0
offset_top = 49.0
offset_right = -55.0
offset_bottom = 89.0
grow_horizontal = 0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 12
text = "Force hiding message before next item"
[node name="TipHideOnEnd" parent="Panel" instance=ExtResource("3_fqggi")]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -52.0627
offset_top = 58.1479
offset_right = -24.0627
offset_bottom = 82.1479
grow_horizontal = 0
tip_title = "Hide Before Next Item"
tip_text = "During a dialog session, messages usually stay on screen when the next item is not another message - including menus, animations and custom effects. This is to allow the player to review the last message before selecting an option, and to allow narration over cutscenes. Text messages are replaced when next item is another message, and hidden in the very end of the dialog session.
Selecting this option forces the message box to hide when processing the next item even if it would normally stay visible. Useful if the menu is not related to the last message, or if you want animations without any text on screen."
[node name="MessageLabel" type="Label" parent="Panel"]
layout_mode = 0
offset_left = 23.0
offset_top = 73.0
offset_right = 182.0
offset_bottom = 93.0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 12
text = "Message (BB Code allowed):"
[node name="MessageEditor" parent="Panel" instance=ExtResource("4_b66sd")]
layout_mode = 0
anchors_preset = 0
anchor_right = 0.0
anchor_bottom = 0.0
offset_left = 16.0
offset_top = 97.0
offset_right = 734.0
offset_bottom = 350.0
grow_horizontal = 1
grow_vertical = 1
[node name="PreviewLabel" type="Label" parent="Panel"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 22.68
offset_top = -175.305
offset_right = 181.68
offset_bottom = -152.305
grow_vertical = 0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 12
text = "Message Preview"
[node name="BtnTextColor" type="ColorPickerButton" parent="Panel"]
layout_mode = 0
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -441.0
offset_top = -175.305
offset_right = -377.0
offset_bottom = -155.305
toggle_mode = false
expand_icon = true
color = Color(1, 1, 1, 1)
edit_alpha = false
[node name="TextColorLabel" type="Label" parent="Panel/BtnTextColor"]
layout_mode = 0
offset_left = 69.0
offset_right = 228.0
offset_bottom = 23.0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 12
text = "Default Text Color"
[node name="BtnBGColor" type="ColorPickerButton" parent="Panel"]
layout_mode = 0
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -250.0
offset_top = -175.305
offset_right = -186.0
offset_bottom = -155.305
toggle_mode = false
expand_icon = true
edit_alpha = false
[node name="TextColorLabel" type="Label" parent="Panel/BtnBGColor"]
layout_mode = 0
offset_left = 69.0
offset_right = 228.0
offset_bottom = 23.0
theme_override_fonts/font = ExtResource("2_yr8qn")
theme_override_font_sizes/font_size = 12
text = "Background Color"
[node name="PreviewBox" type="ColorRect" parent="Panel"]
layout_mode = 0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 16.0
offset_top = -153.215
offset_right = -16.0
offset_bottom = -32.215
color = Color(0, 0, 0, 1)
[node name="PreviewLabel" type="RichTextLabel" parent="Panel/PreviewBox"]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.8909
offset_right = -8.0
offset_bottom = -7.1091
theme_override_colors/default_color = Color(1, 1, 1, 1)
theme_override_fonts/normal_font = ExtResource("2_yr8qn")
theme_override_fonts/italics_font = ExtResource("5_ypyua")
theme_override_fonts/bold_italics_font = ExtResource("6_u7epw")
theme_override_fonts/bold_font = ExtResource("4_w10ta")
theme_override_styles/normal = ExtResource("7_3pci6")
bbcode_enabled = true
[node name="PreviewTimer" type="Timer" parent="Panel/PreviewBox"]
wait_time = 0.5
one_shot = true
[node name="BottomBar" type="Control" parent="Panel"]
anchors_preset = 0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -33.51
offset_bottom = -9.51001
[node name="BtnSave" type="Button" parent="Panel/BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -100.5
offset_top = -10.0
offset_right = -59.5
offset_bottom = 10.0
focus_mode = 0
text = "OK"
[node name="BtnCancel" type="Button" parent="Panel/BottomBar"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 53.0
offset_top = -10.0
offset_right = 107.0
offset_bottom = 10.0
focus_mode = 0
text = "Cancel"

View File

@@ -0,0 +1,12 @@
[gd_scene format=3 uid="uid://dhf1etqkj85p"]
[node name="VoiceClipDialog" type="FileDialog"]
title = "Load voice clip"
initial_position = 2
size = Vector2i(600, 500)
popup_window = true
ok_button_text = "Open"
dialog_hide_on_ok = true
mode_overrides_title = false
file_mode = 0
filters = PackedStringArray("*.wav; WAV files", "*.ogg; OGG clips")

View File

@@ -0,0 +1,12 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 0.2883, 0.2666, 0.31, 1 )
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color( 0.1, 0.1, 0.1, 1 )
border_blend = true
shadow_color = Color( 0, 0, 0, 0.12549 )
shadow_size = 2

View File

@@ -0,0 +1,31 @@
@tool
extends Resource
class_name DialogData
# This Resource is the top container of all the dialog data in the game
# It contains sheets, each sheet contains sequences, each sequence contains
# items and options
#
# DialogData
# |- DialogSheetData -> e.g. sheet_id = "npc1_shop"
# | |- DialogNodeData -> e.g. ID=0 - START (options are inside)
# | | |- DialogNodeItemData -> e.g. welcome message
# | | |- DialogNodeItemData -> e.g. some condition
# | | '- DialogNodeItemData -> e.g. some effects
# | |- DialogNodeData -> e.g. ID=1 (e.g. some item purchase)
# | | |- DialogNodeItemData -> e.g. thank you message
# | | |- DialogNodeItemData -> e.g. effect to buy item
# | | ...
# | ...
# |- DialogSheetData -> e.g. dialog in some other context
# ...
# Version number will be used in the future to convert databases to newer
# versions. This is necessary since conditions and effects are based on
# enums (and therefore int's) and adding new items might potentially break
# existing designs
@export var version: float = 1.0
# Dictionary keys are strings
# Dictionary values are DialogSheetData resource
@export var sheets: Dictionary = {}

View File

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

View File

@@ -0,0 +1,17 @@
@tool
extends Resource
class_name DialogNodeData
# This Resource refers to an entire dialog sequence (graphical node),
# and does not include sub-items
# It is used to define sequence ID and option buttons
@export var sequence_id: int = 0
@export var position: Vector2 = Vector2(0,0)
@export var comment: String = ""
@export var items = [] # (Array, Resource)
@export var options = [] # (Array, Resource)
@export var continue_sequence_id: int = -1
@export var continue_port_index: int = -1

View File

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

View File

@@ -0,0 +1,73 @@
@tool
extends Resource
class_name DialogNodeItemData
# This resource is variant and is shared across all node item types
# Properties which are not applicable are just ignored
enum ItemTypes {
Message, # Basic item, displays a dialog message
Condition, # Condition to branch out
Effect # Effect causing a change to some in-game state
}
# Type of item (message, condition or effect)
@export var item_type: ItemTypes = ItemTypes.Message
# To what sequence id this item is connected (only valid for condition)
@export var connected_to_id: int = -1
# Holds the GraphNode port index for this item
var port_index : int = -1
# ==============================================================================
# USED BY TYPE: MESSAGE
@export var message_speaker_id: String = ""
@export var message_speaker_variant: String = ""
# For compatibility reasons, default names are associated with the default
# language - that is, if locale isn't specified.
@export var message_voice_clip: String = "" # Default locale
@export_multiline var message_text := "" # Default locale
# Localised versions go on separate properties
@export var message_voice_clip_locales: Dictionary = {}
@export var message_text_locales: Dictionary = {}
@export var message_hide_on_end: int = 0
func get_localized_text() -> String:
var locale = MadTalkGlobals.current_locale
if locale == "":
return message_text
elif (locale in message_text_locales):
return message_text_locales[locale]
else:
return message_text
func get_localized_voice_clip() -> String:
var locale = MadTalkGlobals.current_locale
if locale == "":
return message_voice_clip
elif (locale in message_voice_clip_locales):
return message_voice_clip_locales[locale]
else:
return message_voice_clip
# ==============================================================================
# USED BY TYPE: CONDITION
@export var condition_type := MTDefs.ConditionTypes.Custom # (MTDefs.ConditionTypes)
@export var condition_values: Array = []
# ==============================================================================
# USED BY TYPE: EFFECT
@export var effect_type := MTDefs.EffectTypes.Custom # (MTDefs.EffectTypes)
@export var effect_values: Array = []

View File

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

View File

@@ -0,0 +1,57 @@
@tool
extends Resource
class_name DialogNodeOptionData
enum AutodisableModes {
NEVER,
RESET_ON_SHEET_RUN,
ALWAYS
}
enum InactiveMode {
DISABLED,
HIDDEN
}
## Text shown in the button, default locale
@export var text: String = ""
## Text shown in the button, other locales
@export var text_locales: Dictionary = {}
## To what sequence id this option is connected
@export var connected_to_id: int = -1
# Holds the GraphNode port index for this item
var port_index : int = -1
## If option visibility is conditional
@export var is_conditional: bool = false
## Variable name
@export var condition_variable: String = ""
## Condition operator ("=", "!=", ">", "<", ">=", "<=")
## This version keeps it as string for code simplicity
@export var condition_operator: String = "="
## Variable value - if the string is a valid number, value is the number itself
## otherwise (if it's a text String) it's the variable name to compare to
@export var condition_value: String = ""
## If the option auto-disables itself after selected
@export var autodisable_mode := AutodisableModes.NEVER
## How the option is handled when it's not active
@export var inactive_mode := InactiveMode.DISABLED
func get_localized_text() -> String:
var locale = MadTalkGlobals.current_locale
if locale == "":
return text
elif (locale in text_locales):
return text_locales[locale]
else:
return text

View File

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

View File

@@ -0,0 +1,22 @@
@tool
extends Resource
class_name DialogSheetData
# This resource contains a sheet of dialog, consisting of interconnected nodes
# Each node is a DialogNodeData
#
# E.g.
# DialogSheetData -> e.g. sheet_id = "npc1_shop"
# |- DialogNodeData -> e.g. ID=0 - START (options are inside)
# | |- DialogNodeItemData -> e.g. welcome message
# | |- DialogNodeItemData -> e.g. some condition
# | '- DialogNodeItemData -> e.g. some effects
# |- DialogNodeData -> e.g. ID=1 (e.g. some item purchase)
# | |- DialogNodeItemData -> e.g. thank you message
# | |- DialogNodeItemData -> e.g. effect to buy item
# | ...
@export var sheet_id: String = ""
@export var sheet_description: String = ""
@export var next_sequence_id: int = 0
@export var nodes: Array = [] # "nodes" as in dialog node, not Godot Node # (Array, Resource)

View File

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

View File

@@ -0,0 +1,10 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 0.20055, 0.1911, 0.21, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.06, 0.06, 0.06, 1 )
border_blend = true

View File

@@ -0,0 +1,12 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
content_margin_left = 4.0
content_margin_right = 4.0
bg_color = Color( 0.1116, 0.1032, 0.12, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.06, 0.06, 0.06, 1 )
border_blend = true

View File

@@ -0,0 +1,10 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dk8cb0qbpag2d"]
[resource]
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.403922, 0.396078, 0.396078, 1)
border_blend = true
expand_margin_left = 2.0

View File

@@ -0,0 +1,16 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dgwdu67tftiqs"]
[resource]
content_margin_left = 8.0
content_margin_top = 22.0
content_margin_right = 8.0
content_margin_bottom = 4.0
bg_color = Color(0.186, 0.172, 0.2, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.06, 0.06, 0.06, 1)
border_blend = true
corner_detail = 1
shadow_size = 4

View File

@@ -0,0 +1,10 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 0.1581, 0.1462, 0.17, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.06, 0.06, 0.06, 1 )
border_blend = true

View File

@@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 1, 1, 1, 0 )

View File

@@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 0.733333, 0.733333, 0.733333, 1 )

View File

@@ -0,0 +1,14 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
content_margin_bottom = 0.0
bg_color = Color( 0.22432, 0.2064, 0.24, 1 )
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color( 0.109804, 0.109804, 0.109804, 1 )
border_blend = true

View File

@@ -0,0 +1,10 @@
[gd_resource type="FontFile" load_steps=2 format=2]
[ext_resource path="res://addons/madtalk/fonts/FreeSans.ttf" type="FontFile" id=1]
[resource]
use_mipmaps = true
use_filter = true
extra_spacing_top = -4
extra_spacing_bottom = -4
font_data = ExtResource( 1 )

Binary file not shown.

View File

@@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://cgfeudab78x0q"
path="res://.godot/imported/FreeSans.ttf-c49e2aab0150370181d9b2212b6b9e07.fontdata"
[deps]
source_file="res://addons/madtalk/fonts/FreeSans.ttf"
dest_files=["res://.godot/imported/FreeSans.ttf-c49e2aab0150370181d9b2212b6b9e07.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

Binary file not shown.

View File

@@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://c8t8f2e12iwo6"
path="res://.godot/imported/FreeSansBold.ttf-b8ffbd5147894f3e41ee0f2feb937849.fontdata"
[deps]
source_file="res://addons/madtalk/fonts/FreeSansBold.ttf"
dest_files=["res://.godot/imported/FreeSansBold.ttf-b8ffbd5147894f3e41ee0f2feb937849.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

Binary file not shown.

View File

@@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://b0p0wjgy1i2k2"
path="res://.godot/imported/FreeSansBoldOblique.ttf-643172fd931b6b5de5f8b69845858859.fontdata"
[deps]
source_file="res://addons/madtalk/fonts/FreeSansBoldOblique.ttf"
dest_files=["res://.godot/imported/FreeSansBoldOblique.ttf-643172fd931b6b5de5f8b69845858859.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View File

@@ -0,0 +1,10 @@
[gd_resource type="FontFile" load_steps=2 format=2]
[ext_resource path="res://addons/madtalk/fonts/FreeSansBold.ttf" type="FontFile" id=1]
[resource]
size = 9
use_filter = true
extra_spacing_top = -4
extra_spacing_bottom = -4
font_data = ExtResource( 1 )

Binary file not shown.

View File

@@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://y87jh0omiuc5"
path="res://.godot/imported/FreeSansOblique.ttf-40e0fc72ee72e97c509c8879774b586c.fontdata"
[deps]
source_file="res://addons/madtalk/fonts/FreeSansOblique.ttf"
dest_files=["res://.godot/imported/FreeSansOblique.ttf-40e0fc72ee72e97c509c8879774b586c.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View File

@@ -0,0 +1,11 @@
[gd_resource type="FontFile" load_steps=2 format=2]
[ext_resource path="res://addons/madtalk/fonts/FreeSansBold.ttf" type="FontFile" id=1]
[resource]
size = 12
use_mipmaps = true
use_filter = true
extra_spacing_top = -4
extra_spacing_bottom = -4
font_data = ExtResource( 1 )

View File

@@ -0,0 +1,11 @@
[gd_resource type="FontFile" load_steps=2 format=2]
[ext_resource path="res://addons/madtalk/fonts/FreeSansBoldOblique.ttf" type="FontFile" id=1]
[resource]
size = 12
use_mipmaps = true
use_filter = true
extra_spacing_top = -4
extra_spacing_bottom = -4
font_data = ExtResource( 1 )

View File

@@ -0,0 +1,11 @@
[gd_resource type="FontFile" load_steps=2 format=2]
[ext_resource path="res://addons/madtalk/fonts/FreeSansOblique.ttf" type="FontFile" id=1]
[resource]
size = 12
use_mipmaps = true
use_filter = true
extra_spacing_top = -4
extra_spacing_bottom = -4
font_data = ExtResource( 1 )

View File

@@ -0,0 +1,56 @@
[gd_resource type="FontFile" load_steps=2 format=3 uid="uid://b38okvijpcxmv"]
[ext_resource type="FontFile" uid="uid://cgfeudab78x0q" path="res://addons/madtalk/fonts/FreeSans.ttf" id="1"]
[resource]
fallbacks = Array[Font]([ExtResource("1")])
cache/0/12/0/ascent = 0.0
cache/0/12/0/descent = 0.0
cache/0/12/0/underline_position = 0.0
cache/0/12/0/underline_thickness = 0.0
cache/0/12/0/scale = 1.0
cache/0/12/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/14/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/10/0/ascent = 0.0
cache/0/10/0/descent = 0.0
cache/0/10/0/underline_position = 0.0
cache/0/10/0/underline_thickness = 0.0
cache/0/10/0/scale = 1.0
cache/0/10/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/14/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/14/0/ascent = 0.0
cache/0/14/0/descent = 0.0
cache/0/14/0/underline_position = 0.0
cache/0/14/0/underline_thickness = 0.0
cache/0/14/0/scale = 1.0
cache/0/14/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/14/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/14/0/kerning_overrides/14/0 = Vector2(0, 0)
cache/0/14/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/14/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/16/0/ascent = 0.0
cache/0/16/0/descent = 0.0
cache/0/16/0/underline_position = 0.0
cache/0/16/0/underline_thickness = 0.0
cache/0/16/0/scale = 1.0
cache/0/16/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/14/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/50/0/ascent = 0.0
cache/0/50/0/descent = 0.0
cache/0/50/0/underline_position = 0.0
cache/0/50/0/underline_thickness = 0.0
cache/0/50/0/scale = 1.0
cache/0/50/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/14/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/50/0 = Vector2(0, 0)

View File

@@ -0,0 +1,210 @@
[gd_resource type="FontFile" load_steps=2 format=3 uid="uid://bhcws34lw0ak5"]
[ext_resource type="FontFile" uid="uid://cgfeudab78x0q" path="res://addons/madtalk/fonts/FreeSans.ttf" id="1"]
[resource]
fallbacks = Array[Font]([ExtResource("1")])
cache/0/10/0/ascent = 0.0
cache/0/10/0/descent = 0.0
cache/0/10/0/underline_position = 0.0
cache/0/10/0/underline_thickness = 0.0
cache/0/10/0/scale = 1.0
cache/0/10/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/10/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/16/0/ascent = 0.0
cache/0/16/0/descent = 0.0
cache/0/16/0/underline_position = 0.0
cache/0/16/0/underline_thickness = 0.0
cache/0/16/0/scale = 1.0
cache/0/16/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/16/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/50/0/ascent = 0.0
cache/0/50/0/descent = 0.0
cache/0/50/0/underline_position = 0.0
cache/0/50/0/underline_thickness = 0.0
cache/0/50/0/scale = 1.0
cache/0/50/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/50/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/2/0/ascent = 0.0
cache/0/2/0/descent = 0.0
cache/0/2/0/underline_position = 0.0
cache/0/2/0/underline_thickness = 0.0
cache/0/2/0/scale = 1.0
cache/0/2/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/2/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/3/0/ascent = 0.0
cache/0/3/0/descent = 0.0
cache/0/3/0/underline_position = 0.0
cache/0/3/0/underline_thickness = 0.0
cache/0/3/0/scale = 1.0
cache/0/3/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/3/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/4/0/ascent = 0.0
cache/0/4/0/descent = 0.0
cache/0/4/0/underline_position = 0.0
cache/0/4/0/underline_thickness = 0.0
cache/0/4/0/scale = 1.0
cache/0/4/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/4/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/5/0/ascent = 0.0
cache/0/5/0/descent = 0.0
cache/0/5/0/underline_position = 0.0
cache/0/5/0/underline_thickness = 0.0
cache/0/5/0/scale = 1.0
cache/0/5/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/5/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/6/0/ascent = 0.0
cache/0/6/0/descent = 0.0
cache/0/6/0/underline_position = 0.0
cache/0/6/0/underline_thickness = 0.0
cache/0/6/0/scale = 1.0
cache/0/6/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/6/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/7/0/ascent = 0.0
cache/0/7/0/descent = 0.0
cache/0/7/0/underline_position = 0.0
cache/0/7/0/underline_thickness = 0.0
cache/0/7/0/scale = 1.0
cache/0/7/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/7/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/8/0/ascent = 0.0
cache/0/8/0/descent = 0.0
cache/0/8/0/underline_position = 0.0
cache/0/8/0/underline_thickness = 0.0
cache/0/8/0/scale = 1.0
cache/0/8/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/8/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/12/0/ascent = 0.0
cache/0/12/0/descent = 0.0
cache/0/12/0/underline_position = 0.0
cache/0/12/0/underline_thickness = 0.0
cache/0/12/0/scale = 1.0
cache/0/12/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/12/0/kerning_overrides/9/0 = Vector2(0, 0)
cache/0/9/0/ascent = 0.0
cache/0/9/0/descent = 0.0
cache/0/9/0/underline_position = 0.0
cache/0/9/0/underline_thickness = 0.0
cache/0/9/0/scale = 1.0
cache/0/9/0/kerning_overrides/10/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/16/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/50/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/2/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/3/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/4/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/5/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/6/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/7/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/8/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/12/0 = Vector2(0, 0)
cache/0/9/0/kerning_overrides/9/0 = Vector2(0, 0)

View File

@@ -0,0 +1,8 @@
[gd_resource type="FontVariation" load_steps=2 format=3 uid="uid://18mk4r2e01la"]
[ext_resource type="FontFile" uid="uid://cgfeudab78x0q" path="res://addons/madtalk/fonts/FreeSans.ttf" id="1_edbbt"]
[resource]
base_font = ExtResource("1_edbbt")
spacing_top = -2
spacing_bottom = -2

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