diff --git a/addons/madtalk/components/BtnTip.gd b/addons/madtalk/components/BtnTip.gd deleted file mode 100644 index 135b147..0000000 --- a/addons/madtalk/components/BtnTip.gd +++ /dev/null @@ -1,13 +0,0 @@ -@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() diff --git a/addons/madtalk/components/BtnTip.gd.uid b/addons/madtalk/components/BtnTip.gd.uid deleted file mode 100644 index 56482cb..0000000 --- a/addons/madtalk/components/BtnTip.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://degiqbehoikc5 diff --git a/addons/madtalk/components/BtnTip.tscn b/addons/madtalk/components/BtnTip.tscn deleted file mode 100644 index c303cd4..0000000 --- a/addons/madtalk/components/BtnTip.tscn +++ /dev/null @@ -1,20 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/CheckBoxLocale.gd b/addons/madtalk/components/CheckBoxLocale.gd deleted file mode 100644 index 1bac0ea..0000000 --- a/addons/madtalk/components/CheckBoxLocale.gd +++ /dev/null @@ -1,3 +0,0 @@ -extends CheckBox - -@export var locale: String = "" diff --git a/addons/madtalk/components/CheckBoxLocale.gd.uid b/addons/madtalk/components/CheckBoxLocale.gd.uid deleted file mode 100644 index 24ae0aa..0000000 --- a/addons/madtalk/components/CheckBoxLocale.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://7r6730p3jqi8 diff --git a/addons/madtalk/components/CheckBoxLocale.tscn b/addons/madtalk/components/CheckBoxLocale.tscn deleted file mode 100644 index ae129d8..0000000 --- a/addons/madtalk/components/CheckBoxLocale.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[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") diff --git a/addons/madtalk/components/DialogNode.gd b/addons/madtalk/components/DialogNode.gd deleted file mode 100644 index 6170694..0000000 --- a/addons/madtalk/components/DialogNode.gd +++ /dev/null @@ -1,311 +0,0 @@ -@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 diff --git a/addons/madtalk/components/DialogNode.gd.uid b/addons/madtalk/components/DialogNode.gd.uid deleted file mode 100644 index 4439213..0000000 --- a/addons/madtalk/components/DialogNode.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dw017cofkhu8c diff --git a/addons/madtalk/components/DialogNode.tscn b/addons/madtalk/components/DialogNode.tscn deleted file mode 100644 index 588bcaf..0000000 --- a/addons/madtalk/components/DialogNode.tscn +++ /dev/null @@ -1,159 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/DialogNodeItem_condition.gd b/addons/madtalk/components/DialogNodeItem_condition.gd deleted file mode 100644 index 8c5e4a6..0000000 --- a/addons/madtalk/components/DialogNodeItem_condition.gd +++ /dev/null @@ -1,230 +0,0 @@ -@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"] diff --git a/addons/madtalk/components/DialogNodeItem_condition.gd.uid b/addons/madtalk/components/DialogNodeItem_condition.gd.uid deleted file mode 100644 index 2d8f767..0000000 --- a/addons/madtalk/components/DialogNodeItem_condition.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bkwtkyyvciuk0 diff --git a/addons/madtalk/components/DialogNodeItem_condition.tscn b/addons/madtalk/components/DialogNodeItem_condition.tscn deleted file mode 100644 index 60d11f5..0000000 --- a/addons/madtalk/components/DialogNodeItem_condition.tscn +++ /dev/null @@ -1,61 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/DialogNodeItem_effect.gd b/addons/madtalk/components/DialogNodeItem_effect.gd deleted file mode 100644 index 73e1e14..0000000 --- a/addons/madtalk/components/DialogNodeItem_effect.gd +++ /dev/null @@ -1,217 +0,0 @@ -@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"] diff --git a/addons/madtalk/components/DialogNodeItem_effect.gd.uid b/addons/madtalk/components/DialogNodeItem_effect.gd.uid deleted file mode 100644 index 73f15a6..0000000 --- a/addons/madtalk/components/DialogNodeItem_effect.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://iqqxlumksl02 diff --git a/addons/madtalk/components/DialogNodeItem_effect.tscn b/addons/madtalk/components/DialogNodeItem_effect.tscn deleted file mode 100644 index 6d9e18f..0000000 --- a/addons/madtalk/components/DialogNodeItem_effect.tscn +++ /dev/null @@ -1,48 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/DialogNodeItem_message.gd b/addons/madtalk/components/DialogNodeItem_message.gd deleted file mode 100644 index 9efdd06..0000000 --- a/addons/madtalk/components/DialogNodeItem_message.gd +++ /dev/null @@ -1,242 +0,0 @@ -@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() diff --git a/addons/madtalk/components/DialogNodeItem_message.gd.uid b/addons/madtalk/components/DialogNodeItem_message.gd.uid deleted file mode 100644 index b00b060..0000000 --- a/addons/madtalk/components/DialogNodeItem_message.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://338g851v1cl diff --git a/addons/madtalk/components/DialogNodeItem_message.tscn b/addons/madtalk/components/DialogNodeItem_message.tscn deleted file mode 100644 index 978848e..0000000 --- a/addons/madtalk/components/DialogNodeItem_message.tscn +++ /dev/null @@ -1,232 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/DialogNodeItem_option.gd b/addons/madtalk/components/DialogNodeItem_option.gd deleted file mode 100644 index 98920b0..0000000 --- a/addons/madtalk/components/DialogNodeItem_option.gd +++ /dev/null @@ -1,12 +0,0 @@ -@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 diff --git a/addons/madtalk/components/DialogNodeItem_option.gd.uid b/addons/madtalk/components/DialogNodeItem_option.gd.uid deleted file mode 100644 index e0ece9c..0000000 --- a/addons/madtalk/components/DialogNodeItem_option.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://djr5ixsiysemo diff --git a/addons/madtalk/components/DialogNodeItem_option.tscn b/addons/madtalk/components/DialogNodeItem_option.tscn deleted file mode 100644 index 598b942..0000000 --- a/addons/madtalk/components/DialogNodeItem_option.tscn +++ /dev/null @@ -1,47 +0,0 @@ -[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") diff --git a/addons/madtalk/components/DialogNodeOptionsButton.gd b/addons/madtalk/components/DialogNodeOptionsButton.gd deleted file mode 100644 index 3c7ea05..0000000 --- a/addons/madtalk/components/DialogNodeOptionsButton.gd +++ /dev/null @@ -1,36 +0,0 @@ -@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) diff --git a/addons/madtalk/components/DialogNodeOptionsButton.gd.uid b/addons/madtalk/components/DialogNodeOptionsButton.gd.uid deleted file mode 100644 index 826e5e7..0000000 --- a/addons/madtalk/components/DialogNodeOptionsButton.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://h51781skrpvi diff --git a/addons/madtalk/components/DialogNodeOptionsButton.tscn b/addons/madtalk/components/DialogNodeOptionsButton.tscn deleted file mode 100644 index 96e6275..0000000 --- a/addons/madtalk/components/DialogNodeOptionsButton.tscn +++ /dev/null @@ -1,305 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/DialogNode_DialogOptions.gd b/addons/madtalk/components/DialogNode_DialogOptions.gd deleted file mode 100644 index dc8b321..0000000 --- a/addons/madtalk/components/DialogNode_DialogOptions.gd +++ /dev/null @@ -1,258 +0,0 @@ -@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() diff --git a/addons/madtalk/components/DialogNode_DialogOptions.gd.uid b/addons/madtalk/components/DialogNode_DialogOptions.gd.uid deleted file mode 100644 index 9cfc993..0000000 --- a/addons/madtalk/components/DialogNode_DialogOptions.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dg6brgs82d11e diff --git a/addons/madtalk/components/DialogNode_DialogOptions.tscn b/addons/madtalk/components/DialogNode_DialogOptions.tscn deleted file mode 100644 index af2015d..0000000 --- a/addons/madtalk/components/DialogNode_DialogOptions.tscn +++ /dev/null @@ -1,252 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/DialogSearchInspectorSheetIDField.tscn b/addons/madtalk/components/DialogSearchInspectorSheetIDField.tscn deleted file mode 100644 index cc7e3b6..0000000 --- a/addons/madtalk/components/DialogSearchInspectorSheetIDField.tscn +++ /dev/null @@ -1,29 +0,0 @@ -[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 = "..." diff --git a/addons/madtalk/components/DialogSearchSheet.tscn b/addons/madtalk/components/DialogSearchSheet.tscn deleted file mode 100644 index 5c59aca..0000000 --- a/addons/madtalk/components/DialogSearchSheet.tscn +++ /dev/null @@ -1,102 +0,0 @@ -[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" diff --git a/addons/madtalk/components/DialogSearchSheetItem.tscn b/addons/madtalk/components/DialogSearchSheetItem.tscn deleted file mode 100644 index 923ea6e..0000000 --- a/addons/madtalk/components/DialogSearchSheetItem.tscn +++ /dev/null @@ -1,63 +0,0 @@ -[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" diff --git a/addons/madtalk/components/Export_SheetListItem.tscn b/addons/madtalk/components/Export_SheetListItem.tscn deleted file mode 100644 index 96f90ff..0000000 --- a/addons/madtalk/components/Export_SheetListItem.tscn +++ /dev/null @@ -1,62 +0,0 @@ -[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 diff --git a/addons/madtalk/components/ImportBar.gd b/addons/madtalk/components/ImportBar.gd deleted file mode 100644 index 554351f..0000000 --- a/addons/madtalk/components/ImportBar.gd +++ /dev/null @@ -1,26 +0,0 @@ -@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() - diff --git a/addons/madtalk/components/ImportBar.gd.uid b/addons/madtalk/components/ImportBar.gd.uid deleted file mode 100644 index e939c3d..0000000 --- a/addons/madtalk/components/ImportBar.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://brqywa4kaelfg diff --git a/addons/madtalk/components/ImportBar.tscn b/addons/madtalk/components/ImportBar.tscn deleted file mode 100644 index 901ed88..0000000 --- a/addons/madtalk/components/ImportBar.tscn +++ /dev/null @@ -1,40 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/ImportExport.gd b/addons/madtalk/components/ImportExport.gd deleted file mode 100644 index cdc8b85..0000000 --- a/addons/madtalk/components/ImportExport.gd +++ /dev/null @@ -1,34 +0,0 @@ -@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") diff --git a/addons/madtalk/components/ImportExport.gd.uid b/addons/madtalk/components/ImportExport.gd.uid deleted file mode 100644 index 8284c7b..0000000 --- a/addons/madtalk/components/ImportExport.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bhvx2fvu7waxi diff --git a/addons/madtalk/components/InspectorPluginSheetIDField.gd b/addons/madtalk/components/InspectorPluginSheetIDField.gd deleted file mode 100644 index caedaac..0000000 --- a/addons/madtalk/components/InspectorPluginSheetIDField.gd +++ /dev/null @@ -1,18 +0,0 @@ -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 diff --git a/addons/madtalk/components/InspectorPluginSheetIDField.gd.uid b/addons/madtalk/components/InspectorPluginSheetIDField.gd.uid deleted file mode 100644 index d527802..0000000 --- a/addons/madtalk/components/InspectorPluginSheetIDField.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://61pqdj3pwedn diff --git a/addons/madtalk/components/InspectorPluginSheetIDFieldItem.gd b/addons/madtalk/components/InspectorPluginSheetIDFieldItem.gd deleted file mode 100644 index d3216de..0000000 --- a/addons/madtalk/components/InspectorPluginSheetIDFieldItem.gd +++ /dev/null @@ -1,102 +0,0 @@ -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) diff --git a/addons/madtalk/components/InspectorPluginSheetIDFieldItem.gd.uid b/addons/madtalk/components/InspectorPluginSheetIDFieldItem.gd.uid deleted file mode 100644 index cb4c196..0000000 --- a/addons/madtalk/components/InspectorPluginSheetIDFieldItem.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dgkuy71epsgj5 diff --git a/addons/madtalk/components/MTDefs.gd b/addons/madtalk/components/MTDefs.gd deleted file mode 100644 index dd86cc0..0000000 --- a/addons/madtalk/components/MTDefs.gd +++ /dev/null @@ -1,461 +0,0 @@ -@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+" ") diff --git a/addons/madtalk/components/MTDefs.gd.uid b/addons/madtalk/components/MTDefs.gd.uid deleted file mode 100644 index 48bd495..0000000 --- a/addons/madtalk/components/MTDefs.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cqhu373l1hvet diff --git a/addons/madtalk/components/MainEditor_DialogExport.gd b/addons/madtalk/components/MainEditor_DialogExport.gd deleted file mode 100644 index 6074045..0000000 --- a/addons/madtalk/components/MainEditor_DialogExport.gd +++ /dev/null @@ -1,157 +0,0 @@ -@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() diff --git a/addons/madtalk/components/MainEditor_DialogExport.gd.uid b/addons/madtalk/components/MainEditor_DialogExport.gd.uid deleted file mode 100644 index f707b3a..0000000 --- a/addons/madtalk/components/MainEditor_DialogExport.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bokaxoyjm2ddg diff --git a/addons/madtalk/components/MainEditor_DialogExport.tscn b/addons/madtalk/components/MainEditor_DialogExport.tscn deleted file mode 100644 index 54ad9ef..0000000 --- a/addons/madtalk/components/MainEditor_DialogExport.tscn +++ /dev/null @@ -1,315 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/MainEditor_DialogImport.gd b/addons/madtalk/components/MainEditor_DialogImport.gd deleted file mode 100644 index b85a70c..0000000 --- a/addons/madtalk/components/MainEditor_DialogImport.gd +++ /dev/null @@ -1,760 +0,0 @@ -@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() diff --git a/addons/madtalk/components/MainEditor_DialogImport.gd.uid b/addons/madtalk/components/MainEditor_DialogImport.gd.uid deleted file mode 100644 index d6e7aa4..0000000 --- a/addons/madtalk/components/MainEditor_DialogImport.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cix5fmirlacwr diff --git a/addons/madtalk/components/MainEditor_DialogImport.tscn b/addons/madtalk/components/MainEditor_DialogImport.tscn deleted file mode 100644 index 4d39c44..0000000 --- a/addons/madtalk/components/MainEditor_DialogImport.tscn +++ /dev/null @@ -1,228 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/MainEditor_DialogSheetEdit.gd b/addons/madtalk/components/MainEditor_DialogSheetEdit.gd deleted file mode 100644 index be7103e..0000000 --- a/addons/madtalk/components/MainEditor_DialogSheetEdit.gd +++ /dev/null @@ -1,30 +0,0 @@ -@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() diff --git a/addons/madtalk/components/MainEditor_DialogSheetEdit.gd.uid b/addons/madtalk/components/MainEditor_DialogSheetEdit.gd.uid deleted file mode 100644 index 09d8921..0000000 --- a/addons/madtalk/components/MainEditor_DialogSheetEdit.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://x2ao4uxl8x3o diff --git a/addons/madtalk/components/MainEditor_DialogSheetEdit.tscn b/addons/madtalk/components/MainEditor_DialogSheetEdit.tscn deleted file mode 100644 index 0f8c4ba..0000000 --- a/addons/madtalk/components/MainEditor_DialogSheetEdit.tscn +++ /dev/null @@ -1,153 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/MessageCodeParser.gd b/addons/madtalk/components/MessageCodeParser.gd deleted file mode 100644 index c91f2f2..0000000 --- a/addons/madtalk/components/MessageCodeParser.gd +++ /dev/null @@ -1,189 +0,0 @@ -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("") - 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": 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 diff --git a/addons/madtalk/components/MessageCodeParser.gd.uid b/addons/madtalk/components/MessageCodeParser.gd.uid deleted file mode 100644 index 861d92f..0000000 --- a/addons/madtalk/components/MessageCodeParser.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b20tg7kdlsnra diff --git a/addons/madtalk/components/MessageEditorWithLocales.gd b/addons/madtalk/components/MessageEditorWithLocales.gd deleted file mode 100644 index 810725d..0000000 --- a/addons/madtalk/components/MessageEditorWithLocales.gd +++ /dev/null @@ -1,147 +0,0 @@ -@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() diff --git a/addons/madtalk/components/MessageEditorWithLocales.gd.uid b/addons/madtalk/components/MessageEditorWithLocales.gd.uid deleted file mode 100644 index 024fd8b..0000000 --- a/addons/madtalk/components/MessageEditorWithLocales.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://ducf6plaj7ucd diff --git a/addons/madtalk/components/MessageEditorWithLocales.tscn b/addons/madtalk/components/MessageEditorWithLocales.tscn deleted file mode 100644 index 17b945b..0000000 --- a/addons/madtalk/components/MessageEditorWithLocales.tscn +++ /dev/null @@ -1,247 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/SideBar.gd b/addons/madtalk/components/SideBar.gd deleted file mode 100644 index a63b041..0000000 --- a/addons/madtalk/components/SideBar.gd +++ /dev/null @@ -1,22 +0,0 @@ -@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() - diff --git a/addons/madtalk/components/SideBar.gd.uid b/addons/madtalk/components/SideBar.gd.uid deleted file mode 100644 index bc498f4..0000000 --- a/addons/madtalk/components/SideBar.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cygmyylxhkxdu diff --git a/addons/madtalk/components/SideBar.tscn b/addons/madtalk/components/SideBar.tscn deleted file mode 100644 index 05ef4b4..0000000 --- a/addons/madtalk/components/SideBar.tscn +++ /dev/null @@ -1,37 +0,0 @@ -[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"] diff --git a/addons/madtalk/components/SideBar_SheetItem.tscn b/addons/madtalk/components/SideBar_SheetItem.tscn deleted file mode 100644 index 3bb7b4a..0000000 --- a/addons/madtalk/components/SideBar_SheetItem.tscn +++ /dev/null @@ -1,81 +0,0 @@ -[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" diff --git a/addons/madtalk/components/popups/Condition_DialogEdit.tscn b/addons/madtalk/components/popups/Condition_DialogEdit.tscn deleted file mode 100644 index 2bc7ae4..0000000 --- a/addons/madtalk/components/popups/Condition_DialogEdit.tscn +++ /dev/null @@ -1,939 +0,0 @@ -[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" diff --git a/addons/madtalk/components/popups/DialogNodeItem_PopupMenu.tscn b/addons/madtalk/components/popups/DialogNodeItem_PopupMenu.tscn deleted file mode 100644 index 46a88de..0000000 --- a/addons/madtalk/components/popups/DialogNodeItem_PopupMenu.tscn +++ /dev/null @@ -1,31 +0,0 @@ -[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 diff --git a/addons/madtalk/components/popups/Effect_DialogEdit.tscn b/addons/madtalk/components/popups/Effect_DialogEdit.tscn deleted file mode 100644 index aa0556c..0000000 --- a/addons/madtalk/components/popups/Effect_DialogEdit.tscn +++ /dev/null @@ -1,641 +0,0 @@ -[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" diff --git a/addons/madtalk/components/popups/Messages_DialogEdit.tscn b/addons/madtalk/components/popups/Messages_DialogEdit.tscn deleted file mode 100644 index 36c8410..0000000 --- a/addons/madtalk/components/popups/Messages_DialogEdit.tscn +++ /dev/null @@ -1,269 +0,0 @@ -[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" diff --git a/addons/madtalk/components/popups/Messages_VoiceClipDialog.tscn b/addons/madtalk/components/popups/Messages_VoiceClipDialog.tscn deleted file mode 100644 index 0b5ca31..0000000 --- a/addons/madtalk/components/popups/Messages_VoiceClipDialog.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[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") diff --git a/addons/madtalk/components/resources/ButtonStyle.tres b/addons/madtalk/components/resources/ButtonStyle.tres deleted file mode 100644 index 7a5e812..0000000 --- a/addons/madtalk/components/resources/ButtonStyle.tres +++ /dev/null @@ -1,12 +0,0 @@ -[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 diff --git a/addons/madtalk/components/resources/DialogData.gd b/addons/madtalk/components/resources/DialogData.gd deleted file mode 100644 index 46b4825..0000000 --- a/addons/madtalk/components/resources/DialogData.gd +++ /dev/null @@ -1,31 +0,0 @@ -@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 = {} diff --git a/addons/madtalk/components/resources/DialogData.gd.uid b/addons/madtalk/components/resources/DialogData.gd.uid deleted file mode 100644 index 34c07d2..0000000 --- a/addons/madtalk/components/resources/DialogData.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bw2q2eucjkylk diff --git a/addons/madtalk/components/resources/DialogNodeData.gd b/addons/madtalk/components/resources/DialogNodeData.gd deleted file mode 100644 index 59b9e36..0000000 --- a/addons/madtalk/components/resources/DialogNodeData.gd +++ /dev/null @@ -1,17 +0,0 @@ -@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 diff --git a/addons/madtalk/components/resources/DialogNodeData.gd.uid b/addons/madtalk/components/resources/DialogNodeData.gd.uid deleted file mode 100644 index 34acd47..0000000 --- a/addons/madtalk/components/resources/DialogNodeData.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b2mrnotqjr75d diff --git a/addons/madtalk/components/resources/DialogNodeItemData.gd b/addons/madtalk/components/resources/DialogNodeItemData.gd deleted file mode 100644 index cf889d9..0000000 --- a/addons/madtalk/components/resources/DialogNodeItemData.gd +++ /dev/null @@ -1,73 +0,0 @@ -@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 = [] diff --git a/addons/madtalk/components/resources/DialogNodeItemData.gd.uid b/addons/madtalk/components/resources/DialogNodeItemData.gd.uid deleted file mode 100644 index d2b1131..0000000 --- a/addons/madtalk/components/resources/DialogNodeItemData.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c2bv5lwcvdmrb diff --git a/addons/madtalk/components/resources/DialogNodeOptionData.gd b/addons/madtalk/components/resources/DialogNodeOptionData.gd deleted file mode 100644 index 68be094..0000000 --- a/addons/madtalk/components/resources/DialogNodeOptionData.gd +++ /dev/null @@ -1,57 +0,0 @@ -@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 diff --git a/addons/madtalk/components/resources/DialogNodeOptionData.gd.uid b/addons/madtalk/components/resources/DialogNodeOptionData.gd.uid deleted file mode 100644 index c6e0739..0000000 --- a/addons/madtalk/components/resources/DialogNodeOptionData.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bfg2ff7c0tanh diff --git a/addons/madtalk/components/resources/DialogSheetData.gd b/addons/madtalk/components/resources/DialogSheetData.gd deleted file mode 100644 index 7818632..0000000 --- a/addons/madtalk/components/resources/DialogSheetData.gd +++ /dev/null @@ -1,22 +0,0 @@ -@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) diff --git a/addons/madtalk/components/resources/DialogSheetData.gd.uid b/addons/madtalk/components/resources/DialogSheetData.gd.uid deleted file mode 100644 index 87e0549..0000000 --- a/addons/madtalk/components/resources/DialogSheetData.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://butd1fwy4a2hn diff --git a/addons/madtalk/components/resources/GraphStyle.tres b/addons/madtalk/components/resources/GraphStyle.tres deleted file mode 100644 index 79fe313..0000000 --- a/addons/madtalk/components/resources/GraphStyle.tres +++ /dev/null @@ -1,10 +0,0 @@ -[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 diff --git a/addons/madtalk/components/resources/InputDarkStyle.tres b/addons/madtalk/components/resources/InputDarkStyle.tres deleted file mode 100644 index 0ff551d..0000000 --- a/addons/madtalk/components/resources/InputDarkStyle.tres +++ /dev/null @@ -1,12 +0,0 @@ -[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 diff --git a/addons/madtalk/components/resources/InputStyle_grey.tres b/addons/madtalk/components/resources/InputStyle_grey.tres deleted file mode 100644 index b707bb8..0000000 --- a/addons/madtalk/components/resources/InputStyle_grey.tres +++ /dev/null @@ -1,10 +0,0 @@ -[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 diff --git a/addons/madtalk/components/resources/NodeStyle.tres b/addons/madtalk/components/resources/NodeStyle.tres deleted file mode 100644 index d64299f..0000000 --- a/addons/madtalk/components/resources/NodeStyle.tres +++ /dev/null @@ -1,16 +0,0 @@ -[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 diff --git a/addons/madtalk/components/resources/PanelStyle.tres b/addons/madtalk/components/resources/PanelStyle.tres deleted file mode 100644 index be38608..0000000 --- a/addons/madtalk/components/resources/PanelStyle.tres +++ /dev/null @@ -1,10 +0,0 @@ -[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 diff --git a/addons/madtalk/components/resources/RichLabelPreviewAlphaStyle.tres b/addons/madtalk/components/resources/RichLabelPreviewAlphaStyle.tres deleted file mode 100644 index ba7c125..0000000 --- a/addons/madtalk/components/resources/RichLabelPreviewAlphaStyle.tres +++ /dev/null @@ -1,4 +0,0 @@ -[gd_resource type="StyleBoxFlat" format=2] - -[resource] -bg_color = Color( 1, 1, 1, 0 ) diff --git a/addons/madtalk/components/resources/RichLabelPreviewStyle.tres b/addons/madtalk/components/resources/RichLabelPreviewStyle.tres deleted file mode 100644 index 510e1ac..0000000 --- a/addons/madtalk/components/resources/RichLabelPreviewStyle.tres +++ /dev/null @@ -1,4 +0,0 @@ -[gd_resource type="StyleBoxFlat" format=2] - -[resource] -bg_color = Color( 0.733333, 0.733333, 0.733333, 1 ) diff --git a/addons/madtalk/components/resources/SheetItemStyle.tres b/addons/madtalk/components/resources/SheetItemStyle.tres deleted file mode 100644 index 43063cf..0000000 --- a/addons/madtalk/components/resources/SheetItemStyle.tres +++ /dev/null @@ -1,14 +0,0 @@ -[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 diff --git a/addons/madtalk/fonts/FreeSans.tres b/addons/madtalk/fonts/FreeSans.tres deleted file mode 100644 index 405f7ac..0000000 --- a/addons/madtalk/fonts/FreeSans.tres +++ /dev/null @@ -1,10 +0,0 @@ -[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 ) diff --git a/addons/madtalk/fonts/FreeSans.ttf b/addons/madtalk/fonts/FreeSans.ttf deleted file mode 100644 index 6de62eb..0000000 Binary files a/addons/madtalk/fonts/FreeSans.ttf and /dev/null differ diff --git a/addons/madtalk/fonts/FreeSans.ttf.import b/addons/madtalk/fonts/FreeSans.ttf.import deleted file mode 100644 index b10d078..0000000 --- a/addons/madtalk/fonts/FreeSans.ttf.import +++ /dev/null @@ -1,35 +0,0 @@ -[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={} diff --git a/addons/madtalk/fonts/FreeSansBold.ttf b/addons/madtalk/fonts/FreeSansBold.ttf deleted file mode 100644 index 63644e7..0000000 Binary files a/addons/madtalk/fonts/FreeSansBold.ttf and /dev/null differ diff --git a/addons/madtalk/fonts/FreeSansBold.ttf.import b/addons/madtalk/fonts/FreeSansBold.ttf.import deleted file mode 100644 index af6bcb0..0000000 --- a/addons/madtalk/fonts/FreeSansBold.ttf.import +++ /dev/null @@ -1,35 +0,0 @@ -[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={} diff --git a/addons/madtalk/fonts/FreeSansBoldOblique.ttf b/addons/madtalk/fonts/FreeSansBoldOblique.ttf deleted file mode 100644 index dde7f32..0000000 Binary files a/addons/madtalk/fonts/FreeSansBoldOblique.ttf and /dev/null differ diff --git a/addons/madtalk/fonts/FreeSansBoldOblique.ttf.import b/addons/madtalk/fonts/FreeSansBoldOblique.ttf.import deleted file mode 100644 index e8f7030..0000000 --- a/addons/madtalk/fonts/FreeSansBoldOblique.ttf.import +++ /dev/null @@ -1,35 +0,0 @@ -[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={} diff --git a/addons/madtalk/fonts/FreeSansBold_tiny.tres b/addons/madtalk/fonts/FreeSansBold_tiny.tres deleted file mode 100644 index a3355c3..0000000 --- a/addons/madtalk/fonts/FreeSansBold_tiny.tres +++ /dev/null @@ -1,10 +0,0 @@ -[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 ) diff --git a/addons/madtalk/fonts/FreeSansOblique.ttf b/addons/madtalk/fonts/FreeSansOblique.ttf deleted file mode 100644 index 7452885..0000000 Binary files a/addons/madtalk/fonts/FreeSansOblique.ttf and /dev/null differ diff --git a/addons/madtalk/fonts/FreeSansOblique.ttf.import b/addons/madtalk/fonts/FreeSansOblique.ttf.import deleted file mode 100644 index 8c50707..0000000 --- a/addons/madtalk/fonts/FreeSansOblique.ttf.import +++ /dev/null @@ -1,35 +0,0 @@ -[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={} diff --git a/addons/madtalk/fonts/FreeSans_bold_small.tres b/addons/madtalk/fonts/FreeSans_bold_small.tres deleted file mode 100644 index b8a3cde..0000000 --- a/addons/madtalk/fonts/FreeSans_bold_small.tres +++ /dev/null @@ -1,11 +0,0 @@ -[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 ) diff --git a/addons/madtalk/fonts/FreeSans_bolditalic_small.tres b/addons/madtalk/fonts/FreeSans_bolditalic_small.tres deleted file mode 100644 index fa31e9d..0000000 --- a/addons/madtalk/fonts/FreeSans_bolditalic_small.tres +++ /dev/null @@ -1,11 +0,0 @@ -[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 ) diff --git a/addons/madtalk/fonts/FreeSans_italic_small.tres b/addons/madtalk/fonts/FreeSans_italic_small.tres deleted file mode 100644 index 74494ee..0000000 --- a/addons/madtalk/fonts/FreeSans_italic_small.tres +++ /dev/null @@ -1,11 +0,0 @@ -[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 ) diff --git a/addons/madtalk/fonts/FreeSans_smal.tres b/addons/madtalk/fonts/FreeSans_smal.tres deleted file mode 100644 index c357bc3..0000000 --- a/addons/madtalk/fonts/FreeSans_smal.tres +++ /dev/null @@ -1,56 +0,0 @@ -[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) diff --git a/addons/madtalk/fonts/FreeSans_tiny.tres b/addons/madtalk/fonts/FreeSans_tiny.tres deleted file mode 100644 index 78cf81f..0000000 --- a/addons/madtalk/fonts/FreeSans_tiny.tres +++ /dev/null @@ -1,210 +0,0 @@ -[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) diff --git a/addons/madtalk/fonts/MessagePreview.tres b/addons/madtalk/fonts/MessagePreview.tres deleted file mode 100644 index 43a59c9..0000000 --- a/addons/madtalk/fonts/MessagePreview.tres +++ /dev/null @@ -1,8 +0,0 @@ -[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 diff --git a/addons/madtalk/fonts/droid-sans-mono.LICENSE.txt b/addons/madtalk/fonts/droid-sans-mono.LICENSE.txt deleted file mode 100644 index 7a4a3ea..0000000 --- a/addons/madtalk/fonts/droid-sans-mono.LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/addons/madtalk/fonts/droid-sans-mono.regular.ttf b/addons/madtalk/fonts/droid-sans-mono.regular.ttf deleted file mode 100644 index d604425..0000000 Binary files a/addons/madtalk/fonts/droid-sans-mono.regular.ttf and /dev/null differ diff --git a/addons/madtalk/fonts/droid-sans-mono.regular.ttf.import b/addons/madtalk/fonts/droid-sans-mono.regular.ttf.import deleted file mode 100644 index 570acfa..0000000 --- a/addons/madtalk/fonts/droid-sans-mono.regular.ttf.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://dp7os1mai8le8" -path="res://.godot/imported/droid-sans-mono.regular.ttf-aac497a47696ee6c4be919d3a2e96a35.fontdata" - -[deps] - -source_file="res://addons/madtalk/fonts/droid-sans-mono.regular.ttf" -dest_files=["res://.godot/imported/droid-sans-mono.regular.ttf-aac497a47696ee6c4be919d3a2e96a35.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=4 -keep_rounding_remainders=true -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/addons/madtalk/images/header_condition.png b/addons/madtalk/images/header_condition.png deleted file mode 100644 index 0849e91..0000000 Binary files a/addons/madtalk/images/header_condition.png and /dev/null differ diff --git a/addons/madtalk/images/header_condition.png.import b/addons/madtalk/images/header_condition.png.import deleted file mode 100644 index 8eb2258..0000000 --- a/addons/madtalk/images/header_condition.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://kcw14ykn5tp" -path="res://.godot/imported/header_condition.png-453cfba0451ad4f357739a3753045bb5.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/header_condition.png" -dest_files=["res://.godot/imported/header_condition.png-453cfba0451ad4f357739a3753045bb5.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/header_condition_arrow.png b/addons/madtalk/images/header_condition_arrow.png deleted file mode 100644 index 83cffec..0000000 Binary files a/addons/madtalk/images/header_condition_arrow.png and /dev/null differ diff --git a/addons/madtalk/images/header_condition_arrow.png.import b/addons/madtalk/images/header_condition_arrow.png.import deleted file mode 100644 index 4a565d5..0000000 --- a/addons/madtalk/images/header_condition_arrow.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://b37ib00lc25o1" -path="res://.godot/imported/header_condition_arrow.png-c7d08d0077869593e902bba7892b61ba.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/header_condition_arrow.png" -dest_files=["res://.godot/imported/header_condition_arrow.png-c7d08d0077869593e902bba7892b61ba.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/header_effect.png b/addons/madtalk/images/header_effect.png deleted file mode 100644 index 503b0c3..0000000 Binary files a/addons/madtalk/images/header_effect.png and /dev/null differ diff --git a/addons/madtalk/images/header_effect.png.import b/addons/madtalk/images/header_effect.png.import deleted file mode 100644 index 601b072..0000000 --- a/addons/madtalk/images/header_effect.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cg463wmvppw0u" -path="res://.godot/imported/header_effect.png-4446a106cef88170e7e17dcc935d9664.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/header_effect.png" -dest_files=["res://.godot/imported/header_effect.png-4446a106cef88170e7e17dcc935d9664.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/header_option.png b/addons/madtalk/images/header_option.png deleted file mode 100644 index adeedba..0000000 Binary files a/addons/madtalk/images/header_option.png and /dev/null differ diff --git a/addons/madtalk/images/header_option.png.import b/addons/madtalk/images/header_option.png.import deleted file mode 100644 index d74ac67..0000000 --- a/addons/madtalk/images/header_option.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://3tpmqrmfqg6t" -path="res://.godot/imported/header_option.png-1908ebaa4ee93a30de8413c8f997a012.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/header_option.png" -dest_files=["res://.godot/imported/header_option.png-1908ebaa4ee93a30de8413c8f997a012.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/header_option_condition.png b/addons/madtalk/images/header_option_condition.png deleted file mode 100644 index 839a6ac..0000000 Binary files a/addons/madtalk/images/header_option_condition.png and /dev/null differ diff --git a/addons/madtalk/images/header_option_condition.png.import b/addons/madtalk/images/header_option_condition.png.import deleted file mode 100644 index 505fa0f..0000000 --- a/addons/madtalk/images/header_option_condition.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://7ohtlu4cvfph" -path="res://.godot/imported/header_option_condition.png-3af7842a983750776210b3c9bfdb37d0.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/header_option_condition.png" -dest_files=["res://.godot/imported/header_option_condition.png-3af7842a983750776210b3c9bfdb37d0.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_condition.png b/addons/madtalk/images/icon_condition.png deleted file mode 100644 index 8800480..0000000 Binary files a/addons/madtalk/images/icon_condition.png and /dev/null differ diff --git a/addons/madtalk/images/icon_condition.png.import b/addons/madtalk/images/icon_condition.png.import deleted file mode 100644 index 010b029..0000000 --- a/addons/madtalk/images/icon_condition.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://200bqpuqfn6m" -path="res://.godot/imported/icon_condition.png-7cb501efd58b5928a9e928cd3e0af86a.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_condition.png" -dest_files=["res://.godot/imported/icon_condition.png-7cb501efd58b5928a9e928cd3e0af86a.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_down.png b/addons/madtalk/images/icon_down.png deleted file mode 100644 index f2ce95b..0000000 Binary files a/addons/madtalk/images/icon_down.png and /dev/null differ diff --git a/addons/madtalk/images/icon_down.png.import b/addons/madtalk/images/icon_down.png.import deleted file mode 100644 index 97b6002..0000000 --- a/addons/madtalk/images/icon_down.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://c4xg8811uuoq6" -path="res://.godot/imported/icon_down.png-52beb9b18ebff9a8363baa642571ea06.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_down.png" -dest_files=["res://.godot/imported/icon_down.png-52beb9b18ebff9a8363baa642571ea06.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_edit.png b/addons/madtalk/images/icon_edit.png deleted file mode 100644 index f4a97f5..0000000 Binary files a/addons/madtalk/images/icon_edit.png and /dev/null differ diff --git a/addons/madtalk/images/icon_edit.png.import b/addons/madtalk/images/icon_edit.png.import deleted file mode 100644 index e7d1334..0000000 --- a/addons/madtalk/images/icon_edit.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://ccd654fnsh312" -path="res://.godot/imported/icon_edit.png-795b99f6def8d6d299f89ed1d08113ad.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_edit.png" -dest_files=["res://.godot/imported/icon_edit.png-795b99f6def8d6d299f89ed1d08113ad.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_effect.png b/addons/madtalk/images/icon_effect.png deleted file mode 100644 index 9a6a9d8..0000000 Binary files a/addons/madtalk/images/icon_effect.png and /dev/null differ diff --git a/addons/madtalk/images/icon_effect.png.import b/addons/madtalk/images/icon_effect.png.import deleted file mode 100644 index a0086b0..0000000 --- a/addons/madtalk/images/icon_effect.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dqt1wi0i1aqol" -path="res://.godot/imported/icon_effect.png-b8223320180ef78b1737c3f399ddd5eb.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_effect.png" -dest_files=["res://.godot/imported/icon_effect.png-b8223320180ef78b1737c3f399ddd5eb.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_message.png b/addons/madtalk/images/icon_message.png deleted file mode 100644 index b48b0a9..0000000 Binary files a/addons/madtalk/images/icon_message.png and /dev/null differ diff --git a/addons/madtalk/images/icon_message.png.import b/addons/madtalk/images/icon_message.png.import deleted file mode 100644 index 4e6e142..0000000 --- a/addons/madtalk/images/icon_message.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://u746x6ecjfx5" -path="res://.godot/imported/icon_message.png-ba374ea44de917b9d47f46b841e15161.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_message.png" -dest_files=["res://.godot/imported/icon_message.png-ba374ea44de917b9d47f46b841e15161.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_opt_condition.png b/addons/madtalk/images/icon_opt_condition.png deleted file mode 100644 index 90175c9..0000000 Binary files a/addons/madtalk/images/icon_opt_condition.png and /dev/null differ diff --git a/addons/madtalk/images/icon_opt_condition.png.import b/addons/madtalk/images/icon_opt_condition.png.import deleted file mode 100644 index 498d8db..0000000 --- a/addons/madtalk/images/icon_opt_condition.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cxwd6i3apjou8" -path="res://.godot/imported/icon_opt_condition.png-8b0299a00af3f895d6dc4eb954faa8ad.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_opt_condition.png" -dest_files=["res://.godot/imported/icon_opt_condition.png-8b0299a00af3f895d6dc4eb954faa8ad.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_options.png b/addons/madtalk/images/icon_options.png deleted file mode 100644 index aab4cb0..0000000 Binary files a/addons/madtalk/images/icon_options.png and /dev/null differ diff --git a/addons/madtalk/images/icon_options.png.import b/addons/madtalk/images/icon_options.png.import deleted file mode 100644 index 25de5e7..0000000 --- a/addons/madtalk/images/icon_options.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://0l1emjk1cyiy" -path="res://.godot/imported/icon_options.png-aecaf2e2fd3e610b04179afa59c303f1.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_options.png" -dest_files=["res://.godot/imported/icon_options.png-aecaf2e2fd3e610b04179afa59c303f1.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_plus.png b/addons/madtalk/images/icon_plus.png deleted file mode 100644 index 9d7216e..0000000 Binary files a/addons/madtalk/images/icon_plus.png and /dev/null differ diff --git a/addons/madtalk/images/icon_plus.png.import b/addons/madtalk/images/icon_plus.png.import deleted file mode 100644 index 27fe756..0000000 --- a/addons/madtalk/images/icon_plus.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://xt0wkyrex027" -path="res://.godot/imported/icon_plus.png-ac76fc306ea40547317237fc9a3c35d1.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_plus.png" -dest_files=["res://.godot/imported/icon_plus.png-ac76fc306ea40547317237fc9a3c35d1.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_question.png b/addons/madtalk/images/icon_question.png deleted file mode 100644 index 7f45487..0000000 Binary files a/addons/madtalk/images/icon_question.png and /dev/null differ diff --git a/addons/madtalk/images/icon_question.png.import b/addons/madtalk/images/icon_question.png.import deleted file mode 100644 index 899600e..0000000 --- a/addons/madtalk/images/icon_question.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cae7h22m1o7aw" -path="res://.godot/imported/icon_question.png-48780324e0d9edd1dab01c5ba9c96c77.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_question.png" -dest_files=["res://.godot/imported/icon_question.png-48780324e0d9edd1dab01c5ba9c96c77.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_search.png b/addons/madtalk/images/icon_search.png deleted file mode 100644 index d7c746d..0000000 Binary files a/addons/madtalk/images/icon_search.png and /dev/null differ diff --git a/addons/madtalk/images/icon_search.png.import b/addons/madtalk/images/icon_search.png.import deleted file mode 100644 index f80d6da..0000000 --- a/addons/madtalk/images/icon_search.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://c4ne7fiheatjc" -path="res://.godot/imported/icon_search.png-088a286a8e9a5b0be7123b23cc2fd000.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_search.png" -dest_files=["res://.godot/imported/icon_search.png-088a286a8e9a5b0be7123b23cc2fd000.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_up.png b/addons/madtalk/images/icon_up.png deleted file mode 100644 index e85a78a..0000000 Binary files a/addons/madtalk/images/icon_up.png and /dev/null differ diff --git a/addons/madtalk/images/icon_up.png.import b/addons/madtalk/images/icon_up.png.import deleted file mode 100644 index b0b4bb4..0000000 --- a/addons/madtalk/images/icon_up.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://6iclvaqbm5dl" -path="res://.godot/imported/icon_up.png-f29e589cc2582bb07ccc57205e0a8982.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_up.png" -dest_files=["res://.godot/imported/icon_up.png-f29e589cc2582bb07ccc57205e0a8982.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/icon_x.png b/addons/madtalk/images/icon_x.png deleted file mode 100644 index 6394833..0000000 Binary files a/addons/madtalk/images/icon_x.png and /dev/null differ diff --git a/addons/madtalk/images/icon_x.png.import b/addons/madtalk/images/icon_x.png.import deleted file mode 100644 index 7125669..0000000 --- a/addons/madtalk/images/icon_x.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dxgulu8lvnwrr" -path="res://.godot/imported/icon_x.png-c5e15990930c2707f51d504855e1dda0.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/icon_x.png" -dest_files=["res://.godot/imported/icon_x.png-c5e15990930c2707f51d504855e1dda0.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/madtalk_viewport_icon.png b/addons/madtalk/images/madtalk_viewport_icon.png deleted file mode 100644 index 6e9a086..0000000 Binary files a/addons/madtalk/images/madtalk_viewport_icon.png and /dev/null differ diff --git a/addons/madtalk/images/madtalk_viewport_icon.png.import b/addons/madtalk/images/madtalk_viewport_icon.png.import deleted file mode 100644 index 875435c..0000000 --- a/addons/madtalk/images/madtalk_viewport_icon.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://btmmlsgvvetgi" -path="res://.godot/imported/madtalk_viewport_icon.png-a8d6195b27f50d519ee98fa0e6370607.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/madtalk_viewport_icon.png" -dest_files=["res://.godot/imported/madtalk_viewport_icon.png-a8d6195b27f50d519ee98fa0e6370607.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/images/panel_bg.png b/addons/madtalk/images/panel_bg.png deleted file mode 100644 index a872550..0000000 Binary files a/addons/madtalk/images/panel_bg.png and /dev/null differ diff --git a/addons/madtalk/images/panel_bg.png.import b/addons/madtalk/images/panel_bg.png.import deleted file mode 100644 index 88e497a..0000000 --- a/addons/madtalk/images/panel_bg.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dgal43srcee1q" -path="res://.godot/imported/panel_bg.png-3ab06da2ccd5a236df6bac6858e5cefe.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/images/panel_bg.png" -dest_files=["res://.godot/imported/panel_bg.png-3ab06da2ccd5a236df6bac6858e5cefe.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/madtalk/importers/exp_text.gd b/addons/madtalk/importers/exp_text.gd deleted file mode 100644 index 2ecdbef..0000000 --- a/addons/madtalk/importers/exp_text.gd +++ /dev/null @@ -1,127 +0,0 @@ -extends RefCounted - -const name := "Text" - -const description := """[b]Text Exporter[/b] - -This exporter generates a pure text output, containing [b]only messages[/b]. (It doesn't include conditions, effects, etc.) - -The main purpose of this exporter is to send dialog lines to translators, who fill the empty lines, which are then imported back into MadTalk. - -The generated text will have the following syntax: -[color=#ffff77] -[Sheet: ] - Sheet description goes here - -[Sequence: ] - - speaker id: Message contents go here -{locale1}: Translation to locale1 goes here -{locale2}: Translation to locale2 goes here -... - - another speaker id(variant): Another essage contents go here - - speaker id: -=-=- -This is a multiline message. -it can contain as many lines as required. It will continue until the multiline marker is found, as below. --=-=- - -[Sequence: ] - yet another speaker id: Yet nother essage contents go here -[/color] - -Locale versions are always optional, and don't have to be consistent. They only show up if the message contains one, or if the locale is forced (to generate blank lines for translators). -A real example: - -[color=#ffff77] -[Sheet: mary_meets_peter] - Dialog when Mary meets Peter, on level 3 - -[Sequence: ix5f6] - - mary: Who are you? -{pt}: Quem é você? -{jp}: 誰ですか? - -<9x86f> peter(scared): Don't shoot! I'm a friend! - - peter(relieved): My name is Peter. I'm the innkeeper. -{pt}: Eu sou Pedro, o dono da estalagem. - -[Sequence: xkj87] - - mary: -=-=- -I'm leaving now. See you! - -[lb]i[rb](Honestly, I hope I never come back!)[lb]/i[rb] --=-=- -[/color] - -When forcing a locale, the existing text for locales will only include the forced ones, and if the message doesn't have them, blank lines will be included. You can force several locales on the same export. -Example, forcing locale "pt" on the previous example will export as below: - -[color=#ffff77] -[Sheet: mary_meets_peter] - Dialog when Mary meets Peter, on level 3 - -[Sequence: ix5f6] - - mary: Who are you? -{pt}: Quem é você? - -<9x86f> peter(scared): Don't shoot! I'm a friend! -{pt}: - - peter(relieved): My name is Peter. I'm the innkeeper. -{pt}: Eu sou Pedro, o dono da estalagem. - -[Sequence: xkj87] - - mary: -=-=- -I'm leaving now. See you! - -[lb]i[rb](Honestly, I hope I never come back!)[lb]/i[rb] --=-=- -{pt}: -[/color] - -""" - -const MULTILINE_MARKER := "-=-=-" - -func multiline_message(input: String) -> String: - var result := input - if "\n" in result: - result = MULTILINE_MARKER + "\n" + result + "\n" + MULTILINE_MARKER - return result - - -func export(sheet_data: DialogSheetData, force_locales := []) -> String: - var result := "[Sheet: %s]\n" % sheet_data.sheet_id - result += " %s\n\n" % sheet_data.sheet_description - - var all_locales: bool = (force_locales == []) - - for dialog_node: DialogNodeData in sheet_data.nodes: - result += "[Sequence: %s]\n\n" % dialog_node.resource_scene_unique_id - - for dialog_item: DialogNodeItemData in dialog_node.items: - if dialog_item.item_type == DialogNodeItemData.ItemTypes.Message: - var speaker: String = dialog_item.message_speaker_id - if dialog_item.message_speaker_variant != "": - speaker = "%s(%s)" % [speaker, dialog_item.message_speaker_variant] - - result += "<%s> %s: %s\n" % [dialog_item.resource_scene_unique_id, speaker, multiline_message(dialog_item.message_text)] - for locale in dialog_item.message_text_locales: - if all_locales or (locale in force_locales): - result += ("{%s}: " % locale) + multiline_message(dialog_item.message_text_locales[locale]) + "\n" - - for locale in force_locales: - if not locale in dialog_item.message_text_locales: - result += ("{%s}: \n" % locale) - - - result += "\n" - - return result diff --git a/addons/madtalk/importers/exp_text.gd.uid b/addons/madtalk/importers/exp_text.gd.uid deleted file mode 100644 index ae75277..0000000 --- a/addons/madtalk/importers/exp_text.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bdsc1obep57ny diff --git a/addons/madtalk/importers/imp_text.gd b/addons/madtalk/importers/imp_text.gd deleted file mode 100644 index 5b19d66..0000000 --- a/addons/madtalk/importers/imp_text.gd +++ /dev/null @@ -1,329 +0,0 @@ -extends RefCounted - -const name := "Text" - -const description := """[b]Text Importer[/b] - -This importer loads dialog in pure text output, containing [b]only messages[/b]. (It doesn't load conditions, effects, etc.) -It can load brand new dialog, as well as update messages into existing dialog. It can also be used to append new locale messages into existing message items. - -The format supports very simple input, such as: - -[color=#ffff77] -[lb]Sequence[rb] -alice: Hey bob! Did you ever use MadTalk? -bob: Uh... not yet. Is it good? -alice: It's awesome, it does a lot of things. [lb]i[rb]A lot![lb]/i[rb] -bob: Great! I'll check it out! -[/color] - -(Notice the speakers before the colon are speaker IDs, not their display strings.) - -But it also supports multiline messages, specifying speaker variants (between round brackets), locale text, and updating existing message items via their internal codes. -A more complex example, including messages which will be updated (where their codes are specified), and new sequences and messages appended to the sheet (where codes are not specified): - -[color=#ffff77] -[Sheet: mary_meets_peter] - Dialog when Mary meets Peter, on level 3 - -[Sequence: ix5f6] - - mary: Who are you? -{pt}: Quem é você? -{jp}: 誰ですか? - -<9x86f> peter(scared): Don't shoot! I'm a friend! - - peter(relieved): My name is Peter. I'm the innkeeper. -{pt}: Eu sou Pedro, o dono da estalagem. - -mary: This message will be appended as a new item into the sequence above, because there is no existing code specified (the thing between <>). - -[Sequence: xkj87] - - mary: -=-=- -I'm leaving now. See you! - -[lb]i[rb](Honestly, I hope I never come back!)[lb]/i[rb] --=-=- - -[Sequence] - -mary: This message (and the one below) will be added into a brand new sequence, because the "Sequence" tag above doesn't specify the internal code for an existing sequence. - -peter: Cool! -[/color] -""" - -const MULTILINE_MARKER := "-=-=-" - -var resource_map := {} - -enum ImportResults { - OK, - INVALID_START -} - -var re_speaker_without_resource := RegEx.new() -var re_speaker_with_resource := RegEx.new() -var re_locale_text := RegEx.new() - - -func _init(): - re_speaker_without_resource.compile("^(?.*): (?.+)") - re_speaker_with_resource.compile("^<(?\\w+)> (?.*): (?.+)") - re_locale_text.compile("^{(?[a-zA-Z0-9\\-]+)}: (?.+)") - -func refresh_resource_map(dialog_data: DialogData): - resource_map.clear() - resource_map["dialog_data"] = dialog_data - - -func append_resource_map(sheet_id: String): - var dialog_data: DialogData = resource_map["dialog_data"] - - if sheet_id in dialog_data.sheets: - var sheet_data: DialogSheetData = dialog_data.sheets[sheet_id] - - resource_map[sheet_id] = {} - resource_map[sheet_id][sheet_data.resource_scene_unique_id] = sheet_data - - for dialog_node: DialogNodeData in sheet_data.nodes: - resource_map[sheet_id][dialog_node.resource_scene_unique_id] = dialog_node - for dialog_item: DialogNodeItemData in dialog_node.items: - resource_map[sheet_id][dialog_item.resource_scene_unique_id] = dialog_item - - -func get_speaker_and_variant(input: String) -> Array: - var result := ["", ""] - - if ("(" in input) and (input.ends_with(")")): - var rpos: int = input.rfind("(") - result[0] = input.left(rpos) - result[1] = input.substr(rpos+1, input.length() - rpos - 2) - - else: - result[0] = input - - return result - - -func get_multiline_text(input: Array) -> String: - # input contains one string per item, the starting line with the MULTILINE_MARKER - # is already removed - input[0] is already content - # this function SHOULD remove consumed lines from the array (passed by reference) - - var result := "" - - # Line should not go through strip_edges() as extra spaces might be part of the content - var line: String = input.pop_front() - var i = 0 - while line and (not line.begins_with(MULTILINE_MARKER)): - if result.length() > 0: - result += "\n" - result += line - - line = input.pop_front() - - i += 1 - if i > 1000: - # Safeguard in case something goes wrong in the file - break - - # Final line with MULTILINE_MARKER is discarded - - return result - - -func import(dialog_data: DialogData, input: String) -> Dictionary: - var result := { - "status": ImportResults.OK, - "sheets": { - # "sheet_id": { - # "sheet_id": "...", - # "sheet_desc": "...", - # "nodes": [...], - # } - }, - } - - refresh_resource_map(dialog_data) - - var lines: Array = Array(input.split("\n")) - - - # Sequences - var sequence_unique_id := "" - var current_node = null # from MadTalk dialog resource - var current_tree_node = null # from result tree - - var message_unique_id := "" - var current_message: DialogNodeItemData = null - var current_tree_message = null - - var sheet_items := [] - var sheet_id := "" - var sheet_desc := "" - var line = lines.pop_front().strip_edges() - - var i = 0 - while line is String: - i += 1 - if i > 99999: - print("MadTalk importer: reached maximum loop iterations. File malformed?") - break - - var line_clean = line.strip_edges() - - # Beginning of new Sheet ID - if (line_clean.begins_with("[Sheet: ")) and (line_clean.ends_with("]")): - - # First, finish previous sheet_items - if sheet_items.size() > 0: - # Commits previous sheet data to result, and start new one - if sheet_id in result["sheets"]: - # If sheet is already in result, we merge - result["sheets"][sheet_id]["nodes"].append_array(sheet_items) - else: - result["sheets"][sheet_id] = { - "sheet_id": sheet_id, - "sheet_desc": sheet_desc, - "nodes": sheet_items, - } - - sheet_items = [] # Assing new array, don't call .clear() ! - - # else: sheet_items already empty, no action - - # Now start new sheet - sheet_id = line_clean.substr(8, line_clean.length()-9) - sheet_desc = "" - append_resource_map(sheet_id) - - # Description - line = lines.pop_front() - while not line.begins_with("[Sequence"): - if sheet_desc.length() > 0: - sheet_desc += " " # Description is single-line. Line breaks are for text file readability only. - sheet_desc += line.strip_edges() - line = lines.pop_front() - line_clean = line.strip_edges() - # This block doesn't use `continue` because we already fetched - # the next line, so we don't waste it and process it below - - if line_clean.strip_edges() == "[Sequence]": - message_unique_id = "" - current_message = null - current_tree_message = null - - sequence_unique_id = "" - current_node = null - current_tree_node = {"sequence_uid": "", "items": []} - sheet_items.append(current_tree_node) - - line = lines.pop_front() - continue - - if line_clean.begins_with("[Sequence: ") and line_clean.ends_with("]"): - message_unique_id = "" - current_message = null - current_tree_message = null - - sequence_unique_id = line_clean.substr(11, line_clean.length()-12) - if sequence_unique_id in resource_map: - current_node = resource_map[sequence_unique_id] - else: - #sequence_unique_id = "" - current_node = null - #current_tree_node = null - current_tree_node = {"sequence_uid": sequence_unique_id, "items": []} - sheet_items.append(current_tree_node) - - line = lines.pop_front() - continue - - - if (not ": " in line): - # Line not relevant, skipping... - line = lines.pop_front() - continue - - var re_res = re_speaker_with_resource.search(line) - if re_res is RegExMatch: - # Message start - message_unique_id = re_res.get_string("r") - if message_unique_id in resource_map: - current_message = resource_map[message_unique_id] - else: - current_message = null - - current_tree_message = {"message_uid": message_unique_id, "locales": {}} - - if (current_tree_node == null): - # This usually happens if the user forgot to explicitly start a sequence - # at the top of the file - current_tree_node = {"sequence_uid": "", "items": []} - sheet_items.append(current_tree_node) - - current_tree_node["items"].append(current_tree_message) - - var speaker_variant: Array = get_speaker_and_variant(re_res.get_string("n")) - var message_line: String = re_res.get_string("t").strip_edges() - if message_line == MULTILINE_MARKER: - message_line = get_multiline_text(lines) - - current_tree_message["speaker_id"] = speaker_variant[0] - current_tree_message["variant"] = speaker_variant[1] - current_tree_message["message_text"] = message_line - - else: - re_res = re_locale_text.search(line) - if re_res: - # Locale - if current_tree_message: - var locale: String = re_res.get_string("l") - var message_line: String = re_res.get_string("t") - if message_line == MULTILINE_MARKER: - message_line = get_multiline_text(lines) - - current_tree_message["locales"][locale] = message_line - - else: - re_res = re_speaker_without_resource.search(line) - if re_res: - # New message, without resource uid - var speaker_variant: Array = get_speaker_and_variant(re_res.get_string("n")) - var message_line: String = re_res.get_string("t").strip_edges() - if message_line == MULTILINE_MARKER: - message_line = get_multiline_text(lines) - - current_tree_message = {"message_uid": "", "locales": {}} - - if (current_tree_node == null): - # This usually happens if the user forgot to explicitly start a sequence - # at the top of the file - current_tree_node = {"sequence_uid": "", "items": []} - sheet_items.append(current_tree_node) - - current_tree_node["items"].append(current_tree_message) - - current_tree_message["speaker_id"] = speaker_variant[0] - current_tree_message["variant"] = speaker_variant[1] - current_tree_message["message_text"] = message_line - - line = lines.pop_front() - - # Append final sheet: - if sheet_items.size() > 0: - # Commits previous sheet data to result, and start new one - if sheet_id in result["sheets"]: - # If sheet is already in result, we merge - result["sheets"][sheet_id]["nodes"].append_array(sheet_items) - else: - result["sheets"][sheet_id] = { - "sheet_id": sheet_id, - "sheet_desc": sheet_desc, - "nodes": sheet_items, - } - - return result diff --git a/addons/madtalk/importers/imp_text.gd.uid b/addons/madtalk/importers/imp_text.gd.uid deleted file mode 100644 index 01a2186..0000000 --- a/addons/madtalk/importers/imp_text.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://ck3uxhalpdgug diff --git a/addons/madtalk/madtalk.gd b/addons/madtalk/madtalk.gd deleted file mode 100644 index c095463..0000000 --- a/addons/madtalk/madtalk.gd +++ /dev/null @@ -1,69 +0,0 @@ -@tool -# MadTalk Godot Plugin by Fernando Cosentino -# https://github.com/fbcosentino/godot-madtalk -# -# License: MIT -# (But if you can be so kind as to mention the original in your Readme in case -# you base any work on this, I would be very glad :] ) - -extends EditorPlugin - -# ============================================================================== -# GODOT PLUGIN INTEGRATION -# ------------------------------------------------------------------------------ - -# Scened to be instanced -var MadTalkEditor_scene = preload("res://addons/madtalk/madtalk_editor.tscn") - -# Resources -var viewport_icon = preload("res://addons/madtalk/images/madtalk_viewport_icon.png") - -# Inspector sheet_id editor -var sheet_id_inspector_editor = preload("res://addons/madtalk/components/InspectorPluginSheetIDField.gd").new() - -# Holds the main panel node in the viewport -var main_panel - -func _enter_tree(): - add_autoload_singleton("MadTalkGlobals", "res://addons/madtalk/runtime/MadTalkGlobals.tscn") - - add_inspector_plugin(sheet_id_inspector_editor) - - main_panel = MadTalkEditor_scene.instantiate() - - get_editor_interface().get_editor_main_screen().add_child(main_panel) - main_panel.setup() - _make_visible(false) - - - - - -func _exit_tree(): - remove_inspector_plugin(sheet_id_inspector_editor) - - if main_panel: - main_panel.queue_free() - - remove_autoload_singleton("MadTalkGlobals") - -func _has_main_screen(): - return true - - -func _make_visible(visible): - if main_panel: - main_panel.visible = visible - main_panel.call_deferred("reopen_current_sheet") - - -func _get_plugin_name(): - return "Dialog" - - -func _get_plugin_icon(): - return viewport_icon#get_editor_interface().get_base_control().get_icon("Node", "EditorIcons") - -func _save_external_data(): - if main_panel: - main_panel._save_external_data() diff --git a/addons/madtalk/madtalk.gd.uid b/addons/madtalk/madtalk.gd.uid deleted file mode 100644 index 06378c6..0000000 --- a/addons/madtalk/madtalk.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://ctmfju64cse3r diff --git a/addons/madtalk/madtalk_editor.gd b/addons/madtalk/madtalk_editor.gd deleted file mode 100644 index ce5183b..0000000 --- a/addons/madtalk/madtalk_editor.gd +++ /dev/null @@ -1,591 +0,0 @@ -@tool -extends Control - -@export var dialog_data: Resource = preload("res://addons/madtalk/runtime/madtalk_data.tres") -var current_sheet = null - -# Scene templates -var DialogNode_template = preload("res://addons/madtalk/components/DialogNode.tscn") -var SideBar_SheetItem_template = preload("res://addons/madtalk/components/SideBar_SheetItem.tscn") - -# Scene nodes -@onready var graph_area = get_node("GraphArea") - - -@onready var sidebar_sheetlist = get_node("SideBar/Content/SheetsScroll/VBox") -@onready var sidebar_current_panel = get_node("SideBar/Content/CurrentPanel") -@onready var SideBar_sheet_id = get_node("SideBar/Content/CurrentPanel/SheetIDLabel") -@onready var SideBar_sheet_desc = get_node("SideBar/Content/CurrentPanel/DescEdit") -@onready var SideBar_search = get_node("SideBar/Content/SearchEdit") - -@onready var graph_area_popup = get_node("PopupMenu") - -@onready var popup_delete_node = get_node("DialogDeleteNodePopup") - -@onready var dialog_sheet_edit = get_node("DialogSheetEdit") -@onready var dialog_sheet_rename_error_popup = get_node("DialogSheetRenameError") -@onready var dialog_sheet_create_popup = get_node("DialogSheetCreated") -@onready var dialog_export = get_node("DialogExport") -@onready var dialog_import = get_node("DialogImport") - -# Maps sequence ids to graph nodes -var sequence_map: Dictionary = {} - -# Holds the node being deleted when user presses X -var deleting_node = null - -# Holds the item object being dragged -var dragging_object = null -var hovering_object = null - - -func _ready() -> void: - pass - call_deferred("setup") - -func setup(): - if dialog_data.sheets.size() == 0: - create_new_sheet() - - else: - open_sheet(dialog_data.sheets.keys()[0]) - - dialog_export.setup(dialog_data, current_sheet) - dialog_import.setup(dialog_data, current_sheet) - -# Opens a sheet for the first time, or reopens (updates area content) -func open_sheet(sheet_id: String) -> void: - # FAILSAFE: We ignore this call if the sheet id is invalid - if not sheet_id in dialog_data.sheets: - print("Invalid sheet id \"%s\"" % sheet_id) - return - - # Clear all current content in the graph area - for dialog_node in graph_area.get_children(): - if dialog_node is DialogGraphNode: - graph_area.remove_child(dialog_node) - dialog_node.queue_free() - - sequence_map.clear() - - # Prepare new sheet - current_sheet = sheet_id - var sheet_data = dialog_data.sheets[sheet_id] - - # First we build all nodes *without* updating them - for node_data in sheet_data.nodes: - var new_node = create_node_instance(node_data, false) - sequence_map[node_data.sequence_id] = new_node - - # After we have all node instances available for connections, - # we update them - for sequence_id in sequence_map: - sequence_map[sequence_id].update_from_data() - - graph_area.scroll_offset.y -= 1 - update_sidebar() - rebuild_connections() - - await get_tree().process_frame - graph_area.scroll_offset.y += 1 - graph_area.queue_redraw() - -func reopen_current_sheet(): - open_sheet(current_sheet) - -# Creates the visual representation of a node -# Does not modify the data structure -func create_node_instance(node_data: Resource, update_now: bool = true) -> DialogGraphNode: - var new_node: GraphNode = DialogNode_template.instantiate() - new_node.name = "DialogNode_ID%d" % node_data.sequence_id - new_node.main_editor = self - graph_area.add_child(new_node) - new_node.position_offset = node_data.position - new_node.connections_changed.connect(_on_node_connections_changed) - new_node.mouse_entered.connect(_on_sequence_mouse_entered.bind(new_node)) - new_node.mouse_exited.connect(_on_sequence_mouse_exited.bind(new_node)) - #new_node.connect("close_request", Callable(self, "_on_node_close_request").bind(new_node)) - new_node.data = node_data # Assign the reference, not a copy - # Any changes to this node will reflect back in - # the main Resource - #new_node.show_close = (node_data.sequence_id != 0) - if (node_data.sequence_id != 0): - var new_close_btn = Button.new() - new_close_btn.text = " X " - new_close_btn.focus_mode = Control.FOCUS_NONE - new_node.get_titlebar_hbox().add_child(new_close_btn) - new_close_btn.pressed.connect(_on_node_close_request.bind(new_node)) - - # During sheet building not all nodes are ready so updating connections - # will fail. In such a case we skip this task and update all nodes at once - # later - if (update_now): - new_node.update_from_data() - - return new_node - -# Creates a new node, optionally creating the visual GraphNode -func create_new_node(graph_position: Vector2 = Vector2(0,0), create_visual_instance = false) -> DialogNodeData: - if not current_sheet: - return null - - var sheet_data = dialog_data.sheets[current_sheet] - - # 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 = graph_position - 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 - - sheet_data.nodes.append(new_data) - sheet_data.next_sequence_id = next_available_id+1 - - # create_visual_instance is true when the node is created from user - # interaction ("New sequence" button). It is false when the data is being - # created procedurally and instances will be created later by open_sheet() - # DEPRECATED: now all methods call here with create_visual_instance=false - # and call open_sheet() afterwards - if create_visual_instance: - create_node_instance(new_data, true) - rebuild_connections() # Should not be needed but reduntant calls are harmless - - return new_data - -# Creates a new sheet, set as current, and returns the name of the sheet -func create_new_sheet() -> String: - # Find a suitable available name - var sheet_num = 1 - var new_sheet_name = "new_sheet_1" - while new_sheet_name in dialog_data.sheets: - sheet_num += 1 - new_sheet_name = "new_sheet_%d" % sheet_num - - # Create the new sheet - 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 = new_sheet_name - new_sheet_data.nodes = [] # Forces a new array to avoid reference sharing - dialog_data.sheets[new_sheet_name] = new_sheet_data - current_sheet = new_sheet_name - - # All sheets need at least one node with ID=0 - # Create a node data item without creating the GraphNode instance, as - # it will be created later by open_sheet() - create_new_node(Vector2(0,0), false) - - # Update sidebar and open sheet - update_sidebar() - open_sheet(new_sheet_name) - #rebuild_connections() - - return new_sheet_name - - -# Connections are not build directly from UI -# Instead they are rebuilt from the Resource data objects every time -# This is the safest way to make sure there is never any difference between -# the visual representation and the underlying data -func rebuild_connections() -> void: - - graph_area.clear_connections() - - for sequence_id in sequence_map: - var dialog_node = sequence_map[sequence_id] - - - var sequence_data = dialog_node.data - - # For each item in this sequence - for item_data in sequence_data.items: - # Do we have a connection? - if (item_data.connected_to_id > -1) and (item_data.port_index > -1): - var target_node = get_dialognode_by_id(item_data.connected_to_id) - if target_node: - graph_area.connect_node(dialog_node.name, item_data.port_index, target_node.name, 0) - - # For each option in this sequence - for opt_data in sequence_data.options: - # Do we have a connection? - if (opt_data.connected_to_id > -1) and (opt_data.port_index > -1): - var target_node = get_dialognode_by_id(opt_data.connected_to_id) - if target_node: - graph_area.connect_node(dialog_node.name, opt_data.port_index, target_node.name, 0) - - # If we have a continue option at the end - if sequence_data.continue_sequence_id > -1: - var target_node = get_dialognode_by_id(sequence_data.continue_sequence_id) - if target_node: - graph_area.connect_node(dialog_node.name, sequence_data.continue_port_index, target_node.name, 0) - - - - -# Given a sequence id, returns the corresponding GraphNode object -func get_dialognode_by_id(id: int) -> DialogGraphNode: - if not id in sequence_map: - print("Error: node ID %s not found in sequence map" % id) - return null - - return sequence_map[id] - -func update_sidebar(): - # === Update current sheet - if current_sheet: - var sheet_data = dialog_data.sheets[current_sheet] - SideBar_sheet_id.text = sheet_data.sheet_id - SideBar_sheet_desc.text = sheet_data.sheet_description - sidebar_current_panel.show() - - else: - sidebar_current_panel.hide() - - # === Update list - - # Remove old items - for old_item in sidebar_sheetlist.get_children(): - sidebar_sheetlist.remove_child(old_item) - old_item.queue_free() - - # Add new items - var search_term = SideBar_search.text - for this_sheet_id in dialog_data.sheets: - var new_item_data = dialog_data.sheets[this_sheet_id] - # If there is no search, or search shows up in either id or description: - if (search_term == "") or (search_term in this_sheet_id) or (search_term in new_item_data.sheet_description): - var new_item = SideBar_SheetItem_template.instantiate() - sidebar_sheetlist.add_child(new_item) - new_item.get_node("Panel/SheetLabel").text = new_item_data.sheet_id - new_item.get_node("Panel/DescriptionLabel").text = new_item_data.sheet_description - new_item.get_node("Panel/BtnOpen").connect("pressed", Callable(self, "_on_SideBar_Item_open").bind(new_item_data.sheet_id)) - - -func _save_external_data(): - var res_path = dialog_data.resource_path - ResourceSaver.save(dialog_data, res_path, 0) - -# ============================================================================== -# UI CALLBACKS - - -## Distributes the input event to the appropriate method -func _on_GraphEdit_gui_input(event: InputEvent) -> void: - if (event is InputEventMouseButton) and (event.pressed): - match event.button_index: - MOUSE_BUTTON_LEFT: - _on_GraphEdit_left_click(event) - - MOUSE_BUTTON_RIGHT: - _on_GraphEdit_right_click(event) - #if (event is InputEventMouseMotion): - # print( (graph_area.get_local_mouse_position() + graph_area.scroll_offset)/graph_area.zoom ) - - -## Handles left clicks -func _on_GraphEdit_left_click(event: InputEvent) -> void: - # event.position is screen coordinate, not taking scroll into account - # graph_position is in node local coordinates - var graph_position = event.position + graph_area.scroll_offset - - #print("LEFT CLICK: " + str(graph_position)) - #print(graph_area.scroll_offset) - -## Handles right clicks -func _on_GraphEdit_right_click(event: InputEvent) -> void: - # event.position is screen coordinate, not taking scroll into account - # graph_position is in node local coordinates - var graph_position = event.position + graph_area.scroll_offset - - var cursor_position = Vector2(get_viewport().get_mouse_position() if get_viewport().gui_embed_subwindows else DisplayServer.mouse_get_position()) - graph_area_popup.popup(Rect2(cursor_position, Vector2(10,10))) - - -# When a node item (message, condition, effect) is mouse-hovered -# Also happens if dragging started on another object -func _on_item_mouse_entered(obj: Control) -> void: - hovering_object = obj - if (dragging_object != null) and (dragging_object != obj): - obj.modulate.a = 0.7 - obj.dragdrop_line.show() - -# When a node item (message, condition, effect) loses mouse hover -# Also happens if dragging started on another object -func _on_item_mouse_exited(obj: Control) -> void: - if hovering_object == obj: - hovering_object = null - if dragging_object != null: - obj.modulate.a = 1.0 - obj.dragdrop_line.hide() - - -func _on_sequence_mouse_entered(obj: Control): - hovering_object = obj - if dragging_object != null: - obj.modulate.a = 0.7 - -func _on_sequence_mouse_exited(obj: Control): - if hovering_object == obj: - hovering_object = null - if dragging_object != null: - obj.modulate.a = 1.0 - - -# When the mouse is pressed down on a node item, which counts as -# start dragging it. -func _on_item_drag_started(obj: Control) -> void: - dragging_object = obj - - -# When the mouse is released after dragging an item. The obj argument -# contains the object being dragged, not the one under the cursor -func _on_item_drag_ended(obj: Control) -> void: - if (dragging_object != hovering_object): - move_item_by_instance(dragging_object, hovering_object) - - if hovering_object and is_instance_valid(hovering_object): - hovering_object.modulate.a = 1.0 - if not hovering_object is DialogGraphNode: - hovering_object.dragdrop_line.hide() - - hovering_object = null - dragging_object = null - - -func move_item_by_instance(source_inst: Control, dest_inst): - if (not source_inst) or (not is_instance_valid(source_inst)): - return - if (not dest_inst) or (not is_instance_valid(dest_inst)): - return - - var source_seq = source_inst.sequence_node - var data_seq_origin = source_seq.data - var source_index = data_seq_origin.items.find(source_inst.data) - var source_item_data = data_seq_origin.items[source_index] - - var dest_seq - var data_seq_dest - var dest_index - - if dest_inst is DialogGraphNode: - # Dragging onto a sequence header - dest_seq = dest_inst - data_seq_dest = dest_seq.data - dest_index = data_seq_dest.items.size() - - else: - # Dragging onto another item - dest_seq = dest_inst.sequence_node - data_seq_dest = dest_seq.data - dest_index = data_seq_dest.items.find(dest_inst.data) - - # There are special cases if the node is being reordered inside the same sequence - if (data_seq_origin == data_seq_dest): - if (dest_index == (source_index+1)): - # If the user dropped on the item immediately below, no operation is needed - return - - elif (dest_index > source_index): - # If item is being moved below, removing it first will shift indices - # below that point, causing the reinsert to have an unintended - # extra offset of 1. So counteract is needed - dest_index -= 1 - - data_seq_origin.items.remove_at(source_index) - data_seq_dest.items.insert(dest_index, source_item_data) - - source_seq.update_from_data() - dest_seq.update_from_data() - - await get_tree().create_timer(0.02).timeout - call_deferred("rebuild_connections") - - - -func _on_GraphArea_connection_request(from, from_slot, to, to_slot): - # Get the required data - var from_node = graph_area.get_node(NodePath(from)) - var from_data = from_node.get_data_by_port(from_slot) - var to_node = graph_area.get_node(NodePath(to)) - # to_slot is always 0 in this application - var to_sequence_id = to_node.data.sequence_id - - # Make the connection in the underlying data resources - if from_data is DialogNodeData: - # This is a simple continue - from_data.continue_sequence_id = to_sequence_id - - else: - # This is a branching - from_data.connected_to_id = to_sequence_id - - rebuild_connections() - - -func _on_GraphArea_disconnection_request(from, from_slot, to, to_slot): - # Get the required data - var from_node = graph_area.get_node(NodePath(from)) - var from_data = from_node.get_data_by_port(from_slot) - - # Make the connection in the underlying data resources - if from_data is DialogNodeData: - # This is a simple continue - from_data.continue_sequence_id = -1 - - else: - # This is a branching - from_data.connected_to_id = -1 - - rebuild_connections() - - -func _on_node_connections_changed() -> void: - rebuild_connections() - -func _on_node_close_request(node_object) -> void: - deleting_node = node_object - popup_delete_node.popup_centered() - - -func _on_SideBar_SearchEdit_text_changed(new_text) -> void: - update_sidebar() - - -func _on_GraphArea_PopupMenu_id_pressed(id) -> void: - match id: - 0: - # Create new node - - # graph_area_popup.rect_position is screen coordinate, not taking scroll into account - # graph_position is in node local coordinates - #var cursor_position = Vector2(graph_area_popup.position) - #var graph_position = Vector2(cursor_position) + Vector2(graph_area.scroll_offset) - #var graph_position = Vector2(graph_area_popup.position) + Vector2(graph_area.scroll_offset) - var graph_position = Vector2((graph_area.get_local_mouse_position() + graph_area.scroll_offset)/graph_area.zoom) - - create_new_node(graph_position - Vector2(100,10), false) - open_sheet(current_sheet) - - -func _on_DialogDeleteNodePopup_confirmed() -> void: - if (not current_sheet) or (not deleting_node): - return - - var sheet_data = dialog_data.sheets[current_sheet] - var node_data = deleting_node.data - - sheet_data.nodes.erase(node_data) - - # Reopens the sheet to update area - open_sheet(current_sheet) - - -func _on_BtnEditSheet_pressed() -> void: - if not current_sheet: - return - - var sheet_data = dialog_data.sheets[current_sheet] - dialog_sheet_edit.open(sheet_data) - -func _on_DialogSheetEdit_sheet_saved(sheet_id, sheet_desc, delete_word) -> void: - if not current_sheet: - return - - # Is the user requesting to delete the sheet? - if delete_word == "delete": - dialog_data.sheets[current_sheet].nodes = [] # Discards references to node data - dialog_data.sheets[current_sheet] = null - dialog_data.sheets.erase(current_sheet) - - # If this was the last sheet, we create a new one - if dialog_data.sheets.size() == 0: - # This method creates a new sheet, sets as current and returns the - # new sheet name - var _new_sheet = create_new_sheet() - - # Otherwise select some other sheet - else: - current_sheet = dialog_data.sheets.keys()[0] - open_sheet(current_sheet) - - # Hide the window - dialog_sheet_edit.hide() - - update_sidebar() - # Stop here since the old sheet is no longer valid - return - - # Otherwise the user is editting the sheet - - var sheet_data = dialog_data.sheets[current_sheet] - - # Check if the sheet is being renamed and if the name does not collide - if sheet_id != sheet_data.sheet_id: - # User wants to rename - # Check if this id is invalid or being used - if (sheet_id == "") or (sheet_id in dialog_data.sheets): - # Show an error message instead - dialog_sheet_rename_error_popup.popup_centered() - # Stop here and don't make any changes - return - - else: - # Rename the sheet - dialog_data.sheets.erase(current_sheet) - sheet_data.sheet_id = sheet_id - dialog_data.sheets[sheet_id] = sheet_data - current_sheet = sheet_id - - # Change description - sheet_data.sheet_description = sheet_desc - - # Editting sheet details (ID, description) does not change node content - # so calling open_sheet() is not required - - # Update current sheet panel and listing - update_sidebar() - # Hide window - dialog_sheet_edit.hide() - - #var mtdefs = MTDefs.new() - #mtdefs.debug_resource(dialog_data) - -func _on_SideBar_Item_open(sheet_id) -> void: - open_sheet(sheet_id) - -func _on_BtnNewSheet_pressed() -> void: - create_new_sheet() - - # Open sheet edit window - _on_BtnEditSheet_pressed() - - # Inform user about successful sheet creation and edit window - dialog_sheet_create_popup.popup_centered() - - -func _on_BtnSaveDB_pressed(): - var res_path = dialog_data.resource_path - ResourceSaver.save(dialog_data, res_path, 0) - - -func _on_ImportExport_BtnExport_pressed() -> void: - dialog_export.set_current_sheet(current_sheet, true) - dialog_export.refresh_export_sheet_list() - dialog_export.popup_centered() - - -func _on_ImportExport_BtnImportSheet_pressed() -> void: - dialog_import.set_current_sheet(current_sheet) - dialog_import.reset_and_show() - - -func _on_dialog_import_import_executed(destination_sheet: String) -> void: - if destination_sheet != "": - open_sheet(destination_sheet) - else: - reopen_current_sheet() diff --git a/addons/madtalk/madtalk_editor.gd.uid b/addons/madtalk/madtalk_editor.gd.uid deleted file mode 100644 index e2c3fdf..0000000 --- a/addons/madtalk/madtalk_editor.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b0efsmc8oj74f diff --git a/addons/madtalk/madtalk_editor.tres b/addons/madtalk/madtalk_editor.tres deleted file mode 100644 index a4cd7ba..0000000 --- a/addons/madtalk/madtalk_editor.tres +++ /dev/null @@ -1,8 +0,0 @@ -[gd_resource type="Resource" script_class="DialogData" load_steps=2 format=3 uid="uid://dwcr132r2bocb"] - -[ext_resource type="Script" uid="uid://bw2q2eucjkylk" path="res://addons/madtalk/components/resources/DialogData.gd" id="4"] - -[resource] -script = ExtResource("4") -version = 1.0 -sheets = {} diff --git a/addons/madtalk/madtalk_editor.tscn b/addons/madtalk/madtalk_editor.tscn deleted file mode 100644 index 31e7eb1..0000000 --- a/addons/madtalk/madtalk_editor.tscn +++ /dev/null @@ -1,341 +0,0 @@ -[gd_scene load_steps=15 format=3 uid="uid://csmaqkwk66cjs"] - -[ext_resource type="Script" uid="uid://b0efsmc8oj74f" path="res://addons/madtalk/madtalk_editor.gd" id="1"] -[ext_resource type="FontFile" uid="uid://b38okvijpcxmv" path="res://addons/madtalk/fonts/FreeSans_smal.tres" id="3"] -[ext_resource type="PackedScene" uid="uid://c6topqf6spbbw" path="res://addons/madtalk/components/SideBar.tscn" id="8"] -[ext_resource type="FontFile" uid="uid://cgfeudab78x0q" path="res://addons/madtalk/fonts/FreeSans.ttf" id="8_78yji"] -[ext_resource type="FontFile" uid="uid://bhcws34lw0ak5" path="res://addons/madtalk/fonts/FreeSans_tiny.tres" id="9"] -[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/ButtonStyle.tres" id="10"] -[ext_resource type="PackedScene" uid="uid://cx148tfhw6ida" path="res://addons/madtalk/components/ImportBar.tscn" id="10_f8dcc"] -[ext_resource type="StyleBox" path="res://addons/madtalk/components/resources/SheetItemStyle.tres" id="11"] -[ext_resource type="PackedScene" uid="uid://difhfxods7ra3" path="res://addons/madtalk/components/MainEditor_DialogExport.tscn" id="12_bwljl"] -[ext_resource type="FontFile" path="res://addons/madtalk/fonts/FreeSans_bold_small.tres" id="13"] -[ext_resource type="PackedScene" uid="uid://b22lta4yhfhgu" path="res://addons/madtalk/components/MainEditor_DialogImport.tscn" id="13_35vb6"] -[ext_resource type="Texture2D" uid="uid://c4ne7fiheatjc" path="res://addons/madtalk/images/icon_search.png" id="14"] -[ext_resource type="PackedScene" uid="uid://cc7b2xbic6kf8" path="res://addons/madtalk/components/MainEditor_DialogSheetEdit.tscn" id="15"] - -[sub_resource type="FontVariation" id="FontVariation_yfgdd"] -base_font = ExtResource("8_78yji") -spacing_top = -4 -spacing_bottom = -4 - -[node name="MadTalkEditor" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = -3.1748 -offset_right = -3.1748 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_vertical = 3 -script = ExtResource("1") - -[node name="TopBar" type="Panel" parent="."] -layout_mode = 0 -anchor_right = 1.0 -offset_bottom = 31.0 - -[node name="GraphArea" type="GraphEdit" parent="."] -layout_mode = 0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = 31.0 -right_disconnects = true - -[node name="SideBar" parent="." instance=ExtResource("8")] -layout_mode = 1 -anchors_preset = -1 -anchor_bottom = 1.0 -offset_left = -216.0 -offset_top = 4.0 -offset_right = -16.0 -offset_bottom = -25.0 -grow_horizontal = 0 - -[node name="Content" type="Control" parent="SideBar"] -clip_contents = true -anchors_preset = 0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = 25.0 - -[node name="CurrentPanel" type="Panel" parent="SideBar/Content"] -layout_mode = 1 -anchors_preset = 10 -anchor_right = 1.0 -offset_left = 4.0 -offset_top = 2.0 -offset_right = -4.0 -offset_bottom = 105.0 -grow_horizontal = 2 -theme_override_styles/panel = ExtResource("11") - -[node name="TitleLabel" type="Label" parent="SideBar/Content/CurrentPanel"] -layout_mode = 0 -offset_left = 4.0 -offset_top = 4.0 -offset_right = 78.0 -offset_bottom = 18.0 -theme_override_fonts/font = ExtResource("3") -theme_override_font_sizes/font_size = 12 -text = "Current sheet" - -[node name="Label" type="Label" parent="SideBar/Content/CurrentPanel"] -layout_mode = 0 -offset_left = 5.52808 -offset_top = 23.0 -offset_right = 21.5281 -offset_bottom = 46.0 -theme_override_fonts/font = ExtResource("3") -theme_override_font_sizes/font_size = 12 -text = "ID:" - -[node name="SheetIDLabel" type="Label" parent="SideBar/Content/CurrentPanel"] -layout_mode = 1 -anchors_preset = 10 -anchor_right = 1.0 -offset_left = 9.0 -offset_top = 39.0 -offset_right = -7.0 -offset_bottom = 58.0 -grow_horizontal = 2 -theme_override_colors/font_color = Color(0.470588, 0.898039, 1, 1) -theme_override_fonts/font = ExtResource("13") -theme_override_font_sizes/font_size = 12 -text = "1_start_here" -clip_text = true - -[node name="Label2" type="Label" parent="SideBar/Content/CurrentPanel"] -layout_mode = 0 -offset_left = 5.52808 -offset_top = 62.0 -offset_right = 96.5281 -offset_bottom = 85.0 -theme_override_fonts/font = ExtResource("9") -theme_override_font_sizes/font_size = 12 -text = "Short description" - -[node name="DescEdit" type="Label" parent="SideBar/Content/CurrentPanel"] -layout_mode = 1 -anchors_preset = 10 -anchor_right = 1.0 -offset_left = 6.0 -offset_top = 80.0 -offset_right = -5.0 -offset_bottom = 101.0 -grow_horizontal = 2 -theme_override_colors/font_color = Color(0.772549, 0.772549, 0.772549, 1) -theme_override_constants/line_spacing = 0 -theme_override_fonts/font = SubResource("FontVariation_yfgdd") -theme_override_font_sizes/font_size = 10 -text = "Demonstration sheet. You can delete this in your game, or repurpose it." -autowrap_mode = 3 -clip_text = true - -[node name="BtnEditSheet" type="Button" parent="SideBar/Content/CurrentPanel"] -layout_mode = 0 -anchor_left = 1.0 -anchor_right = 1.0 -offset_left = -45.0 -offset_top = 3.0 -offset_right = -3.0 -offset_bottom = 23.0 -theme_override_fonts/font = ExtResource("3") -theme_override_font_sizes/font_size = 12 -theme_override_styles/normal = ExtResource("10") -text = "Edit" - -[node name="labelSheetList" type="Label" parent="SideBar/Content"] -layout_mode = 0 -offset_left = 8.0 -offset_top = 120.0 -offset_right = 82.0 -offset_bottom = 134.0 -theme_override_fonts/font = ExtResource("3") -theme_override_font_sizes/font_size = 12 -text = "Sheet list" - -[node name="SearchIcon" type="TextureRect" parent="SideBar/Content"] -layout_mode = 0 -anchor_left = 1.0 -anchor_right = 1.0 -offset_left = -23.0 -offset_top = 141.0 -offset_right = -7.0 -offset_bottom = 157.0 -texture = ExtResource("14") - -[node name="SearchEdit" type="LineEdit" parent="SideBar/Content"] -layout_mode = 1 -anchors_preset = 10 -anchor_right = 1.0 -offset_left = 3.0 -offset_top = 137.0 -offset_right = -31.0 -offset_bottom = 161.0 -grow_horizontal = 2 -theme_override_fonts/font = ExtResource("3") -theme_override_font_sizes/font_size = 12 -theme_override_styles/normal = ExtResource("11") -placeholder_text = "Search ID or description" - -[node name="SheetsScroll" type="ScrollContainer" parent="SideBar/Content"] -layout_mode = 0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = 166.0 -offset_bottom = -29.0 - -[node name="VBox" type="VBoxContainer" parent="SideBar/Content/SheetsScroll"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="BtnNewSheet" type="Button" parent="SideBar/Content"] -layout_mode = 0 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = 4.0 -offset_top = -24.0 -offset_right = -4.0 -offset_bottom = -4.0 -theme_override_fonts/font = ExtResource("3") -theme_override_font_sizes/font_size = 12 -theme_override_styles/focus = ExtResource("10") -theme_override_styles/hover = ExtResource("10") -theme_override_styles/normal = ExtResource("10") -text = "Create New Dialog Sheet" - -[node name="BtnSaveDB" type="Button" parent="SideBar/Content"] -visible = false -layout_mode = 0 -anchor_top = 1.0 -anchor_right = 0.5 -anchor_bottom = 1.0 -offset_left = 4.0 -offset_top = -24.0 -offset_right = -4.0 -offset_bottom = -4.0 -theme_override_fonts/font = ExtResource("3") -theme_override_styles/focus = ExtResource("10") -theme_override_styles/hover = ExtResource("10") -theme_override_styles/normal = ExtResource("10") -text = "Save Database" - -[node name="ImportBar" parent="." instance=ExtResource("10_f8dcc")] -layout_mode = 1 -offset_left = -423.825 -offset_top = 4.0 -offset_right = -223.825 -offset_bottom = 28.0 -SizeOpen = 100 - -[node name="Content" type="Control" parent="ImportBar"] -visible = false -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = 25.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="BtnExport" type="Button" parent="ImportBar/Content"] -layout_mode = 1 -anchors_preset = 10 -anchor_right = 1.0 -offset_left = 4.0 -offset_top = 4.0 -offset_right = -4.0 -offset_bottom = 28.0 -grow_horizontal = 2 -theme_override_fonts/font = ExtResource("3") -theme_override_font_sizes/font_size = 12 -theme_override_styles/focus = ExtResource("10") -theme_override_styles/hover = ExtResource("10") -theme_override_styles/normal = ExtResource("10") -text = "Export Current Sheet..." - -[node name="BGLine" type="ColorRect" parent="ImportBar/Content"] -layout_mode = 1 -anchors_preset = 10 -anchor_right = 1.0 -offset_left = 4.0 -offset_top = 35.0 -offset_right = -4.0 -offset_bottom = 37.0 -grow_horizontal = 2 -color = Color(1, 1, 1, 0.12549) - -[node name="BtnImportSheet" type="Button" parent="ImportBar/Content"] -layout_mode = 1 -anchors_preset = 10 -anchor_right = 1.0 -offset_left = 4.0 -offset_top = 44.0 -offset_right = -4.0 -offset_bottom = 68.0 -grow_horizontal = 2 -theme_override_fonts/font = ExtResource("3") -theme_override_font_sizes/font_size = 12 -theme_override_styles/focus = ExtResource("10") -theme_override_styles/hover = ExtResource("10") -theme_override_styles/normal = ExtResource("10") -text = "Import Dialog Data..." - -[node name="PopupMenu" type="PopupMenu" parent="."] -size = Vector2i(141, 100) -item_count = 1 -item_0/text = "New sequence" -item_0/id = 0 - -[node name="DialogDeleteNodePopup" type="ConfirmationDialog" parent="."] -size = Vector2i(500, 187) -dialog_text = " - - Are you sure you want to delete this entire sequence?" -dialog_autowrap = true - -[node name="DialogSheetRenameError" type="AcceptDialog" parent="."] -size = Vector2i(500, 200) -dialog_text = " - Error while renaming sheet: - - The chosen sheet ID is not valid or - there is already a sheet using this ID" -dialog_autowrap = true - -[node name="DialogSheetCreated" type="AcceptDialog" parent="."] -size = Vector2i(400, 200) -dialog_text = " - The new sheet was successfully created. - - You are now modifying the new one." -dialog_autowrap = true - -[node name="DialogSheetEdit" parent="." instance=ExtResource("15")] -visible = false - -[node name="DialogExport" parent="." instance=ExtResource("12_bwljl")] -visible = false - -[node name="DialogImport" parent="." instance=ExtResource("13_35vb6")] -visible = false - -[connection signal="connection_request" from="GraphArea" to="." method="_on_GraphArea_connection_request"] -[connection signal="disconnection_request" from="GraphArea" to="." method="_on_GraphArea_disconnection_request"] -[connection signal="gui_input" from="GraphArea" to="." method="_on_GraphEdit_gui_input"] -[connection signal="pressed" from="SideBar/Content/CurrentPanel/BtnEditSheet" to="." method="_on_BtnEditSheet_pressed"] -[connection signal="text_changed" from="SideBar/Content/SearchEdit" to="." method="_on_SideBar_SearchEdit_text_changed"] -[connection signal="pressed" from="SideBar/Content/BtnNewSheet" to="." method="_on_BtnNewSheet_pressed"] -[connection signal="pressed" from="SideBar/Content/BtnSaveDB" to="." method="_on_BtnSaveDB_pressed"] -[connection signal="pressed" from="ImportBar/Content/BtnExport" to="." method="_on_ImportExport_BtnExport_pressed"] -[connection signal="pressed" from="ImportBar/Content/BtnImportSheet" to="." method="_on_ImportExport_BtnImportSheet_pressed"] -[connection signal="id_pressed" from="PopupMenu" to="." method="_on_GraphArea_PopupMenu_id_pressed"] -[connection signal="confirmed" from="DialogDeleteNodePopup" to="." method="_on_DialogDeleteNodePopup_confirmed"] -[connection signal="confirmed" from="DialogSheetRenameError" to="." method="_on_DialogDeleteNodePopup_confirmed"] -[connection signal="confirmed" from="DialogSheetCreated" to="." method="_on_DialogDeleteNodePopup_confirmed"] -[connection signal="sheet_saved" from="DialogSheetEdit" to="." method="_on_DialogSheetEdit_sheet_saved"] -[connection signal="import_executed" from="DialogImport" to="." method="_on_dialog_import_import_executed"] diff --git a/addons/madtalk/madtalk_viewport_icon.png.import b/addons/madtalk/madtalk_viewport_icon.png.import deleted file mode 100644 index 1eb04fd..0000000 --- a/addons/madtalk/madtalk_viewport_icon.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/madtalk_viewport_icon.png-6476d0d777038043e1e4a2f58a531b7c.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/madtalk/madtalk_viewport_icon.png" -dest_files=[ "res://.import/madtalk_viewport_icon.png-6476d0d777038043e1e4a2f58a531b7c.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/addons/madtalk/plugin.cfg b/addons/madtalk/plugin.cfg deleted file mode 100644 index a88167c..0000000 --- a/addons/madtalk/plugin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[plugin] - -name="MadTalk" -description="Multi-purpose dialog system integrated to game state and time" -author="Fernando Cosentino (fbcosentino)" -version="0.0.1" -script="madtalk.gd" diff --git a/addons/madtalk/runtime/CharacterData.gd b/addons/madtalk/runtime/CharacterData.gd deleted file mode 100644 index c620493..0000000 --- a/addons/madtalk/runtime/CharacterData.gd +++ /dev/null @@ -1,9 +0,0 @@ -extends Resource -class_name MTCharacterData - - -@export var id: String = "" -@export var name: String = "" -@export var avatar: Texture2D = null - -@export var variants: Dictionary = {} diff --git a/addons/madtalk/runtime/CharacterData.gd.uid b/addons/madtalk/runtime/CharacterData.gd.uid deleted file mode 100644 index 6e19ca0..0000000 --- a/addons/madtalk/runtime/CharacterData.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://crm8hyh7nn5vb diff --git a/addons/madtalk/runtime/MadTalkGlobals.gd b/addons/madtalk/runtime/MadTalkGlobals.gd deleted file mode 100644 index 9b00bfd..0000000 --- a/addons/madtalk/runtime/MadTalkGlobals.gd +++ /dev/null @@ -1,307 +0,0 @@ -extends Node - -var is_during_dialog = false -var is_during_cinematic = false - -var variables := { -} -var options_visited_global := { -} -var options_visited_dialog := { -} - -var time = 0 -var gametime_offset = 0 -var gametime_year = 1 - -@onready var gametime = epoch_to_game_time(time) - -func set_variable(var_name: String, var_value) -> void: - variables[var_name] = var_value - -func get_variable(var_name: String, default = 0.0): - if var_name in variables: - return variables[var_name] - else: - return default - -func set_option_visited(option: DialogNodeOptionData, visited: bool): - options_visited_global[option.resource_scene_unique_id] = visited - options_visited_dialog[option.resource_scene_unique_id] = visited - -func get_option_visited_global(option: DialogNodeOptionData) -> bool: - if not option.resource_scene_unique_id in options_visited_global: - return false - return options_visited_global[option.resource_scene_unique_id] - -func get_option_visited_dialog(option: DialogNodeOptionData) -> bool: - if not option.resource_scene_unique_id in options_visited_dialog: - return false - return options_visited_dialog[option.resource_scene_unique_id] - -func reset_options_visited_dialog(): - options_visited_dialog.clear() - - -# ============================================================================== -# LOCALE - -var default_locale := "en" -var current_locale := "" - - -func set_locale(locale_code: String): - current_locale = locale_code - if current_locale == default_locale: - current_locale = "" - - -func set_default_locale(locale_code: String): - default_locale = locale_code - if current_locale == default_locale: - current_locale = "" - - -func set_locale_automatic(def_locale: String = default_locale): - default_locale = def_locale - var locale = OS.get_locale_language() - set_locale(locale) - - -func set_locale_from_project(def_locale: String = default_locale): - default_locale = def_locale - var locale = TranslationServer.get_locale() - if "_" in locale: - locale = locale.left(locale.find("_")) - set_locale(locale) - - -# ============================================================================== -# TIME - -func set_game_year(year: int) -> void: - gametime_year = year - var dt = { - "year": year, - "month": 1, - "day": 1, - "hour": 0, - "minute": 0, - "second": 0 - } - gametime_offset = Time.get_unix_time_from_datetime_dict(dt) - gametime = epoch_to_game_time(time) - -## -# Returns datetime in game reference (that is, -# start of game is 01/01/0001 00:00:00) -# Can be seen as "elapsed gameplay time" -func epoch_to_game_time(epoch_time: int) -> Dictionary: - # Date time dictionary has the format: - # { - # "year": ..., - # "month": ..., - # "day": ..., - # "weekday": ..., - # "hour": ..., - # "minute": ..., - # "second": ... - # } - # Custom values added here are: - # "time": String hour/minute in format HH:MM - # "date": String day/month in format DD/MM - # "date_inv": String day/month in format MM/DD - - var dt = Time.get_datetime_dict_from_unix_time(gametime_offset + epoch_time) - dt["year"] -= gametime_year-1 # year - 1, so starts at year 1 - dt["time"] = "%02d:%02d" % [dt["hour"], dt["minute"]] - dt["date"] = "%02d/%02d" % [dt["day"], dt["month"]] - dt["date_inv"] = "%02d/%02d" % [dt["month"], dt["day"]] - dt["weekday_name"] = MTDefs.WeekdayNames[dt["weekday"]] - dt["wday_name"] = MTDefs.WeekdayNamesShort[dt["weekday"]] - return dt - -# Converts day, month, year to unix epoch time -func game_time_to_epoch(p_gametime: Dictionary) -> int: - p_gametime["year"] += gametime_year-1 # Year 1 is base, - return Time.get_unix_time_from_datetime_dict(p_gametime) - gametime_offset - -func update_gametime_dict(): - gametime = epoch_to_game_time(time) - - -# Converts day, month, year to unix epoch time -func date_to_int(day: int, month: int, year: int) -> int: - return game_time_to_epoch({ - "year": year, "month": month, "day": day, - "hour": 0, "minute": 0, "second": 0 - }) - -# Converts hour, minute to float fractional hour -# Example: 2, 30 becomes 2.5 -func time_to_float(hour: int, minute: int) -> float: - return float(hour) + float(minute)/60.0 - -func time_to_string(epoch_time: int, simplified: bool = true) -> String: - # Date time dictionary has the format: - # { - # "year": ..., - # "month": ..., - # "day": ..., - # "weekday": ..., - # "hour": ..., - # "minute": ..., - # "second": ... - # } - var dt = epoch_to_game_time(epoch_time) - var res = "" - - # Simplified version is Weekday HH:MM - if (simplified): - res = MTDefs.WeekdayNames[dt['weekday']].left(3) - res += " %02d:%02d" % [dt['hour'], dt['minute']] - - # Non-simplified is Weekday, DD of MonthName HH:MM - else: - res = MTDefs.WeekdayNames[dt['weekday']] - res += ", "+str(dt['day']) - res += " "+MTDefs.MonthNames[dt['month']] - res += " %02d:%02d" % [dt['hour'], dt['minute']] - - return res - - -func split_time(value: String) -> Array: - # TODO: this is not very efficient code. To be rewritten to run faster - var nums_psa = Array(str(value).split(':')) - while nums_psa.size() < 2: - nums_psa.append(0) - var nums = [int(nums_psa[0]), int(nums_psa[1])] - if (nums[0] < 0) or (nums[0] > 23): - nums[0] = 0 - if (nums[1] < 0) or (nums[1] > 59): - nums[1] = 0 - return [nums[0], nums[1]] - -func split_date(value: String) -> Array: - # TODO: this is not very efficient code. To be rewritten to run faster - var nums_psa = Array(str(value).split('/')) - while nums_psa.size() < 2: - nums_psa.append(1) - var nums = [int(nums_psa[0]), int(nums_psa[1])] - if (nums[0] < 1) or (nums[0] > 31): - nums[0] = 1 - if (nums[1] < 1) or (nums[1] > 12): - nums[1] = 1 - return [nums[0], nums[1]] - -func print_date(value: String) -> String: - var nums = split_date(value) - var day = "%02d" % nums[0] - var month = MTDefs.MonthNames[nums[1]].left(3) - return day+' '+month - -func print_weekday(value): - while value > 6: - value -= 7 - return MTDefs.WeekdayNames[value] - -func split_string_autodetect_rn(value: String) -> Array: - var result = [] - - value = str(value) - - if "\r\n" in value: - # Windows style - result = value.split("\r\n") - elif "\r" in value: - # MacOS style - result = value.split("\r") - else: - # Unix style - result = value.split("\n") - - return result - - -func next_time_at_time(time_value: String) -> int: - var asked_time = split_time(time_value) - - # We calculate epoch time value for the requested hour happening today - # if we are before this time, this is what we want - var ingame_time_as_today = game_time_to_epoch({ - "year": gametime["year"], - "month": gametime["month"], - "day": gametime["day"], - "hour": asked_time[0], - "minute": asked_time[1], - "second": 0 - }) - - if time <= ingame_time_as_today: - return ingame_time_as_today - - # If we are after this time, we want the same time but tomorrow - # so we add 24 hours - else: - return ingame_time_as_today + 24*60*60 # seconds - -func next_time_at_weekday(weekday: int) -> int: - # First we find the weekday delta handling when the requested weekday - # is lower (or equal) than current one - var asked_weekday = weekday if weekday > gametime["weekday"] else weekday + 7 - var weekday_delta = asked_weekday - gametime["weekday"] - - # Find time for midnight of today - var ingame_midnight_today = game_time_to_epoch({ - "year": gametime["year"], - "month": gametime["month"], - "day": gametime["day"], - "hour": 0, - "minute": 0, - "second": 0 - }) - # Finally we just offset the weekday_delta days into the future - return ingame_midnight_today + weekday_delta*24*60*60 # seconds - - -func export_game_data() -> Dictionary: - var visited_options := {} - for item_ui in options_visited_global: - visited_options[item_ui] = "1" if options_visited_global[item_ui] else "0" - - var result = { - "time": time, - "gametime_offset": gametime_offset, - "gametime_year": gametime_year, - "variables": variables, - "visited_options": visited_options, - } - return result - -func import_game_data(data: Dictionary) -> void: - if ("time" in data): - time = int(round(float(data["time"]))) - if ("gametime_offset" in data): - gametime_offset = int(round(float(data["gametime_offset"]))) - if ("gametime_year" in data): - gametime_year = int(round(float(data["gametime_year"]))) - - options_visited_global.clear() - if "visited_options" in data: - var visited_dict: Dictionary = data["visited_options"] - for item_ui in visited_dict: - # If coming from a saved file, item_ui will never be StringName - # but this Dictionary might be coming from a serialized Resource (bad idea, but still) - if (item_ui is String) or (item_ui is StringName): - options_visited_global[item_ui] = (not visited_dict[item_ui] in [false, "false", 0, 0.0, "0", "0.0", "no"]) - - variables.clear() - for variable_name in data["variables"]: - if variable_name is String: - var value = data["variables"][variable_name] - if typeof(value) in [TYPE_INT, TYPE_FLOAT, TYPE_STRING]: - # All numeric values can be safely assumed float (as per JSON) - # since all methods using them do proper casting - variables[variable_name] = value - # Silently ignore everything else diff --git a/addons/madtalk/runtime/MadTalkGlobals.gd.uid b/addons/madtalk/runtime/MadTalkGlobals.gd.uid deleted file mode 100644 index a85fd9d..0000000 --- a/addons/madtalk/runtime/MadTalkGlobals.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://d02cnw1l6owsy diff --git a/addons/madtalk/runtime/MadTalkGlobals.tscn b/addons/madtalk/runtime/MadTalkGlobals.tscn deleted file mode 100644 index 300d1a3..0000000 --- a/addons/madtalk/runtime/MadTalkGlobals.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://domdph40m3s8i"] - -[ext_resource type="Script" uid="uid://d02cnw1l6owsy" path="res://addons/madtalk/runtime/MadTalkGlobals.gd" id="1_tbidr"] - -[node name="MadTalkGlobals" type="Node"] -script = ExtResource("1_tbidr") diff --git a/addons/madtalk/runtime/madtalk_data.tres b/addons/madtalk/runtime/madtalk_data.tres deleted file mode 100644 index cb5a3e1..0000000 --- a/addons/madtalk/runtime/madtalk_data.tres +++ /dev/null @@ -1,46 +0,0 @@ -[gd_resource type="Resource" script_class="DialogData" load_steps=8 format=3 uid="uid://dxkjjrap15vxu"] - -[ext_resource type="Script" uid="uid://bw2q2eucjkylk" path="res://addons/madtalk/components/resources/DialogData.gd" id="1_giduu"] -[ext_resource type="Script" uid="uid://c2bv5lwcvdmrb" path="res://addons/madtalk/components/resources/DialogNodeItemData.gd" id="2_48vp3"] -[ext_resource type="Script" uid="uid://b2mrnotqjr75d" path="res://addons/madtalk/components/resources/DialogNodeData.gd" id="4_f2ijm"] -[ext_resource type="Script" uid="uid://butd1fwy4a2hn" path="res://addons/madtalk/components/resources/DialogSheetData.gd" id="5_vkpn8"] - -[sub_resource type="Resource" id="Resource_vx7w3"] -script = ExtResource("2_48vp3") -item_type = 0 -connected_to_id = -1 -message_speaker_id = "" -message_speaker_variant = "" -message_voice_clip = "" -message_text = "Example this is [input action=down][/input] a down input." -message_voice_clip_locales = {} -message_text_locales = {} -message_hide_on_end = 0 -condition_type = 10 -condition_values = [] -effect_type = 10 -effect_values = [] - -[sub_resource type="Resource" id="Resource_duvjw"] -script = ExtResource("4_f2ijm") -sequence_id = 0 -position = Vector2(0, 0) -comment = "" -items = [SubResource("Resource_vx7w3")] -options = [] -continue_sequence_id = -1 -continue_port_index = 0 - -[sub_resource type="Resource" id="Resource_sxgqo"] -script = ExtResource("5_vkpn8") -sheet_id = "bare_minimum" -sheet_description = "" -next_sequence_id = 2 -nodes = [SubResource("Resource_duvjw")] - -[resource] -script = ExtResource("1_giduu") -version = 1.0 -sheets = { -"bare_minimum": SubResource("Resource_sxgqo") -} diff --git a/addons/madtalk/runtime/madtalk_runtime.gd b/addons/madtalk/runtime/madtalk_runtime.gd deleted file mode 100644 index ea91995..0000000 --- a/addons/madtalk/runtime/madtalk_runtime.gd +++ /dev/null @@ -1,1377 +0,0 @@ -# MadTalk Godot Plugin by Fernando Cosentino -# https://github.com/fbcosentino/godot-madtalk -# -# License: MIT -# (But if you can be so kind as to mention the original in your Readme in case -# you base any work on this, I would be very glad :] ) - -extends Node - - -signal dialog_acknowledged -signal text_display_completed -signal speaker_changed(previous_speaker_id, previous_speaker_variant, new_speaker_id, new_speaker_variant) -signal voice_clip_requested(speaker_id, clip_path) - -signal dialog_started(sheet_name, sequence_id) -signal dialog_finished(sheet_name, sequence_id) - -#warning-ignore:unused_signal -signal evaluate_custom_condition(custom_id, custom_data) -#warning-ignore:unused_signal -signal activate_custom_effect(custom_id, custom_data) - -signal dialog_sequence_processed(sheet_name, sequence_id) -signal dialog_item_processed(sheet_name, sequence_id, item_index) - -signal message_text_shown(speaker_id, speaker_variant, message_text, force_hiding) - -signal menu_option_activated(option_index, option_id) -signal time_updated(datetime_dict) - -# Requests the menu to be processed externally, if dialog_buttons_container is not set -# menu_options is an Array of DialogNodeOptionData -# The signal handler can process it as below: -# func _on_MadTalk_external_menu_requested(menu_options): -# for option in menu_options: -# print(option.text) # Prints the string for this option as written in the sheet -# One of the options can then be selected with: -# $MadTalk.select_menu_option( ) -signal external_menu_requested(menu_options: Array, options_metadata: Array) - -signal dialog_aborted - -# Your scene should have a Control-descendant node with all dialog controls -# inside. The top Control should be overlayed on top of all your visual elements -# so it can capture mouse events first. One way to acomplish this is to -# simply have it at the end of your scene tree child list, with "Full Rect" -# layout and the mouse filter set to "Stop". Your scene root node can be of any -# type (doesn't have to descend from Control). It can even be a Spatial in -# a normal 3D project - -## Array containing the character data, one record per character -## All items in this array must be of type MTCharacterData -@export var ListOfCharacters: Array[MTCharacterData] = [] # (Array, Resource) - -@export_group("Layout Nodes") -## This is the main control overlay used to show all dialog activity under -## MadTalk responsibility. Usually a Control with "Full Rect" layout and mouse -## filter set to "Stop", but other scenarios are possible at your discretion. -@export var DialogMainControl: NodePath -@onready var dialog_maincontrol: Control = get_node_or_null(DialogMainControl) - -## The Control-descendant holding all the objects in the text box -## but not the menu. Menu must be able to become visible when this is hidden -## In most simple cases this can be the label itself (or a Panel holding it) -@export var DialogMessageBox: NodePath -@onready var dialog_messagebox: Control = get_node_or_null(DialogMessageBox) - -## The RichTextLabel used to display dialog messages -@export var DialogMessageLabel: NodePath -@onready var dialog_messagelabel: Control = get_node_or_null(DialogMessageLabel) - -@export_subgroup("Speaker") - -## The Label or RichTextLabel used to display the speaker name -@export var DialogSpeakerLabel: NodePath -@onready var dialog_speakerlabel = get_node_or_null(DialogSpeakerLabel) - -## The TextureRect for showing avatars -@export var DialogSpeakerAvatar: NodePath -@onready var dialog_speakeravatar = get_node_or_null(DialogSpeakerAvatar) - -@export_subgroup("Menu") - -## The Control-descendant holding the entire button menu, including containers, -## decorations, etc. Hiding this should be enough to leave no trace of the -## menu on screen -## Having a menu in the game is entirely optional and you can leave menu-related -## items unassigned if you don't use menus in the dialog system -@export var DialogButtonsMenu: NodePath -@onready var dialog_menu = get_node_or_null(DialogButtonsMenu) - -## The container (usually VBoxContainer) which will hold the button instances -## directly. There must be nothing inside this node, this is the lowest -## hierarchy node in the customization/decoration branch of the scene tree, and -## buttons will be created as direct children of this node -## If this node is not assigned, menus can still be used externally via signals -## If this is not assigned and menu is also not handled externally, menu options -## will not work -@export var DialogButtonsContainer: NodePath -@onready var dialog_buttons_container = get_node_or_null(DialogButtonsContainer) - -@export_subgroup("Menu/Visited Buttons") - -## Color to modulate buttons after the option was already selected during -## this gameplay, but before this particular dialog. See also ModulateWhenVisitedInThisDialog -@export var ModulateWhenVisitedPreviously: Color = Color.WHITE - -## Color to modulate buttons after the option was already selected since this -## particular dialog was started. In that case, ignores ModulateWhenVisitedPreviously, -## so you should set both to the same color if they should not be different -@export var ModulateWhenVisitedInThisDialog: Color = Color.WHITE - -@export_subgroup("Menu/Custom Button for Menu") -## (Optional) The PackedScene file containing a button template used to build the menu. -## You do not need this set to use menus. MadTalk will use the default Button -## class if this field is left blank. -## If assigned, must have a signal without ambiguity for direct connection which is emitted -## only when the option is selected. Signal must have no arguments. -## Many actions sharing a same signal having different values for an argument -## (e.g. InputEvent) is not supported. -@export var DialogButtonSceneFile: PackedScene = null - -## If DialogButtonSceneFile is assigned: name of property used to set the text when instancing the node -## (otherwise, leave as is) -@export var DialogButtonTextProperty: String = "text" - -## If DialogButtonSceneFile is assigned: Signal name emitted when the option is confirmed -## (otherwise, leave as is) -@export var DialogButtonSignalName: String = "pressed" - -## If DialogButtonSceneFile is assigned and this property is not blank: -## name of a bool property set to true if the dialog option this button refers to was -## already selected before during this gameplay (in this dialog or not), set to false otherwise -@export var DialogButtonVisitedProperty: String = "" - -## If DialogButtonSceneFile is assigned and this property is not blank: -## name of a bool property set to true if the dialog option this button refers to was -## already selected before since this particular dialog started, set to false otherwise -@export var DialogButtonVisitedInThisDialogProperty: String = "" - -@export_subgroup("") - -@export_group("Animations") - -@export_subgroup("Custom Fade-in Fade-out Animations") - -## AnimationPlayer object used for fade-in and fade-out transition animations -## if not given, animations will simply be disabled and only show() and hide() -## will be used instead -@export var DialogAnimationPlayer: NodePath -@onready var dialog_anims = get_node_or_null(DialogAnimationPlayer) - -# Below are animation names taken from the AnimationPlayer specified above. -# Make sure the fade out animations have valid information in the last frame -# If a track ends before the last frame, duplicate the last keyframe at (or -# after) the last frame. Applying the updates of only the last frame must be -# enough to reset the tracks to their faded-out states - - - -## (If DialogAnimationPlayer is assigned:) -## Animation for dialog fade in - displays the DialogMainControl node entirely -@export var TransitionAnimationName_DialogFadeIn: String = "" -## (If DialogAnimationPlayer is assigned:) -## Animation for dialog fade out - hides the DialogMainControl node entirely -@export var TransitionAnimationName_DialogFadeOut: String = "" -## (If DialogAnimationPlayer is assigned:) -## Animation for message box fade in - displays the DialogMessageBox node -@export var TransitionAnimationName_MessageBoxFadeIn: String = "" -## (If DialogAnimationPlayer is assigned:) -## Animation for message box fade out - hides the DialogMessageBox node -@export var TransitionAnimationName_MessageBoxFadeOut: String = "" -## (If DialogAnimationPlayer is assigned:) -## Animation for menu fade in - displays the DialogButtonsMenu node entirely -@export var TransitionAnimationName_MenuFadeIn: String = "" -## (If DialogAnimationPlayer is assigned:) -## Animation for menu fade out - hides the DialogButtonsMenu node entirely -@export var TransitionAnimationName_MenuFadeOut: String = "" -## (If DialogAnimationPlayer is assigned:) -## Animation for message showing up - e.g. characters gradually being typed -@export var TransitionAnimationName_TextShow: String = "" -## (If DialogAnimationPlayer is assigned:) -## Animation for message disappearing -@export var TransitionAnimationName_TextHide: String = "" - -@export_subgroup("Progressive Text") - - -## Automatically animate text tweening the Label's percent_visible property -@export var AnimateText: bool = true -@export var AnimatedTextMilisecondPerCharacter: float = 50.0 - -## The AudioStreamPlayer containing the sound effect to play when text is being -## shown (example, clicks, key press, beep, etc). If the sound should play -## repeatedly until text is complete (most common case), set the audio stream -## to loop in its import options, otherwise it will play only once. -@export var KeyPressAudioStreamPlayer: NodePath -@onready var sfx_key_press = get_node_or_null(KeyPressAudioStreamPlayer) - -@export_subgroup("Animations Called From Effects") - - -## AnimationPlayer used to play effect animations, when using the effect "Play Animation and Wait" -@export var EffectsAnimationPlayer: NodePath -@onready var effects_anims = get_node_or_null(EffectsAnimationPlayer) - -@export_subgroup("") - -@export_group("Advanced/Message Formatting") - -## Text to be inserted before every message (of every speaker). This will be inserted -## BEFORE any formatting, so you can use all available syntax in it, including BBCode -## and variable parsing, -## e.g.: [b][lb]b[rb][lb]color=yellow[rb]$npc[lb]/color[rb][lb]/b[rb]: [/b] -@export var TextPrefixForAllMessages := "" - -## Text to be appended after every message (of every speaker). Similarly to -## Text Prefix For All Messages, this is appended BEFORE formatting, so all syntax -## is available. If you have BBCode tags left open in the prefix, you should close -## them here. -@export var TextSuffixForAllMessages := "" - -@export_group("Options") - - -## When a sequence ends in a message item, and the sequence has options for a -## menu, after showing the message the user has to interact acknowledging the -## message before the menu is shown. Enabling this option will automatically -## show the menu with the last message. -@export var AutoShowMenuOnLastMessage := false - -@export_subgroup("In-Game Date-Time") - -## (Only relevant if you're using MadTalk to handle in-game date and time.) -## Year base is used to offset the calendar, datetime objects are referenced -## to year 0001, and developer can shift that to any year of convenience to -## match dates to weekdays and leap years. Check docs on github to understand -## how to use this. Default works fine. -@export var YearOfReference: int = 1970 - -@export_subgroup("Debug") - -@export var EnableDebugOutput: bool = false - -@export_subgroup("") -@export_group("") - -# ============================================================================== - - - -class DialogCursor: - var sheet_name : String = "" - var sequence_id : int = 0 - var item_index : int = 0 - - func _init(sheetname, sequenceid, _itemindex): - sheet_name = sheetname - sequence_id = sequenceid - - - - - -# Dialog data - you can customize this if you want, but leaving the default -# should work just fine -var dialog_data = preload("res://addons/madtalk/runtime/madtalk_data.tres") - - -# For each sheet, the array index for each sequence ID is searched only once -# and the map is cached to avoid unnecessary lookup loops -# This variable holds the map -# Structure is: -# sheet_sequence_to_index = { -# "sheet_name": { -# : , -# ... -# }, -# ... -# } -var sheet_sequence_to_index = {} - -# Dictionary mapping character ID to MTCharacterData -var character_data = {} - -# If for some reason a dialog is fired when another one is still going on, the -# new one is added to the queue. Whenever a dialog ends, the queue is checked -# and fired if required -# Structure is: -# dialog_queue = [] -var dialog_queue = [] - -# Flags tracking the state of dialog Control nodes -# we don't rely on properties (like `visible`) since the user might have a -# different logic to display or hide messages (including resizing UI or -# always-visible elements) -var dialog_maincontrol_active = false -var dialog_messagebox_active = false -var dialog_messagelabel_active = false -var dialog_menu_active = false -var dialog_on_text_progress = false -var last_speaker_id = "" # used to identify if speaker_id has just changed -var last_speaker_variant = "" -var last_message_item = null -var last_message_text = "" - -# Stores Tween node for text animation if used -var animated_text_tween = null - -# Holds the target callable to be called when -# evaluating custom conditions -var custom_condition_callable = null - -# Holds the target callable to be called when -# activating custom effects -var custom_effect_callable = null - -# Flags set when a request to abort or skip the dialog are issued -# The difference between them is: when a dialog is skipped, messages are not -# shown anymore, but all the dialog tree is still traversed, all conditions are -# checked, animations are played and effects take place. Aborting stops where it -# is. This is important since game logic can be critically based on those -# effects. E.g. if an effect in the end of a conversation spawns a boss, -# skipping the dialog still spanws the boss, while aborting doesn't. -# Both flags are always cleared when starting a dialog. -var is_abort_requested = false -var is_skip_requested = false - - -# Array mapping menu indices to the dialog IDs they connect to -# Mostly used when using external menus -var menu_connected_ids = [] - -# RandomNumberGenerator used for, well, random numbers -# Global is not used to avoid restricting from other uses -var rng = RandomNumberGenerator.new() - -var msgparser = MessageCodeParser.new() - -func debug_print(text: String) -> void: - if EnableDebugOutput: - print("MADTALK: "+text) - -func bool_as_int(value): - return 0 if (value == 0) else 1 - - -func _ready(): - var condition_connection_array = get_signal_connection_list("evaluate_custom_condition") - if condition_connection_array.size() > 0: - custom_condition_callable = condition_connection_array[0]["callable"] - - var effect_connection_array = get_signal_connection_list("activate_custom_effect") - if effect_connection_array.size() > 0: - custom_effect_callable = effect_connection_array[0]["callable"] - - MadTalkGlobals.set_game_year(YearOfReference) - - rng.randomize() - - if (dialog_anims): - # Sanitizes the animation names ensuring we only have valid animations - - if not dialog_anims is AnimationPlayer: - dialog_anims = null - - else: - if not dialog_anims.has_animation(TransitionAnimationName_DialogFadeIn): - TransitionAnimationName_DialogFadeIn = "" - if not dialog_anims.has_animation(TransitionAnimationName_DialogFadeOut): - TransitionAnimationName_DialogFadeOut = "" - if not dialog_anims.has_animation(TransitionAnimationName_MenuFadeIn): - TransitionAnimationName_MenuFadeIn = "" - if not dialog_anims.has_animation(TransitionAnimationName_MenuFadeOut): - TransitionAnimationName_MenuFadeOut = "" - if not dialog_anims.has_animation(TransitionAnimationName_TextShow): - TransitionAnimationName_TextShow = "" - if not dialog_anims.has_animation(TransitionAnimationName_TextHide): - TransitionAnimationName_TextHide = "" - - dialog_anims.connect("animation_finished", Callable(self, "_on_animation_finished")) - - # Move animations to their respective faded-out states - # or hide dialog main control and menu - if TransitionAnimationName_DialogFadeOut != "": - dialog_anims.play(TransitionAnimationName_DialogFadeOut, -1, 1.0, true) - dialog_anims.advance(0) - else: - dialog_maincontrol.hide() - - if TransitionAnimationName_MenuFadeOut != "": - dialog_anims.play(TransitionAnimationName_MenuFadeOut, -1, 1.0, true) - dialog_anims.advance(0) - else: - if dialog_menu: - dialog_menu.hide() - - if TransitionAnimationName_TextHide != "": - dialog_anims.play(TransitionAnimationName_TextHide, -1, 1.0, true) - dialog_anims.advance(0) - - for char_data_item in ListOfCharacters: - character_data[char_data_item.id] = char_data_item - - if (not dialog_data) or (not dialog_data is DialogData): - # Unfortunately we have an invalid database, discard and make a new one - dialog_data = DialogData.new() - debug_print("Dialog data invalid, using a blank one instead") - - #if AnimateText: - # animated_text_tween = get_tree().create_tween() - # #add_child(animated_text_tween) - # - # animated_text_tween.owner = self - # animated_text_tween.connect("tween_all_completed", Callable(self, "_on_animated_text_tween_completed")) - - if dialog_messagelabel: - dialog_messagelabel.percent_visible = 0 - - MadTalkGlobals.is_during_dialog = false - await get_tree().process_frame - emit_signal("time_updated", MadTalkGlobals.gametime) - - -func _prepare_sheet_sequence_map(sheet_name, sequence_id) -> int: - # Check if we need to lookup and add this sheet/sequence to map - # Happens the first time it is accessed - if not sheet_name in sheet_sequence_to_index: - sheet_sequence_to_index[sheet_name] = {} - if not sequence_id in sheet_sequence_to_index[sheet_name]: - var found = false - for i in range(dialog_data.sheets[sheet_name].nodes.size()): - if dialog_data.sheets[sheet_name].nodes[i].sequence_id == sequence_id: - sheet_sequence_to_index[sheet_name][sequence_id] = i - found = true - break - if not found: - return FAILED - - return OK - - - -func _retrieve_sequence_data(sheet_name: String = "", sequence_id: int = 0) -> Resource: - if not sheet_name in dialog_data.sheets: - debug_print("Requested sheet \"%s\" which doesn't exist" % sheet_name) - return null - var sheet_data = dialog_data.sheets[sheet_name] - - if (not sheet_name in sheet_sequence_to_index) or (not sequence_id in sheet_sequence_to_index[sheet_name]): - debug_print("Sequence ID %s not mapped in sheet \"%s\" when it should" % [sequence_id, sheet_name]) - return null - var sequence_index = sheet_sequence_to_index[sheet_name][sequence_id] - - if sequence_index >= sheet_data.nodes.size(): - debug_print("Sequence index %s out of node range in sheet \"%s\" when it should" % [sequence_index, sheet_name]) - return null - return sheet_data.nodes[sequence_index] - -func _retrieve_item_data(sequence_data, item_index: int = 0) -> Resource: - if not sequence_data: - return null - - if item_index >= sequence_data.items.size(): - return null - return sequence_data.items[item_index] - - - -func _anim_dialog_main_visible(show: bool = true) -> void: - if show: - # Show main dialog interface if not yet visible - if not dialog_maincontrol_active: - dialog_maincontrol_active = true - if TransitionAnimationName_DialogFadeIn != "": - dialog_anims.play(TransitionAnimationName_DialogFadeIn) - await dialog_anims.animation_finished - else: - if dialog_maincontrol: - dialog_maincontrol.show() - - - - else: - # Hide dialog box - if dialog_maincontrol_active: - if TransitionAnimationName_DialogFadeOut != "": - dialog_anims.play(TransitionAnimationName_DialogFadeOut) - await dialog_anims.animation_finished - else: - if dialog_maincontrol: - dialog_maincontrol.hide() - - dialog_maincontrol_active = false - - -func _anim_dialog_messagebox_visible(show: bool = true) -> void: - - if show: - # Show message box - if not dialog_messagebox_active: - dialog_messagebox_active = true - if TransitionAnimationName_MessageBoxFadeIn != "": - dialog_anims.play(TransitionAnimationName_MessageBoxFadeIn) - await dialog_anims.animation_finished - else: - if dialog_messagebox: - dialog_messagebox.show() - - - else: - # Hide message box - if dialog_messagebox_active: - if TransitionAnimationName_MessageBoxFadeOut != "": - dialog_anims.play(TransitionAnimationName_MessageBoxFadeOut) - await dialog_anims.animation_finished - else: - if dialog_messagebox: - dialog_messagebox.hide() - - dialog_messagebox_active = false - - - -func _anim_dialog_text_visible(show: bool = true, percent_visible_range: Array= [0.0, 1.0], skip_animation: bool = false) -> void: - if show: - # Display animation always plays even if text is already visible - dialog_messagelabel_active = true - if AnimateText: - if TransitionAnimationName_TextShow != "": - dialog_anims.play(TransitionAnimationName_TextShow) - # If AnimateText is used, AnimationPlayer is not expected to - # handle text progression, so we wait the normal way - await dialog_anims.animation_finished - - if not skip_animation: - - if dialog_messagelabel: - dialog_on_text_progress = true - dialog_messagelabel.visible_ratio = percent_visible_range[0] - # Tween text progression - if animated_text_tween: - animated_text_tween.kill() - animated_text_tween = create_tween() - animated_text_tween.tween_property(dialog_messagelabel, "visible_ratio", percent_visible_range[1], - AnimatedTextMilisecondPerCharacter * dialog_messagelabel.text.length() * 0.001 - ).set_trans(Tween.TRANS_LINEAR) - animated_text_tween.tween_callback(_on_animated_text_tween_completed) - - if sfx_key_press: - sfx_key_press.play() - await self.text_display_completed # both user interaction or animation_finished are routed here - if sfx_key_press: - sfx_key_press.stop() - dialog_on_text_progress = false - - else: - if dialog_messagelabel: - dialog_messagelabel.percent_visible = 1.0 - - - else: - if TransitionAnimationName_TextShow != "": - if not skip_animation: - dialog_on_text_progress = true - dialog_anims.play(TransitionAnimationName_TextShow) - await self.text_display_completed # both user interaction or animation_finished are routed here - dialog_on_text_progress = false - else: - dialog_anims.assigned_animation = TransitionAnimationName_TextShow - dialog_anims.seek(0) - dialog_anims.advance(dialog_anims.current_animation_length) - - - else: - if dialog_messagelabel_active: - if TransitionAnimationName_TextHide != "": - dialog_anims.play(TransitionAnimationName_TextHide) - await dialog_anims.animation_finished - dialog_messagelabel.visible_ratio = 0 - await get_tree().process_frame - dialog_messagelabel_active = false - - -func _anim_dialog_menu_visible(show: bool = true) -> void: - if show: - # Menu is always regenerated when shown - # So animation is also always played - dialog_menu_active = true - if TransitionAnimationName_MenuFadeIn != "": - dialog_anims.play(TransitionAnimationName_MenuFadeIn) - await dialog_anims.animation_finished - else: - if dialog_menu: - dialog_menu.show() - - else: - if dialog_menu_active: - if TransitionAnimationName_MenuFadeOut != "": - dialog_anims.play(TransitionAnimationName_MenuFadeOut) - await dialog_anims.animation_finished - else: - if dialog_menu: - dialog_menu.hide() - - dialog_menu_active = false - - -func _assemble_button(index: int, id: int, text: String, parent_node: Node, option_metadata: Dictionary) -> Node: - # Invalid metadata defaults to enabled button - var is_btn_enabled: bool = (option_metadata["enabled"] != false) if ("enabled" in option_metadata) else true - var is_btn_visited: bool = ("visited" in option_metadata) and (option_metadata["visited"]) - var is_btn_visited_dialog: bool = ("visited_dialog" in option_metadata) and (option_metadata["visited_dialog"]) - - var is_custom_button = true if DialogButtonSceneFile else false # DialogButtonSceneFile is not boolean, is_custom_button is - - var new_btn = DialogButtonSceneFile.instantiate() if DialogButtonSceneFile else Button.new() - - parent_node.add_child(new_btn) - new_btn.set(DialogButtonTextProperty, text) - - if is_custom_button: - if DialogButtonVisitedProperty != "": - new_btn.set(DialogButtonVisitedProperty, is_btn_visited) - if DialogButtonVisitedInThisDialogProperty != "": - new_btn.set(DialogButtonVisitedInThisDialogProperty, is_btn_visited_dialog) - - if is_btn_visited_dialog: - new_btn.modulate *= ModulateWhenVisitedInThisDialog - elif is_btn_visited: - new_btn.modulate *= ModulateWhenVisitedPreviously - - new_btn.disabled = not is_btn_enabled - - # _on_menu_button_pressed() is used to multiplex all button signals into one - new_btn.connect(DialogButtonSignalName, _on_menu_button_pressed.bind(index, id)) - - return new_btn - - -func _assemble_menu(options: Array, options_metadata: Array) -> int: - # options = [] - # Fields: - # DialogNodeOptionData.text : String = "" - # DialogNodeOptionData.text_locales : Dictionary (locale String: text String) - # read via get_localized_text() - # DialogNodeOptionData.connected_to_id : int = -1 - # - # options_metadata = [] - # Fields: - # "enabled" : bool = true -> if this option can be selected - # "visited : bool -> if this option was already selected before during this gameplay - # "visited_dialog : -> if this option was already selected since starting this dialog - # - # options[index] and options_metadata[index] share the same index - - if not dialog_buttons_container: - debug_print("Menu button container not set") - return 0 - - # Remove any previous buttons - var old_buttons = dialog_buttons_container.get_children() - for btn in old_buttons: - dialog_buttons_container.remove_child(btn) - btn.queue_free() - - # Add new buttons - var count = 0 - menu_connected_ids.clear() - #for option_item in options: - for i: int in range(options.size()): - var option_item: DialogNodeOptionData = options[i] - var item_text = option_item.get_localized_text() # option_item.text - menu_connected_ids.append(item_text) - var _new_btn = _assemble_button(i, option_item.connected_to_id, item_text, dialog_buttons_container, options_metadata[i]) - count += 1 - - return count - - -func _check_option_condition(var_name: String, operator: String, given_value: String) -> bool: - var result = false - var var_value = MadTalkGlobals.get_variable(var_name, 0) - - var value = given_value.to_float() if given_value.is_valid_float() else MadTalkGlobals.get_variable(given_value, 0) - - match operator: - "=": - result = (var_value == value) - "!=": - result = (var_value != value) - ">": - result = (var_value > value) - ">=": - result = (var_value >= value) - "<": - result = (var_value < value) - "<=": - result = (var_value <= value) - _: - result = false - - return result - - -func set_variable(variable_name: String, value) -> void: - MadTalkGlobals.set_variable(variable_name, value) - - -func get_variable(variable_name: String): - return MadTalkGlobals.get_variable(variable_name) - - -func start_dialog(sheet_name: String, sequence_id : int = 0) -> void: - if MadTalkGlobals.is_during_dialog: - dialog_queue.append( DialogCursor.new(sheet_name, sequence_id, 0) ) - return - - # Start processing dialog. This flag will cause any other calls to be queued - # Other in-game effects might also read this flag (such as pausing enemies) - MadTalkGlobals.is_during_dialog = true - # `yield` statements from now on are safe, even nested into method calls - # ----------------------------------------------------- - - is_abort_requested = false - is_skip_requested = false - - MadTalkGlobals.reset_options_visited_dialog() - - emit_signal("dialog_started", sheet_name, sequence_id) - - # The "dialog_started" signal can be used to prevent some dialogs by - # skipping or aborting dialogs before they start - # This is useful when player repeats a level from a checkpoint, you still - # need the effects, but not the text, so skip still calls the method below - if (not is_abort_requested): - await run_dialog_sequence(sheet_name, sequence_id) - - MadTalkGlobals.is_during_cinematic = true - - # Hide menu if needed - if dialog_menu_active: - await _anim_dialog_menu_visible(false) - - # Hide text if needed - if dialog_messagelabel_active: - await _anim_dialog_text_visible(false) - - # hide message box if needed - if dialog_messagebox_active: - await _anim_dialog_messagebox_visible(false) - - # Hide dialog if needed - if dialog_maincontrol_active: - await _anim_dialog_main_visible(false) - - MadTalkGlobals.is_during_cinematic = false - - - # ----------------------------------------------------- - # Stop processing dialog. Next calls will run immediately. - # There must be no `yield` statements from now on to the end of the method - MadTalkGlobals.is_during_dialog = false - - # If something is queued, process it before anything else calls this again - if dialog_queue.size() > 0: - var dialog_cursor = dialog_queue.pop_front() - if dialog_cursor: - start_dialog(dialog_cursor.sheet_name, dialog_cursor.sequence_id) - - -func run_dialog_sequence(sheet_name: String, sequence_id : int = 0) -> void: - # Asking to run an invalid dialog fails silently - if not sheet_name in dialog_data.sheets: - await get_tree().process_frame - debug_print("Sheet \"%s\" not found" % sheet_name) - return - - # Make sure we have the node mapped - if _prepare_sheet_sequence_map(sheet_name, sequence_id) == FAILED: - await get_tree().process_frame - debug_print("Mapping sheet \"%s\", sequence %s failed" % [sheet_name, str(sequence_id)]) - return - - await run_dialog_item(sheet_name, sequence_id) - - emit_signal("dialog_sequence_processed", sheet_name, sequence_id) - - - -func run_dialog_item(sheet_name: String = "", sequence_id: int = 0, item_index: int = 0) -> void: - - var sequence_data : DialogNodeData = _retrieve_sequence_data(sheet_name, sequence_id) - var dialog_item : DialogNodeItemData = _retrieve_item_data(sequence_data, item_index) - var should_run_next_item := true - - var is_last_item: bool = (item_index >= (sequence_data.items.size()-1)) - var should_auto_progress_message: bool = (is_last_item and AutoShowMenuOnLastMessage and (sequence_data.options.size() > 0)) - - if is_abort_requested: - emit_signal("dialog_aborted") - - elif sequence_data: # Sanity check - - if dialog_item: - # We still have an item to process inside this sequence - - match dialog_item.item_type: - DialogNodeItemData.ItemTypes.Message: - # dialog_item.message_speaker_id : String - # dialog_item.message_text : String - # message_text can use locale, so it is retrieved via - # dialog_item.get_localized_text() - - # We show the message here, but we don't hide, since the - # player might want to re-read the last message when a set - # of options is presented in the end of the sequence - - # Skipping a dialog before a message is shown prevents the - # messages from showing up. But if this sequence has a menu - # we have to show the last message, so we still assing all - # the values, we just don't play the show animations or - # wait for confirmation - - MadTalkGlobals.is_during_cinematic = true - - # If text still on screen, hide text - await _anim_dialog_text_visible(false) - - # if speaker has changed, we hide dialog to show again - if (dialog_item.message_speaker_id != last_speaker_id) or (dialog_item.message_speaker_variant != last_speaker_variant): - await _anim_dialog_messagebox_visible(false) - emit_signal("speaker_changed", last_speaker_id, last_speaker_variant, dialog_item.message_speaker_id, dialog_item.message_speaker_variant) - - MadTalkGlobals.is_during_cinematic = false - - # Modify values - var speaker_name = character_data[dialog_item.message_speaker_id].name \ - if (dialog_item.message_speaker_id in character_data) \ - else dialog_item.message_speaker_id - - if dialog_speakerlabel: - dialog_speakerlabel.text = speaker_name - - var dialog_message_data = msgparser.process( - TextPrefixForAllMessages + dialog_item.get_localized_text() + TextSuffixForAllMessages, - MadTalkGlobals.variables - ) - var dialog_message_text = dialog_message_data[0] - var dialog_message_anim_pause_percentages = dialog_message_data[1] - - dialog_message_text = dialog_message_text.replace("$time", MadTalkGlobals.gametime["time"]) - dialog_message_text = dialog_message_text.replace("$date_inv", MadTalkGlobals.gametime["date_inv"]) - dialog_message_text = dialog_message_text.replace("$date", MadTalkGlobals.gametime["date"]) - dialog_message_text = dialog_message_text.replace("$weekday", MTDefs.WeekdayNames[MadTalkGlobals.gametime["weekday"]] ) - dialog_message_text = dialog_message_text.replace("$wday", MTDefs.WeekdayNamesShort[MadTalkGlobals.gametime["weekday"]] ) - - # Should be last replacement, to avoid things in speaker nane to be mistaken for formatting - dialog_message_text = dialog_message_text.replace("$speaker_id", dialog_item.message_speaker_id ) - dialog_message_text = dialog_message_text.replace("$speaker_name", speaker_name ) - - if dialog_messagelabel: - dialog_messagelabel.text = dialog_message_text - - if dialog_speakeravatar: - if (dialog_item.message_speaker_id in character_data): - # are we using a valid variant? - var char_variants = character_data[dialog_item.message_speaker_id].variants - if (dialog_item.message_speaker_variant != "") and (dialog_item.message_speaker_variant in char_variants) \ - and (char_variants[dialog_item.message_speaker_variant] is Texture2D): - dialog_speakeravatar.texture = char_variants[dialog_item.message_speaker_variant] - # Otherwise use default avatar - else: - dialog_speakeravatar.texture = character_data[dialog_item.message_speaker_id].avatar - else: - dialog_speakeravatar.texture = null - - - if not is_skip_requested: - - MadTalkGlobals.is_during_cinematic = true - - emit_signal("message_text_shown", - dialog_item.message_speaker_id, - dialog_item.message_speaker_variant, - dialog_message_text, - dialog_item.message_hide_on_end - ) - - # Show main dialog interface if not yet visible - await _anim_dialog_main_visible(true) - - # Show message box if not visible yet - await _anim_dialog_messagebox_visible(true) - - # Request voice clip to be played - # Signal is emitted even when clip path is blank, so the - # previous audio can be stopped if this is desired - emit_signal("voice_clip_requested", dialog_item.message_speaker_id, dialog_item.get_localized_voice_clip()) - - MadTalkGlobals.is_during_cinematic = false - - var previous_percent_visible = 0.0 - - # If there are no pauses, we will have - # dialog_message_anim_pause_percentages = [1.0] - - # If skip was requested after we enter this match case, - # we just don't wait for user confirmation to dismiss - - for percent_visible in dialog_message_anim_pause_percentages: - # If skip was requested between pauses, process here - if is_skip_requested or is_abort_requested: - break - - # Show text - await _anim_dialog_text_visible(true, - [previous_percent_visible, percent_visible] - ) # Handles animation skip internally - - if dialog_messagelabel: - dialog_messagelabel.visible_ratio = percent_visible - previous_percent_visible = percent_visible - - # Confirmation to dismiss the message - if (not is_skip_requested) and (not is_abort_requested) and (not should_auto_progress_message): - await self.dialog_acknowledged - - - if (dialog_item.message_hide_on_end != 0) or is_skip_requested: - # We hide this message box as explicitly requested - MadTalkGlobals.is_during_cinematic = true - await _anim_dialog_text_visible(false) - await _anim_dialog_messagebox_visible(false) - MadTalkGlobals.is_during_cinematic = false - - # Else: we do not hide the message straight away as next step - # could be showing options. We hide when we leave the sequence - last_speaker_id = dialog_item.message_speaker_id - last_speaker_variant = dialog_item.message_speaker_variant - last_message_item = dialog_item - last_message_text = dialog_message_text - - - - DialogNodeItemData.ItemTypes.Condition: - # dialog_item.condition_type : MTDefs.ConditionTypes - # dialog_item.condition_values : Array - # dialog_item.connected_to_id : int = -1 - - # Test the condition - var result = await evaluate_condition(dialog_item.condition_type, dialog_item.condition_values) - - if not result: - # Condition failed, we have to branch out of this sequence - should_run_next_item = false - - # If something is connected, we jump - # If nothing is connected, this simply means aboting - if dialog_item.connected_to_id > -1: - await run_dialog_sequence(sheet_name, dialog_item.connected_to_id) - - - - DialogNodeItemData.ItemTypes.Effect: - # dialog_item.effect_type : MTDefs.EffectTypes - # dialog_item.effect_values : Array - - # "Change sheet" effect is an exception and is implemented - # directly in this block since it is scope-dependant - if dialog_item.effect_type == MTDefs.EffectTypes.ChangeSheet: - var new_sheet_name = dialog_item.effect_values[0] - var new_sequence_id = dialog_item.effect_values[1] - - # Jump to sheet if valid, aborting dialog otherwise - should_run_next_item = false - if new_sheet_name in dialog_data.sheets: - await run_dialog_sequence(new_sheet_name, new_sequence_id) - - # Animation and custom effects are also exception since - # involves pausing the sequence until it finishes - elif dialog_item.effect_type == MTDefs.EffectTypes.WaitAnim: - var anim_name = dialog_item.effect_values[0] - # Animation must exist and not be loop - if effects_anims and (effects_anims.has_animation(anim_name)) and ( - not effects_anims.get_animation(anim_name).loop - ): - effects_anims.play(anim_name) - MadTalkGlobals.is_during_cinematic = true - await effects_anims.animation_finished - MadTalkGlobals.is_during_cinematic = false - - elif dialog_item.effect_type == MTDefs.EffectTypes.Custom: - if custom_effect_callable: - var custom_id = dialog_item.effect_values[0] - var custom_data_array = MadTalkGlobals.split_string_autodetect_rn(dialog_item.effect_values[1]) - - #emit_signal("activate_custom_effect", custom_id, custom_data_array) - await custom_effect_callable.call(custom_id, custom_data_array) - - else: - # All other effects have global scope and are - # implemented in a separate method - activate_effect(dialog_item.effect_type, dialog_item.effect_values) - - _: - debug_print("Invalid item type for item %s in sequence ID %s at sheet \"%s\"" % [item_index, sequence_id, sheet_name]) - - - emit_signal("dialog_item_processed", sheet_name, sequence_id, item_index) - - # We don't check if item_index is the last one, since the first - # invalid index will be properly handled in following call - # causing the sequence to be gracefully concluded (see below) - if should_run_next_item: - await run_dialog_item(sheet_name, sequence_id, item_index + 1) - - - else: # All items processed - - # Running an item_index higher than last valid one means we - # finished the item list and have to process the end of sequence - # This means showing options or routing to the "continue" ID - - # We process menu options even if dialog_buttons_container is not - # assigned, as the menu might be handled externally via signals - - # Even if we have options, some of them can be conditional, and - # it might be the case all of them are and no item is left to - # be shown at the menu. So we have to buffer a list - var options_to_show := [] - var options_metadata := [] - menu_connected_ids.clear() - - for option_item: DialogNodeOptionData in sequence_data.options: - var conditions_passed := true - if option_item.is_conditional: - # Case 1: is auto-disable and already visited - match option_item.autodisable_mode: - option_item.AutodisableModes.RESET_ON_SHEET_RUN: - if (MadTalkGlobals.get_option_visited_dialog(option_item)): - conditions_passed = false - - option_item.AutodisableModes.ALWAYS: - if (MadTalkGlobals.get_option_visited_global(option_item)): - conditions_passed = false - - # Case 2: variable conditions - if conditions_passed: - conditions_passed = _check_option_condition( - option_item.condition_variable, - option_item.condition_operator, - option_item.condition_value - ) - - # We show button if it's active OR it should be shown anyway but as disabled - if (conditions_passed) or (option_item.inactive_mode == option_item.InactiveMode.DISABLED): - options_to_show.append(option_item) - menu_connected_ids.append(option_item.connected_to_id) - options_metadata.append({ - "enabled": conditions_passed, - "visited": MadTalkGlobals.get_option_visited_global(option_item), - "visited_dialog": MadTalkGlobals.get_option_visited_dialog(option_item) - }) - - # Now options_to_show contains options to show (disabled or not) - # of which the ones in options_disabled should be disabled - - # Process options and build menu only with remaining items - if options_to_show.size() > 0: - # When there are menu options, "continue" is not used - - # If we skipped dialog, there are no visible messages. We show - # last one back - if is_skip_requested and (last_message_item.message_hide_on_end == 0): - - MadTalkGlobals.is_during_cinematic = true - - emit_signal("message_text_shown", - last_message_item.message_speaker_id, - last_message_item.message_speaker_variant, - last_message_text, - last_message_item.message_hide_on_end - ) - - # Show main dialog interface if not yet visible - await _anim_dialog_main_visible(true) - - # Show message box if not visible yet - await _anim_dialog_messagebox_visible(true) - - # We do not play voice - - MadTalkGlobals.is_during_cinematic = false - - # Show text - await _anim_dialog_text_visible(true, [0, 1], true) # skips to end - - - MadTalkGlobals.is_during_cinematic = true - - # Internal menu logic (via dialog_buttons_container) - if dialog_buttons_container: - # Make sure menu is not visible - if dialog_menu_active: - await _anim_dialog_menu_visible(false) - # Regenerate buttons - var __= _assemble_menu(options_to_show, options_metadata) - # Show menu - await _anim_dialog_menu_visible(true) - - else: - external_menu_requested.emit(options_to_show, options_metadata) - - MadTalkGlobals.is_during_cinematic = false - - if dialog_buttons_container: - # There is always at least one optiong there otherwise we - # would not be into this `if` - dialog_buttons_container.get_child(0).grab_focus() - - # Wait for an option - # Selecting an option is mandatory and dialog halts until then - - var option_res = await self.menu_option_activated - var option_index = option_res[0] - var option_id = option_res[1] - - # Hide menu - if dialog_buttons_container: - MadTalkGlobals.is_during_cinematic = true - await _anim_dialog_menu_visible(false) - MadTalkGlobals.is_during_cinematic = false - - if option_id > -1: - var selected_option: DialogNodeOptionData = options_to_show[option_index] - MadTalkGlobals.set_option_visited(selected_option, true) - - # jumping to another sequence might also be same speaker - # so we don't hide anything yet - await run_dialog_sequence(sheet_name, option_id) - else: - last_speaker_id = "" - last_speaker_variant = "" - emit_signal("dialog_finished", sheet_name, sequence_id) - - - elif sequence_data.continue_sequence_id > -1: - # "continue" ID might also be same speaker so we don't hide anything yet - await run_dialog_sequence(sheet_name, sequence_data.continue_sequence_id) - - else: - last_speaker_id = "" - last_speaker_variant = "" - emit_signal("dialog_finished", sheet_name, sequence_id) - - else: - debug_print("Invalid sequence \"%s\" in sheet \"%s\"" % [sequence_id, sheet_name]) - - - - -func evaluate_condition(condition_type, condition_values): - # Returns true if condition is met, false otherwise - # May or may not morph into coroutine, caller must check with: - # if result is GDScriptFunctionState: - # result = yield(result, "completed") - - match condition_type: - MTDefs.ConditionTypes.Random: - var random_value = rng.randf_range(0.0, 100.0) - return (random_value < condition_values[0]) - - MTDefs.ConditionTypes.VarBool: - var var_value = bool_as_int(MadTalkGlobals.get_variable(condition_values[0], 0)) - var expected_value = bool_as_int(condition_values[1]) - return (var_value == expected_value) - - MTDefs.ConditionTypes.VarAtLeast: - var var_value = float(MadTalkGlobals.get_variable(condition_values[0], 0.0)) - return (var_value >= float(condition_values[1])) - - MTDefs.ConditionTypes.VarUnder: - var var_value = float(MadTalkGlobals.get_variable(condition_values[0], 0.0)) - return (var_value < float(condition_values[1])) - - MTDefs.ConditionTypes.VarString: - var var_value = str(MadTalkGlobals.get_variable(condition_values[0], "")) - return (var_value == str(condition_values[1])) - - MTDefs.ConditionTypes.Time: - var min_time = MadTalkGlobals.split_time(condition_values[0]) - var target_min_time_float = MadTalkGlobals.time_to_float(min_time[0], min_time[1]) - - var max_time = MadTalkGlobals.split_time(condition_values[1]) - var target_max_time_float = MadTalkGlobals.time_to_float(max_time[0], max_time[1]) - - var curr_time_float = MadTalkGlobals.time_to_float( - MadTalkGlobals.gametime["hour"], - MadTalkGlobals.gametime["minute"] - ) - - # Normal range - e.g. 6:00-18:00 - if target_min_time_float < target_max_time_float: - return (curr_time_float >= target_min_time_float) and (curr_time_float <= target_max_time_float) - # Inverted range - e.g. 18:00-6:00 - else: - return (curr_time_float >= target_min_time_float) or (curr_time_float <= target_max_time_float) - - MTDefs.ConditionTypes.DayOfWeek: - var target_min_day = condition_values[0] - var target_max_day = condition_values[1] - var curr_day = MadTalkGlobals.gametime["weekday"] - - # Normal range - e.g. Mon-Fri - if target_min_day < target_max_day: - return (curr_day >= target_min_day) and (curr_day <= target_max_day) - # Inverted range - e.g. Sat-Sun - else: - return (curr_day >= target_min_day) or (curr_day <= target_max_day) - - MTDefs.ConditionTypes.DayOfMonth: - var target_min_day = condition_values[0] - var target_max_day = condition_values[1] - var curr_day = MadTalkGlobals.gametime["day"] - - # Normal range - e.g. 14 - 21 - if target_min_day < target_max_day: - return (curr_day >= target_min_day) and (curr_day <= target_max_day) - # Inverted range - e.g. 25 - 14 - else: - return (curr_day >= target_min_day) or (curr_day <= target_max_day) - - MTDefs.ConditionTypes.Date: - var target_min_day_month = MadTalkGlobals.split_date(condition_values[0]) - var target_min_intdate = MadTalkGlobals.date_to_int(target_min_day_month[0], target_min_day_month[1], 1) - - var target_max_day_month = MadTalkGlobals.split_date(condition_values[1]) - var target_max_intdate = MadTalkGlobals.date_to_int(target_max_day_month[0], target_max_day_month[1], 1) - - var curr_intdate = MadTalkGlobals.date_to_int(MadTalkGlobals.gametime["day"], MadTalkGlobals.gametime["month"], 1) - - # Normal range - e.g. 15/02 - 25/03 - if target_min_intdate < target_max_intdate: - return (curr_intdate >= target_min_intdate) and (curr_intdate <= target_max_intdate) - # Inverted range - e.g. 25/12 - 28/02 - else: - return (curr_intdate >= target_min_intdate) or (curr_intdate <= target_max_intdate) - - MTDefs.ConditionTypes.ElapsedFromVar: - var delta_time = float(condition_values[0]) - var target_time = MadTalkGlobals.get_variable(condition_values[1], 0) - var delta_currently_elapsed = MadTalkGlobals.time - target_time - - return (delta_currently_elapsed >= delta_time) - - MTDefs.ConditionTypes.Custom: - if (not custom_condition_callable): - return false - - var custom_id = condition_values[0] - var custom_data_array = MadTalkGlobals.split_string_autodetect_rn(condition_values[1]) - - var result = await custom_condition_callable.call(custom_id, custom_data_array) - - if (result is int) or (result is float): - return (result != 0) - - elif result is bool: - return result - - else: - return false - - _: - return false - - -func activate_effect(effect_type, effect_values): - match effect_type: - MTDefs.EffectTypes.ChangeSheet: - # This effect is an exception and is not implemented here - pass - - MTDefs.EffectTypes.SetVariable: - MadTalkGlobals.set_variable(effect_values[0], float(effect_values[1])) - - MTDefs.EffectTypes.AddVariable: - var old_value = float(MadTalkGlobals.get_variable(effect_values[0])) - MadTalkGlobals.set_variable(effect_values[0], old_value + float(effect_values[1])) - - MTDefs.EffectTypes.RandomizeVariable: - var range_min = float(effect_values[1]) - var range_max = float(effect_values[2]) - MadTalkGlobals.set_variable(effect_values[0], - rng.randf_range(range_min, range_max) - ) - - MTDefs.EffectTypes.StampTime: - MadTalkGlobals.set_variable(effect_values[0], MadTalkGlobals.time) - - MTDefs.EffectTypes.SpendMinutes: - MadTalkGlobals.time += int(round(float(effect_values[0]) * 60)) # value * 60s - MadTalkGlobals.update_gametime_dict() - emit_signal("time_updated", MadTalkGlobals.gametime) - - MTDefs.EffectTypes.SpendDays: - MadTalkGlobals.time += int(round(float(effect_values[0]) * 24*60*60)) # value * 24h * 60m * 60s - MadTalkGlobals.update_gametime_dict() - emit_signal("time_updated", MadTalkGlobals.gametime) - - MTDefs.EffectTypes.SkipToTime: - MadTalkGlobals.time = MadTalkGlobals.next_time_at_time(effect_values[0]) - MadTalkGlobals.update_gametime_dict() - emit_signal("time_updated", MadTalkGlobals.gametime) - - MTDefs.EffectTypes.SkipToWeekDay: - MadTalkGlobals.time = MadTalkGlobals.next_time_at_weekday(effect_values[0]) - MadTalkGlobals.update_gametime_dict() - emit_signal("time_updated", MadTalkGlobals.gametime) - - MTDefs.EffectTypes.Custom: - # This effect is an exception and is not implemented here - pass - - -func dialog_acknowledge(): - # Called externally by UI to confirm a dialog message and progress dialog - if dialog_on_text_progress: - # This happened during text progression - if AnimateText: - if animated_text_tween: - animated_text_tween.kill() - #dialog_messagelabel.percent_visible = 1.0 # moved to run_dialog_item() - - else: - if (dialog_anims.current_animation == TransitionAnimationName_TextShow) and dialog_anims.is_playing(): - dialog_anims.advance(dialog_anims.current_animation_length - dialog_anims.current_animation_position) - - emit_signal("text_display_completed") - elif not MadTalkGlobals.is_during_cinematic: - emit_signal("dialog_acknowledged") - -func dialog_abort(): - is_abort_requested = true - dialog_acknowledge() - -func dialog_skip(): - is_skip_requested = true - dialog_acknowledge() - -func change_scene_to_file(scene_path: String) -> void: - # Convenience method giving access to get_tree().change_scene() - # as a node method in the scene tree - # This exists so you can connect signals from animation tracks in - # AnimationPlayer's directly to cause scene changes - var __= get_tree().change_scene_to_file(scene_path) - -func select_menu_option(index: int): - if index < menu_connected_ids.size(): - menu_option_activated.emit(index, menu_connected_ids[index]) - - -func _on_animation_finished(anim_name): - if anim_name == TransitionAnimationName_TextShow: - emit_signal("text_display_completed") - -func _on_animated_text_tween_completed(): - emit_signal("text_display_completed") - - -func _on_menu_button_pressed(index, id): - menu_option_activated.emit(index, id) - -func get_sheet_names(): - return dialog_data.sheets.keys() diff --git a/addons/madtalk/runtime/madtalk_runtime.gd.uid b/addons/madtalk/runtime/madtalk_runtime.gd.uid deleted file mode 100644 index 015b4fc..0000000 --- a/addons/madtalk/runtime/madtalk_runtime.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c6av3xe4m2ujl