Some changes

This commit is contained in:
2026-06-11 19:59:31 -05:00
parent 2f2ea060b1
commit eec429147b
150 changed files with 16615 additions and 262 deletions
@@ -0,0 +1,240 @@
@tool
extends PanelContainer
signal result_selected(path: String, cursor: Vector2, length: int)
const DialogueConstants = preload("../constants.gd")
var main_view: Control
@onready var input: LineEdit = %Input
@onready var search_button: Button = %SearchButton
@onready var match_case_button: CheckBox = %MatchCaseButton
@onready var replace_toggle: CheckButton = %ReplaceToggle
@onready var replace_container: VBoxContainer = %ReplaceContainer
@onready var replace_input: LineEdit = %ReplaceInput
@onready var replace_selected_button: Button = %ReplaceSelectedButton
@onready var replace_all_button: Button = %ReplaceAllButton
@onready var results_container: VBoxContainer = %ResultsContainer
@onready var result_template: HBoxContainer = %ResultTemplate
var current_results: Dictionary = {}:
set(value):
current_results = value
update_results_view()
if current_results.size() == 0:
replace_selected_button.disabled = true
replace_all_button.disabled = true
else:
replace_selected_button.disabled = false
replace_all_button.disabled = false
get:
return current_results
var selections: PackedStringArray = []
func _ready() -> void:
remove_child(result_template)
func _exit_tree() -> void:
result_template.queue_free()
func prepare() -> void:
if not is_node_ready():
await ready
input.grab_focus()
var template_label = result_template.get_node("Label")
template_label.get_theme_stylebox(&"focus").bg_color = main_view.code_edit.theme_overrides.current_line_color
template_label.add_theme_font_override(&"normal_font", main_view.code_edit.get_theme_font(&"font"))
replace_toggle.set_pressed_no_signal(false)
replace_container.hide()
$VBoxContainer/HBoxContainer/FindContainer/Label.text = DialogueConstants.translate(&"search.find")
input.placeholder_text = DialogueConstants.translate(&"search.placeholder")
input.text = ""
search_button.text = DialogueConstants.translate(&"search.find_all")
match_case_button.text = DialogueConstants.translate(&"search.match_case")
replace_toggle.text = DialogueConstants.translate(&"search.toggle_replace")
$VBoxContainer/HBoxContainer/ReplaceContainer/ReplaceLabel.text = DialogueConstants.translate(&"search.replace_with")
replace_input.placeholder_text = DialogueConstants.translate(&"search.replace_placeholder")
replace_input.text = ""
replace_all_button.text = DialogueConstants.translate(&"search.replace_all")
replace_selected_button.text = DialogueConstants.translate(&"search.replace_selected")
selections.clear()
current_results = {}
#region helpers
func update_results_view() -> void:
for child in results_container.get_children():
child.queue_free()
for path in current_results.keys():
var path_label: Label = Label.new()
path_label.text = path
# Show open files
if main_view.open_buffers.has(path):
path_label.text += "(*)"
results_container.add_child(path_label)
for path_result in current_results.get(path):
var result_item: HBoxContainer = result_template.duplicate()
var checkbox: CheckBox = result_item.get_node("CheckBox") as CheckBox
var key: String = get_selection_key(path, path_result)
checkbox.toggled.connect(func(is_pressed):
if is_pressed:
if not selections.has(key):
selections.append(key)
else:
if selections.has(key):
selections.remove_at(selections.find(key))
)
checkbox.set_pressed_no_signal(selections.has(key))
checkbox.visible = replace_toggle.button_pressed
var result_label: RichTextLabel = result_item.get_node("Label") as RichTextLabel
var colors: Dictionary = main_view.code_edit.theme_overrides
var highlight: String = ""
if replace_toggle.button_pressed:
var matched_word: String = "[bgcolor=" + Color(colors.critical_color, 0.5).to_html() + "][color=" + colors.text_color.to_html() + "]" + path_result.matched_text + "[/color][/bgcolor]"
highlight = "[s]" + matched_word + "[/s][bgcolor=" + Color(colors.notice_color, 0.5).to_html() + "][color=" + colors.text_color.to_html() + "]" + replace_input.text + "[/color][/bgcolor]"
else:
highlight = "[bgcolor=" + Color(colors.notice_color, 0.5).to_html() + "][color=" + colors.text_color.to_html() + "]" + path_result.matched_text + "[/color][/bgcolor]"
var text: String = path_result.text.substr(0, path_result.index) + highlight + path_result.text.substr(path_result.index + path_result.query.length())
result_label.text = "%s: %s" % [str(path_result.line + 1).lpad(4), text]
result_label.gui_input.connect(func(event):
if event is InputEventMouseButton and (event as InputEventMouseButton).button_index == MOUSE_BUTTON_LEFT and (event as InputEventMouseButton).double_click:
result_selected.emit(path, Vector2(path_result.index, path_result.line), path_result.query.length())
)
results_container.add_child(result_item)
func find_in_files() -> Dictionary:
var results: Dictionary = {}
var q: String = input.text
var file: FileAccess
for path in DMCache.get_files():
var path_results: Array = []
var lines: PackedStringArray = []
if main_view.open_buffers.has(path):
lines = main_view.open_buffers.get(path).text.split("\n")
else:
file = FileAccess.open(path, FileAccess.READ)
lines = file.get_as_text().split("\n")
for i in range(0, lines.size()):
var index: int = find_in_line(lines[i], q)
while index > -1:
path_results.append({
line = i,
index = index,
text = lines[i],
matched_text = lines[i].substr(index, q.length()),
query = q
})
index = find_in_line(lines[i], q, index + q.length())
if file != null and file.is_open():
file.close()
if path_results.size() > 0:
results[path] = path_results
return results
func get_selection_key(path: String, path_result: Dictionary) -> String:
return "%s-%d-%d" % [path, path_result.line, path_result.index]
func find_in_line(line: String, query: String, from_index: int = 0) -> int:
if match_case_button.button_pressed:
return line.find(query, from_index)
else:
return line.findn(query, from_index)
func replace_results(only_selected: bool) -> void:
var file: FileAccess
var lines: PackedStringArray = []
for path in current_results:
if main_view.open_buffers.has(path):
lines = main_view.open_buffers.get(path).text.split("\n")
else:
file = FileAccess.open(path, FileAccess.READ)
lines = file.get_as_text().split("\n")
# Read the results in reverse because we're going to be modifying them as we go
var path_results: Array = current_results.get(path).duplicate()
path_results.reverse()
for path_result in path_results:
var key: String = get_selection_key(path, path_result)
if not only_selected or (only_selected and selections.has(key)):
lines[path_result.line] = lines[path_result.line].substr(0, path_result.index) + replace_input.text + lines[path_result.line].substr(path_result.index + path_result.matched_text.length())
var replaced_text: String = "\n".join(lines)
if file != null and file.is_open():
file.close()
file = FileAccess.open(path, FileAccess.WRITE)
file.store_string(replaced_text)
file.close()
else:
main_view.open_buffers.get(path).text = replaced_text
if main_view.current_file_path == path:
main_view.code_edit.text = replaced_text
current_results = find_in_files()
#endregion
#region signals
func _on_search_button_pressed() -> void:
selections.clear()
self.current_results = find_in_files()
func _on_input_text_submitted(new_text: String) -> void:
_on_search_button_pressed()
func _on_replace_toggle_toggled(toggled_on: bool) -> void:
replace_container.visible = toggled_on
if toggled_on:
replace_input.grab_focus()
update_results_view()
func _on_replace_input_text_changed(new_text: String) -> void:
update_results_view()
func _on_replace_selected_button_pressed() -> void:
replace_results(true)
func _on_replace_all_button_pressed() -> void:
replace_results(false)
func _on_match_case_button_toggled(toggled_on: bool) -> void:
_on_search_button_pressed()
#endregion
@@ -0,0 +1 @@
uid://q368fmxxa8sd
@@ -0,0 +1,129 @@
[gd_scene format=3 uid="uid://0n7hwviyyly4"]
[ext_resource type="Script" uid="uid://q368fmxxa8sd" path="res://addons/dialogue_manager/views/find_in_dialogue_view.gd" id="1_3xicy"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_owohg"]
bg_color = Color(0.266667, 0.278431, 0.352941, 0.243137)
corner_detail = 1
[node name="FindInFiles" type="PanelContainer" unique_id=705304810]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_3xicy")
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=588637275]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer" unique_id=789222873]
layout_mode = 2
[node name="FindContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer" unique_id=1106456190]
layout_mode = 2
size_flags_horizontal = 3
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/FindContainer" unique_id=644125253]
layout_mode = 2
text = "Find:"
[node name="Input" type="LineEdit" parent="VBoxContainer/HBoxContainer/FindContainer" unique_id=1946262801]
unique_name_in_owner = true
layout_mode = 2
clear_button_enabled = true
[node name="FindToolbar" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/FindContainer" unique_id=872227533]
layout_mode = 2
[node name="SearchButton" type="Button" parent="VBoxContainer/HBoxContainer/FindContainer/FindToolbar" unique_id=667930226]
unique_name_in_owner = true
layout_mode = 2
text = "Find all..."
[node name="MatchCaseButton" type="CheckBox" parent="VBoxContainer/HBoxContainer/FindContainer/FindToolbar" unique_id=152832269]
unique_name_in_owner = true
layout_mode = 2
text = "Match case"
[node name="Control" type="Control" parent="VBoxContainer/HBoxContainer/FindContainer/FindToolbar" unique_id=1072708585]
layout_mode = 2
size_flags_horizontal = 3
[node name="ReplaceToggle" type="CheckButton" parent="VBoxContainer/HBoxContainer/FindContainer/FindToolbar" unique_id=1636801863]
unique_name_in_owner = true
layout_mode = 2
text = "Replace"
[node name="ReplaceContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer" unique_id=960698141]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
[node name="ReplaceLabel" type="Label" parent="VBoxContainer/HBoxContainer/ReplaceContainer" unique_id=1808438777]
layout_mode = 2
text = "Replace with:"
[node name="ReplaceInput" type="LineEdit" parent="VBoxContainer/HBoxContainer/ReplaceContainer" unique_id=621715286]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
clear_button_enabled = true
[node name="ReplaceToolbar" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ReplaceContainer" unique_id=1014505700]
layout_mode = 2
[node name="ReplaceSelectedButton" type="Button" parent="VBoxContainer/HBoxContainer/ReplaceContainer/ReplaceToolbar" unique_id=1137093995]
unique_name_in_owner = true
layout_mode = 2
text = "Replace selected"
[node name="ReplaceAllButton" type="Button" parent="VBoxContainer/HBoxContainer/ReplaceContainer/ReplaceToolbar" unique_id=1540770339]
unique_name_in_owner = true
layout_mode = 2
text = "Replace all"
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer" unique_id=605451224]
layout_mode = 2
[node name="ReplaceToolbar" type="HBoxContainer" parent="VBoxContainer/VBoxContainer" unique_id=387078090]
layout_mode = 2
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer" unique_id=1407099062]
layout_mode = 2
size_flags_vertical = 3
follow_focus = true
[node name="ResultsContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer" unique_id=323245871]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = 0
[node name="ResultTemplate" type="HBoxContainer" parent="." unique_id=1576110409]
unique_name_in_owner = true
layout_mode = 2
[node name="CheckBox" type="CheckBox" parent="ResultTemplate" unique_id=2062125934]
layout_mode = 2
[node name="Label" type="RichTextLabel" parent="ResultTemplate" unique_id=81253408]
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
theme_override_styles/focus = SubResource("StyleBoxFlat_owohg")
bbcode_enabled = true
text = "Result"
fit_content = true
scroll_active = false
[connection signal="text_submitted" from="VBoxContainer/HBoxContainer/FindContainer/Input" to="." method="_on_input_text_submitted"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/FindContainer/FindToolbar/SearchButton" to="." method="_on_search_button_pressed"]
[connection signal="toggled" from="VBoxContainer/HBoxContainer/FindContainer/FindToolbar/MatchCaseButton" to="." method="_on_match_case_button_toggled"]
[connection signal="toggled" from="VBoxContainer/HBoxContainer/FindContainer/FindToolbar/ReplaceToggle" to="." method="_on_replace_toggle_toggled"]
[connection signal="text_changed" from="VBoxContainer/HBoxContainer/ReplaceContainer/ReplaceInput" to="." method="_on_replace_input_text_changed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/ReplaceContainer/ReplaceToolbar/ReplaceSelectedButton" to="." method="_on_replace_selected_button_pressed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/ReplaceContainer/ReplaceToolbar/ReplaceAllButton" to="." method="_on_replace_all_button_pressed"]
+991
View File
@@ -0,0 +1,991 @@
@tool
extends Control
const OPEN_OPEN = 100
const OPEN_QUICK = 101
const OPEN_CLEAR = 102
const TRANSLATIONS_GENERATE_LINE_IDS_FOR_PROJECT = 100
const TRANSLATIONS_GENERATE_LINE_IDS_FOR_FILE = 101
const TRANSLATIONS_SAVE_CHARACTERS_TO_CSV = 201
const TRANSLATIONS_SAVE_TO_CSV = 202
const TRANSLATIONS_IMPORT_FROM_CSV = 203
const ITEM_SAVE = 100
const ITEM_SAVE_AS = 101
const ITEM_CLOSE = 102
const ITEM_CLOSE_ALL = 103
const ITEM_CLOSE_OTHERS = 104
const ITEM_COPY_PATH = 200
const ITEM_SHOW_IN_FILESYSTEM = 201
enum TranslationSource {
CharacterNames,
Lines
}
signal confirmation_closed()
@onready var parse_timer: Timer = $ParseTimer
# Banner
@onready var banner: CenterContainer = %Banner
@onready var banner_new_button: Button = %BannerNewButton
@onready var banner_quick_open: Button = %BannerQuickOpen
@onready var banner_examples: Button = %BannerExamples
# Dialogs
@onready var new_dialog: FileDialog = $NewDialog
@onready var save_dialog: FileDialog = $SaveDialog
@onready var open_dialog: FileDialog = $OpenDialog
@onready var quick_open_dialog: ConfirmationDialog = $QuickOpenDialog
@onready var quick_open_files_list: VBoxContainer = $QuickOpenDialog/QuickOpenFilesList
@onready var export_dialog: FileDialog = $ExportDialog
@onready var import_dialog: FileDialog = $ImportDialog
@onready var errors_dialog: AcceptDialog = $ErrorsDialog
@onready var build_error_dialog: AcceptDialog = $BuildErrorDialog
@onready var close_confirmation_dialog: ConfirmationDialog = $CloseConfirmationDialog
@onready var updated_dialog: AcceptDialog = $UpdatedDialog
@onready var generate_static_ids_confirmation_dialog: ConfirmationDialog = $GenerateStaticIdsConfirmationDialog
# Toolbar
@onready var new_button: Button = %NewButton
@onready var open_button: MenuButton = %OpenButton
@onready var save_all_button: Button = %SaveAllButton
@onready var find_in_files_button: Button = %FindInFilesButton
@onready var test_button: Button = %TestButton
@onready var test_line_button: Button = %TestLineButton
@onready var search_button: Button = %SearchButton
@onready var insert_button: MenuButton = %InsertButton
@onready var translations_button: MenuButton = %TranslationsButton
@onready var support_button: Button = %SupportButton
@onready var docs_button: Button = %DocsButton
@onready var version_label: Label = %VersionLabel
@onready var update_button: Button = %UpdateButton
@onready var search_and_replace := %SearchAndReplace
# Code editor
@onready var content: HSplitContainer = %Content
@onready var files_list := %FilesList
@onready var files_popup_menu: PopupMenu = %FilesPopupMenu
@onready var title_list := %TitleList
@onready var code_edit: DMCodeEdit = %CodeEdit
@onready var errors_panel := %ErrorsPanel
# The currently open file
var current_file_path: String = "":
set(next_current_file_path):
current_file_path = next_current_file_path
files_list.current_file_path = current_file_path
if current_file_path == "" or not open_buffers.has(current_file_path):
save_all_button.disabled = true
test_button.disabled = true
test_line_button.disabled = true
search_button.disabled = true
insert_button.disabled = true
translations_button.disabled = true
content.dragger_visibility = SplitContainer.DRAGGER_HIDDEN
files_list.hide()
title_list.hide()
code_edit.hide()
errors_panel.hide()
search_and_replace.hide()
banner.show()
else:
test_button.disabled = false
test_line_button.disabled = false
search_button.disabled = false
insert_button.disabled = false
translations_button.disabled = false
content.dragger_visibility = SplitContainer.DRAGGER_VISIBLE
files_list.show()
title_list.show()
code_edit.show()
banner.hide()
var cursor: Vector2 = DMSettings.get_caret(current_file_path)
var scroll_vertical: int = DMSettings.get_scroll(current_file_path)
code_edit.text = open_buffers[current_file_path].text
code_edit.errors = []
code_edit.clear_undo_history()
code_edit.set_cursor(cursor)
code_edit.scroll_vertical = scroll_vertical
code_edit.grab_focus()
_on_code_edit_text_changed()
errors_panel.errors = []
code_edit.errors = []
if search_and_replace.visible:
search_and_replace.search()
get:
return current_file_path
# A reference to the currently open files and their last saved text
var open_buffers: Dictionary = {}
# Which thing are we exporting translations for?
var translation_source: TranslationSource = TranslationSource.Lines
func _ready() -> void:
apply_theme()
# Start with nothing open
self.current_file_path = ""
# Set up the update checker
version_label.text = "v%s" % DMPlugin.get_version()
update_button.on_before_refresh = func on_before_refresh():
# Save everything
DMSettings.set_user_value("just_refreshed", {
current_file_path = current_file_path,
open_buffers = open_buffers
})
return true
# Did we just load from an addon version refresh?
var just_refreshed = DMSettings.get_user_value("just_refreshed", null)
if just_refreshed != null:
DMSettings.set_user_value("just_refreshed", null)
call_deferred("load_from_version_refresh", just_refreshed)
# Hook up the search toolbar
search_and_replace.code_edit = code_edit
# Connect menu buttons
insert_button.get_popup().id_pressed.connect(_on_insert_button_menu_id_pressed)
translations_button.get_popup().id_pressed.connect(_on_translations_button_menu_id_pressed)
code_edit.main_view = self
var editor_settings: EditorSettings = EditorInterface.get_editor_settings()
editor_settings.settings_changed.connect(_on_editor_settings_changed)
_on_editor_settings_changed()
ProjectSettings.settings_changed.connect(_on_project_settings_changed)
_on_project_settings_changed()
# Reopen any files that were open when Godot was closed
if editor_settings.get_setting("text_editor/behavior/files/restore_scripts_on_load"):
var reopen_files: Array = DMSettings.get_user_value("reopen_files", [])
for reopen_file in reopen_files:
open_file(reopen_file)
self.current_file_path = DMSettings.get_user_value("most_recent_reopen_file", "")
save_all_button.disabled = true
close_confirmation_dialog.ok_button_text = DMConstants.translate(&"confirm_close.save")
close_confirmation_dialog.add_button(DMConstants.translate(&"confirm_close.discard"), true, "discard")
errors_dialog.dialog_text = DMConstants.translate(&"errors_in_script")
# Update the buffer if a file was modified externally (retains undo step)
DMPlugin.instance.cache_file_content_changed.connect(_on_cache_file_content_changed)
EditorInterface.get_file_system_dock().files_moved.connect(_on_files_moved)
code_edit.get_v_scroll_bar().value_changed.connect(_on_code_edit_scroll_changed)
func _exit_tree() -> void:
DMSettings.set_user_value("reopen_files", open_buffers.keys())
DMSettings.set_user_value("most_recent_reopen_file", self.current_file_path)
func _unhandled_input(event: InputEvent) -> void:
if not visible: return
if event is InputEventKey and event.is_pressed():
var shortcut: String = DMPlugin.get_editor_shortcut(event)
match shortcut:
"close_file":
get_viewport().set_input_as_handled()
close_file(current_file_path)
"save":
get_viewport().set_input_as_handled()
save_file(current_file_path)
"find_in_files":
get_viewport().set_input_as_handled()
_on_find_in_files_button_pressed()
"run_test_scene":
get_viewport().set_input_as_handled()
_on_test_button_pressed()
func apply_changes() -> void:
save_files()
# Check if any open files have unsaved changes.
func count_unsaved_files() -> int:
var count: int = 0
for buffer in open_buffers.values():
if buffer.text != buffer.pristine_text:
count += 1
return count
# Load back to the previous buffer regardless of if it was actually saved
func load_from_version_refresh(just_refreshed: Dictionary) -> void:
if just_refreshed.has("current_file_content"):
# We just loaded from a version before multiple buffers
var file: FileAccess = FileAccess.open(just_refreshed.current_file_path, FileAccess.READ)
var file_text: String = file.get_as_text()
open_buffers[just_refreshed.current_file_path] = {
pristine_text = file_text,
text = just_refreshed.current_file_content
}
else:
open_buffers = just_refreshed.open_buffers
if just_refreshed.current_file_path != "":
EditorInterface.edit_resource(load(just_refreshed.current_file_path))
else:
EditorInterface.set_main_screen_editor("Dialogue")
updated_dialog.dialog_text = DMConstants.translate(&"update.success").format({ version = update_button.get_version() })
updated_dialog.popup_centered()
func new_file(path: String, content: String = "") -> void:
if open_buffers.has(path):
remove_file_from_open_buffers(path)
var file: FileAccess = FileAccess.open(path, FileAccess.WRITE)
if content == "":
file.store_string(DMSettings.get_setting(DMSettings.NEW_FILE_TEMPLATE, ""))
else:
file.store_string(content)
EditorInterface.get_resource_filesystem().scan()
# Open a dialogue resource for editing
func open_resource(resource: DialogueResource) -> void:
open_file(resource.resource_path)
func open_file(path: String) -> void:
if not FileAccess.file_exists(path): return
if not open_buffers.has(path):
var file: FileAccess = FileAccess.open(path, FileAccess.READ)
var text = file.get_as_text()
open_buffers[path] = {
cursor = Vector2.ZERO,
text = text,
pristine_text = text
}
DMSettings.add_recent_file(path)
build_open_menu()
files_list.files = open_buffers.keys()
files_list.select_file(path)
self.current_file_path = path
func quick_open() -> void:
quick_open_files_list.files = DMCache.get_files()
quick_open_dialog.popup_centered()
quick_open_files_list.focus_filter()
func show_file_in_filesystem(path: String) -> void:
EditorInterface.get_file_system_dock().navigate_to_path(path)
# Save any open files
func save_files() -> void:
save_all_button.disabled = true
var saved_files: PackedStringArray = []
for path in open_buffers:
if open_buffers[path].text != open_buffers[path].pristine_text:
saved_files.append(path)
save_file(path, false)
if saved_files.size() > 0:
DMCache.mark_files_for_reimport(saved_files)
# Save a file
func save_file(path: String, rescan_file_system: bool = true) -> void:
var buffer = open_buffers[path]
files_list.mark_file_as_unsaved(path, false)
save_all_button.disabled = files_list.unsaved_files.size() == 0
# Don't bother saving if there is nothing to save
if buffer.text == buffer.pristine_text:
return
buffer.pristine_text = buffer.text
# Save the current text
var file: FileAccess = FileAccess.open(path, FileAccess.WRITE)
file.store_string(buffer.text)
file.close()
if rescan_file_system:
EditorInterface.get_resource_filesystem().scan()
func close_file(path: String) -> void:
if not path in open_buffers.keys(): return
var buffer = open_buffers[path]
if buffer.text == buffer.pristine_text:
remove_file_from_open_buffers(path)
await get_tree().process_frame
else:
close_confirmation_dialog.dialog_text = DMConstants.translate(&"confirm_close").format({ path = path.get_file() })
close_confirmation_dialog.popup_centered()
await confirmation_closed
func remove_file_from_open_buffers(path: String) -> void:
if not path in open_buffers.keys(): return
var current_index = open_buffers.keys().find(current_file_path)
open_buffers.erase(path)
if open_buffers.size() == 0:
self.current_file_path = ""
else:
current_index = clamp(current_index, 0, open_buffers.size() - 1)
self.current_file_path = open_buffers.keys()[current_index]
files_list.files = open_buffers.keys()
# Apply theme colors and icons to the UI
func apply_theme() -> void:
if is_instance_valid(code_edit):
var scale: float = EditorInterface.get_editor_scale()
var editor_settings = EditorInterface.get_editor_settings()
code_edit.theme_overrides = {
scale = scale,
background_color = Color(editor_settings.get_setting("interface/theme/base_color").blend(editor_settings.get_setting("text_editor/theme/highlighting/background_color")), 1),
current_line_color = editor_settings.get_setting("text_editor/theme/highlighting/current_line_color"),
error_line_color = editor_settings.get_setting("text_editor/theme/highlighting/mark_color"),
critical_color = editor_settings.get_setting("text_editor/theme/highlighting/comment_markers/critical_color"),
notice_color = editor_settings.get_setting("text_editor/theme/highlighting/comment_markers/notice_color"),
titles_color = editor_settings.get_setting("text_editor/theme/highlighting/control_flow_keyword_color"),
text_color = editor_settings.get_setting("text_editor/theme/highlighting/text_color"),
conditions_color = editor_settings.get_setting("text_editor/theme/highlighting/keyword_color"),
mutations_color = editor_settings.get_setting("text_editor/theme/highlighting/function_color"),
mutations_line_color = Color(editor_settings.get_setting("text_editor/theme/highlighting/function_color"), 0.6),
members_color = editor_settings.get_setting("text_editor/theme/highlighting/member_variable_color"),
strings_color = editor_settings.get_setting("text_editor/theme/highlighting/string_color"),
numbers_color = editor_settings.get_setting("text_editor/theme/highlighting/number_color"),
symbols_color = editor_settings.get_setting("text_editor/theme/highlighting/symbol_color"),
comments_color = editor_settings.get_setting("text_editor/theme/highlighting/comment_color"),
jumps_color = Color(editor_settings.get_setting("text_editor/theme/highlighting/control_flow_keyword_color"), 0.6),
font_size = editor_settings.get_setting("interface/editor/code_font_size")
}
banner_new_button.icon = get_theme_icon("New", "EditorIcons")
banner_quick_open.icon = get_theme_icon("Load", "EditorIcons")
new_button.icon = get_theme_icon("New", "EditorIcons")
new_button.tooltip_text = DMConstants.translate(&"start_a_new_file")
open_button.icon = get_theme_icon("Load", "EditorIcons")
open_button.tooltip_text = DMConstants.translate(&"open_a_file")
save_all_button.icon = get_theme_icon("Save", "EditorIcons")
save_all_button.text = DMConstants.translate(&"all")
save_all_button.tooltip_text = DMConstants.translate(&"start_all_files")
find_in_files_button.icon = get_theme_icon("ViewportZoom", "EditorIcons")
find_in_files_button.tooltip_text = DMConstants.translate(&"find_in_files")
test_button.icon = get_theme_icon("DebugNext", "EditorIcons")
test_button.tooltip_text = DMConstants.translate(&"test_dialogue")
test_line_button.icon = get_theme_icon("DebugStep", "EditorIcons")
test_line_button.tooltip_text = DMConstants.translate(&"test_dialogue_from_line")
search_button.icon = get_theme_icon("Search", "EditorIcons")
search_button.tooltip_text = DMConstants.translate(&"search_for_text")
insert_button.icon = get_theme_icon("RichTextEffect", "EditorIcons")
insert_button.text = DMConstants.translate(&"insert")
translations_button.icon = get_theme_icon("Translation", "EditorIcons")
translations_button.text = DMConstants.translate(&"translations")
support_button.icon = get_theme_icon("Heart", "EditorIcons")
support_button.text = DMConstants.translate(&"sponsor")
support_button.tooltip_text = DMConstants.translate(&"show_support")
docs_button.icon = get_theme_icon("Help", "EditorIcons")
docs_button.text = DMConstants.translate(&"docs")
update_button.apply_theme()
# Set up the effect menu
var popup: PopupMenu = insert_button.get_popup()
popup.clear()
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.wave_bbcode"), 0)
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.shake_bbcode"), 1)
popup.add_separator()
popup.add_icon_item(get_theme_icon("Time", "EditorIcons"), DMConstants.translate(&"insert.typing_pause"), 3)
popup.add_icon_item(get_theme_icon("ViewportSpeed", "EditorIcons"), DMConstants.translate(&"insert.typing_speed_change"), 4)
popup.add_icon_item(get_theme_icon("DebugNext", "EditorIcons"), DMConstants.translate(&"insert.auto_advance"), 5)
popup.add_separator(DMConstants.translate(&"insert.templates"))
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.title"), 6)
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.dialogue"), 7)
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.response"), 8)
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.random_lines"), 9)
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.random_text"), 10)
popup.add_separator(DMConstants.translate(&"insert.actions"))
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.jump"), 11)
popup.add_icon_item(get_theme_icon("RichTextEffect", "EditorIcons"), DMConstants.translate(&"insert.end_dialogue"), 12)
# Set up the translations menu
popup = translations_button.get_popup()
popup.clear()
popup.add_icon_item(get_theme_icon("Translation", "EditorIcons"), DMConstants.translate(&"generate_line_ids_for_file"), TRANSLATIONS_GENERATE_LINE_IDS_FOR_FILE)
popup.add_icon_item(get_theme_icon("Translation", "EditorIcons"), DMConstants.translate(&"generate_line_ids_for_project"), TRANSLATIONS_GENERATE_LINE_IDS_FOR_PROJECT)
popup.add_separator()
popup.add_icon_item(get_theme_icon("FileList", "EditorIcons"), DMConstants.translate(&"save_characters_to_csv"), TRANSLATIONS_SAVE_CHARACTERS_TO_CSV)
popup.add_icon_item(get_theme_icon("FileList", "EditorIcons"), DMConstants.translate(&"save_to_csv"), TRANSLATIONS_SAVE_TO_CSV)
popup.add_icon_item(get_theme_icon("AssetLib", "EditorIcons"), DMConstants.translate(&"import_from_csv"), TRANSLATIONS_IMPORT_FROM_CSV)
# Dialog sizes
new_dialog.min_size = Vector2(600, 500) * scale
save_dialog.min_size = Vector2(600, 500) * scale
open_dialog.min_size = Vector2(600, 500) * scale
quick_open_dialog.min_size = Vector2(400, 600) * scale
export_dialog.min_size = Vector2(600, 500) * scale
import_dialog.min_size = Vector2(600, 500) * scale
#region Helpers
# Move the cursor to a given title in the dialogue editor
func go_to_title(title: String, create_if_none: bool = false) -> void:
code_edit.go_to_title(title, create_if_none)
code_edit.grab_focus()
# Refresh the open menu with the latest files
func build_open_menu() -> void:
var menu = open_button.get_popup()
menu.clear()
menu.add_icon_item(get_theme_icon("Load", "EditorIcons"), DMConstants.translate(&"open.open"), OPEN_OPEN)
menu.add_icon_item(get_theme_icon("Load", "EditorIcons"), DMConstants.translate(&"open.quick_open"), OPEN_QUICK)
menu.add_separator()
var recent_files = DMSettings.get_recent_files()
if recent_files.size() == 0:
menu.add_item(DMConstants.translate(&"open.no_recent_files"))
menu.set_item_disabled(2, true)
else:
for path in recent_files:
if FileAccess.file_exists(path):
menu.add_icon_item(get_theme_icon("File", "EditorIcons"), path)
menu.add_separator()
menu.add_item(DMConstants.translate(&"open.clear_recent_files"), OPEN_CLEAR)
if menu.id_pressed.is_connected(_on_open_menu_id_pressed):
menu.id_pressed.disconnect(_on_open_menu_id_pressed)
menu.id_pressed.connect(_on_open_menu_id_pressed)
# Get the last place a CSV, etc was exported
func get_last_export_path(extension: String) -> String:
var filename = current_file_path.get_file().replace(".dialogue", "." + extension)
return DMSettings.get_user_value("last_export_path", current_file_path.get_base_dir()) + "/" + filename
# Check the current text for errors
func compile() -> void:
# Skip if nothing to parse
if current_file_path == "": return
var result: DMCompilerResult = DMCompiler.compile_string(code_edit.text, current_file_path)
code_edit.errors = result.errors
errors_panel.errors = result.errors
title_list.titles = code_edit.get_titles()
func show_build_error_dialog() -> void:
build_error_dialog.dialog_text = DMConstants.translate(&"errors_with_build")
build_error_dialog.popup_centered()
# Generate translation line IDs for any line that doesn't already have one
func generate_translations_keys() -> void:
generate_static_ids_confirmation_dialog.title = DMConstants.translate("generate_ids.warning_title")
generate_static_ids_confirmation_dialog.dialog_text = DMConstants.translate("generate_ids.warning_text")
generate_static_ids_confirmation_dialog.ok_button_text = DMConstants.translate("generate_ids.ok_button")
generate_static_ids_confirmation_dialog.popup_centered()
# Add a translation file to the project settings
func add_path_to_project_translations(path: String) -> void:
var translations: PackedStringArray = ProjectSettings.get_setting("internationalization/locale/translations")
if not path in translations:
translations.append(path)
ProjectSettings.save()
# Export dialogue and responses to CSV
func export_translations_to_csv(path: String) -> void:
DMTranslationUtilities.export_translations_to_csv(path, code_edit.text, current_file_path)
EditorInterface.get_resource_filesystem().scan()
EditorInterface.get_file_system_dock().call_deferred("navigate_to_path", path)
# Add it to the project l10n settings if it's not already there
var default_locale: String = DMSettings.get_setting(DMSettings.DEFAULT_CSV_LOCALE, "en")
var language_code: RegExMatch = RegEx.create_from_string("^[a-z]{2,3}").search(default_locale)
var translation_path: String = path.replace(".csv", ".%s.translation" % language_code.get_string())
call_deferred("add_path_to_project_translations", translation_path)
func export_character_names_to_csv(path: String) -> void:
DMTranslationUtilities.export_character_names_to_csv(path, code_edit.text, current_file_path)
EditorInterface.get_resource_filesystem().scan()
EditorInterface.get_file_system_dock().call_deferred("navigate_to_path", path)
# Add it to the project l10n settings if it's not already there
var translation_path: String = path.replace(".csv", ".en.translation")
call_deferred("add_path_to_project_translations", translation_path)
# Import changes back from an exported CSV by matching translation keys
func import_translations_from_csv(path: String) -> void:
var cursor: Vector2 = code_edit.get_cursor()
code_edit.text = DMTranslationUtilities.import_translations_from_csv(path, code_edit.text)
code_edit.set_cursor(cursor)
func show_search_form(is_enabled: bool) -> void:
if code_edit.last_selected_text:
search_and_replace.input.text = code_edit.last_selected_text
search_and_replace.visible = is_enabled
search_button.set_pressed_no_signal(is_enabled)
search_and_replace.focus_line_edit()
func run_test_scene(from_key: String) -> void:
DMSettings.set_user_value("run_title", from_key)
DMSettings.set_user_value("is_running_test_scene", true)
DMSettings.set_user_value("run_resource_path", current_file_path)
var test_scene_path: String = DMSettings.get_setting(DMSettings.CUSTOM_TEST_SCENE_PATH, "res://addons/dialogue_manager/test_scene.tscn")
if ResourceUID.has_id(ResourceUID.text_to_id(test_scene_path)):
test_scene_path = ResourceUID.get_id_path(ResourceUID.text_to_id(test_scene_path))
EditorInterface.play_custom_scene(test_scene_path)
#endregion
#region Signals
func _on_files_moved(old_file: String, new_file: String) -> void:
if open_buffers.has(old_file):
open_buffers[new_file] = open_buffers[old_file]
open_buffers.erase(old_file)
open_buffers[new_file]
func _on_cache_file_content_changed(path: String, new_content: String) -> void:
if open_buffers.has(path):
var buffer = open_buffers[path]
if buffer.text == buffer.pristine_text and buffer.text != new_content:
buffer.text = new_content
if path == current_file_path:
code_edit.text = new_content
title_list.titles = code_edit.get_titles()
buffer.pristine_text = new_content
func _on_editor_settings_changed() -> void:
var editor_settings: EditorSettings = EditorInterface.get_editor_settings()
code_edit.minimap_draw = editor_settings.get_setting("text_editor/appearance/minimap/show_minimap")
code_edit.minimap_width = editor_settings.get_setting("text_editor/appearance/minimap/minimap_width")
code_edit.scroll_smooth = editor_settings.get_setting("text_editor/behavior/navigation/smooth_scrolling")
func _on_project_settings_changed() -> void:
code_edit.wrap_mode = TextEdit.LINE_WRAPPING_BOUNDARY if DMSettings.get_setting(DMSettings.WRAP_LONG_LINES, false) else TextEdit.LINE_WRAPPING_NONE
func _on_open_menu_id_pressed(id: int) -> void:
match id:
OPEN_OPEN:
open_dialog.popup_centered()
OPEN_QUICK:
quick_open()
OPEN_CLEAR:
DMSettings.clear_recent_files()
build_open_menu()
_:
var menu = open_button.get_popup()
var item = menu.get_item_text(menu.get_item_index(id))
open_file(item)
func _on_files_list_file_selected(file_path: String) -> void:
self.current_file_path = file_path
func _on_insert_button_menu_id_pressed(id: int) -> void:
match id:
0:
code_edit.insert_bbcode("[wave amp=25 freq=5]", "[/wave]")
1:
code_edit.insert_bbcode("[shake rate=20 level=10]", "[/shake]")
3:
code_edit.insert_bbcode("[wait=1]")
4:
code_edit.insert_bbcode("[speed=0.2]")
5:
code_edit.insert_bbcode("[next=auto]")
6:
code_edit.insert_text_at_cursor("~ title")
7:
code_edit.insert_text_at_cursor("Nathan: This is Some Dialogue")
8:
code_edit.insert_text_at_cursor("Nathan: Choose a Response...\n- Option 1\n\tNathan: You chose option 1\n- Option 2\n\tNathan: You chose option 2")
9:
code_edit.insert_text_at_cursor("% Nathan: This is random line 1.\n% Nathan: This is random line 2.\n%1 Nathan: This is weighted random line 3.")
10:
code_edit.insert_text_at_cursor("Nathan: [[Hi|Hello|Howdy]]")
11:
code_edit.insert_text_at_cursor("=> title")
12:
code_edit.insert_text_at_cursor("=> END")
func _on_translations_button_menu_id_pressed(id: int) -> void:
match id:
TRANSLATIONS_GENERATE_LINE_IDS_FOR_FILE:
var scroll_vertical: float = code_edit.scroll_vertical
var cursor: Vector2i = code_edit.get_cursor()
code_edit.text = DMTranslationUtilities.generate_static_line_ids_for_text(code_edit.text, current_file_path)
code_edit.set_cursor(cursor)
code_edit.set_deferred("scroll_vertical",scroll_vertical)
_on_code_edit_text_changed()
TRANSLATIONS_GENERATE_LINE_IDS_FOR_PROJECT:
generate_translations_keys()
TRANSLATIONS_SAVE_CHARACTERS_TO_CSV:
translation_source = TranslationSource.CharacterNames
export_dialog.filters = PackedStringArray(["*.csv ; Translation CSV"])
export_dialog.current_path = get_last_export_path("csv")
export_dialog.popup_centered()
TRANSLATIONS_SAVE_TO_CSV:
translation_source = TranslationSource.Lines
export_dialog.filters = PackedStringArray(["*.csv ; Translation CSV"])
export_dialog.current_path = get_last_export_path("csv")
export_dialog.popup_centered()
TRANSLATIONS_IMPORT_FROM_CSV:
import_dialog.current_path = get_last_export_path("csv")
import_dialog.popup_centered()
func _on_export_dialog_file_selected(path: String) -> void:
DMSettings.set_user_value("last_export_path", path.get_base_dir())
match path.get_extension():
"csv":
match translation_source:
TranslationSource.CharacterNames:
export_character_names_to_csv(path)
TranslationSource.Lines:
export_translations_to_csv(path)
func _on_import_dialog_file_selected(path: String) -> void:
DMSettings.set_user_value("last_export_path", path.get_base_dir())
import_translations_from_csv(path)
func _on_main_view_theme_changed():
apply_theme()
func _on_main_view_visibility_changed() -> void:
if visible and is_instance_valid(code_edit):
code_edit.grab_focus()
func _on_new_button_pressed() -> void:
new_dialog.current_file = "untitled"
new_dialog.popup_centered()
func _on_new_dialog_confirmed() -> void:
var path: String = new_dialog.current_path
if path.get_file() == ".dialogue":
path = "%s/untitled.dialogue" % path.get_basename()
new_file(path)
open_file(path)
func _on_new_dialog_file_selected(path: String) -> void:
new_file(path)
open_file(path)
func _on_save_dialog_file_selected(path: String) -> void:
if path == "": path = "res://untitled.dialogue"
new_file(path, code_edit.text)
open_file(path)
func _on_open_button_about_to_popup() -> void:
build_open_menu()
func _on_open_dialog_file_selected(path: String) -> void:
open_file(path)
func _on_quick_open_files_list_file_double_clicked(file_path: String) -> void:
quick_open_dialog.hide()
open_file(file_path)
func _on_quick_open_dialog_confirmed() -> void:
if quick_open_files_list.last_selected_file_path:
open_file(quick_open_files_list.last_selected_file_path)
func _on_save_all_button_pressed() -> void:
save_files()
func _on_find_in_files_button_pressed() -> void:
DMPlugin.show_find_in_dialogue()
func _on_code_edit_text_changed() -> void:
var buffer = open_buffers[current_file_path]
buffer.text = code_edit.text
files_list.mark_file_as_unsaved(current_file_path, buffer.text != buffer.pristine_text)
save_all_button.disabled = open_buffers.values().filter(func(d): return d.text != d.pristine_text).size() == 0
parse_timer.start(1)
func _on_code_edit_scroll_changed(value: int) -> void:
DMSettings.set_scroll(current_file_path, code_edit.scroll_vertical)
func _on_code_edit_active_title_change(title: String) -> void:
title_list.select_title(title)
func _on_code_edit_caret_changed() -> void:
DMSettings.set_caret(current_file_path, code_edit.get_cursor())
func _on_code_edit_error_clicked(line_number: int) -> void:
errors_panel.show_error_for_line_number(line_number)
func _on_title_list_title_selected(title: String) -> void:
go_to_title(title)
func _on_parse_timer_timeout() -> void:
parse_timer.stop()
compile()
func _on_errors_panel_error_pressed(line_number: int, column_number: int) -> void:
code_edit.set_caret_line(line_number - 1)
code_edit.set_caret_column(column_number)
code_edit.grab_focus()
func _on_search_button_toggled(button_pressed: bool) -> void:
show_search_form(button_pressed)
func _on_search_and_replace_open_requested() -> void:
show_search_form(true)
func _on_search_and_replace_close_requested() -> void:
search_button.set_pressed_no_signal(false)
search_and_replace.visible = false
code_edit.grab_focus()
func _on_test_button_pressed() -> void:
save_file(current_file_path, false)
DMCache.reimport_files([current_file_path])
if errors_panel.errors.size() > 0:
errors_dialog.popup_centered()
return
run_test_scene("")
func _on_test_line_button_pressed() -> void:
save_file(current_file_path)
if errors_panel.errors.size() > 0:
errors_dialog.popup_centered()
return
# Find next non-empty line
var line_to_run: int = 0
for i in range(code_edit.get_cursor().y, code_edit.get_line_count()):
if not code_edit.get_line(i).is_empty():
line_to_run = i
break
run_test_scene(str(line_to_run))
func _on_support_button_pressed() -> void:
OS.shell_open("https://patreon.com/nathanhoad")
func _on_docs_button_pressed() -> void:
OS.shell_open("https://github.com/nathanhoad/godot_dialogue_manager/tree/v3.x")
func _on_files_list_file_popup_menu_requested(at_position: Vector2) -> void:
files_popup_menu.position = Vector2(get_viewport().position) + files_list.global_position + at_position
files_popup_menu.popup()
func _on_files_list_file_middle_clicked(path: String):
close_file(path)
func _on_files_popup_menu_about_to_popup() -> void:
files_popup_menu.clear()
var shortcuts: Dictionary = DMPlugin.get_editor_shortcuts()
files_popup_menu.add_item(DMConstants.translate(&"buffer.save"), ITEM_SAVE, OS.find_keycode_from_string(shortcuts.get("save")[0].as_text_keycode()))
files_popup_menu.add_item(DMConstants.translate(&"buffer.save_as"), ITEM_SAVE_AS)
files_popup_menu.add_item(DMConstants.translate(&"buffer.close"), ITEM_CLOSE, OS.find_keycode_from_string(shortcuts.get("close_file")[0].as_text_keycode()))
files_popup_menu.add_item(DMConstants.translate(&"buffer.close_all"), ITEM_CLOSE_ALL)
files_popup_menu.add_item(DMConstants.translate(&"buffer.close_other_files"), ITEM_CLOSE_OTHERS)
files_popup_menu.add_separator()
files_popup_menu.add_item(DMConstants.translate(&"buffer.copy_file_path"), ITEM_COPY_PATH)
files_popup_menu.add_item(DMConstants.translate(&"buffer.show_in_filesystem"), ITEM_SHOW_IN_FILESYSTEM)
func _on_files_popup_menu_id_pressed(id: int) -> void:
match id:
ITEM_SAVE:
save_file(current_file_path)
ITEM_SAVE_AS:
save_dialog.popup_centered()
ITEM_CLOSE:
close_file(current_file_path)
ITEM_CLOSE_ALL:
for path in open_buffers.keys():
close_file(path)
ITEM_CLOSE_OTHERS:
var current_current_file_path: String = current_file_path
for path in open_buffers.keys():
if path != current_current_file_path:
await close_file(path)
ITEM_COPY_PATH:
DisplayServer.clipboard_set(current_file_path)
ITEM_SHOW_IN_FILESYSTEM:
show_file_in_filesystem(current_file_path)
func _on_code_edit_external_file_requested(path: String, title: String) -> void:
open_file(path)
if title != "":
code_edit.go_to_title(title)
else:
code_edit.set_caret_line(0)
func _on_close_confirmation_dialog_confirmed() -> void:
save_file(current_file_path)
remove_file_from_open_buffers(current_file_path)
confirmation_closed.emit()
func _on_close_confirmation_dialog_custom_action(action: StringName) -> void:
if action == "discard":
remove_file_from_open_buffers(current_file_path)
close_confirmation_dialog.hide()
confirmation_closed.emit()
func _on_find_in_files_result_selected(path: String, cursor: Vector2, length: int) -> void:
open_file(path)
code_edit.select(cursor.y, cursor.x, cursor.y, cursor.x + length)
code_edit.set_line_as_center_visible(cursor.y)
func _on_banner_image_gui_input(event: InputEvent) -> void:
if event.is_pressed():
OS.shell_open("https://bravestcoconut.com/wishlist")
func _on_banner_new_button_pressed() -> void:
new_dialog.current_file = "untitled"
new_dialog.popup_centered()
func _on_banner_quick_open_pressed() -> void:
quick_open()
func _on_banner_examples_pressed() -> void:
OS.shell_open("https://itch.io/c/5226650/godot-dialogue-manager-example-projects")
func _on_generate_static_ids_confirmation_dialog_confirmed() -> void:
save_files()
var cursor: Vector2 = code_edit.get_cursor()
var scroll_vertical = code_edit.scroll_vertical
DMTranslationUtilities.generate_static_line_ids_for_project()
for file_path: String in open_buffers:
var buffer: Dictionary = open_buffers.get(file_path)
buffer.text = FileAccess.get_file_as_string(file_path)
buffer.pristine_text = buffer.text
if file_path == current_file_path:
code_edit.text = buffer.text
code_edit.set_cursor(cursor)
code_edit.scroll_vertical = scroll_vertical
_on_code_edit_text_changed()
#endregion
@@ -0,0 +1 @@
uid://cipjcc7bkh1pc
@@ -0,0 +1,467 @@
[gd_scene format=3 uid="uid://cbuf1q3xsse3q"]
[ext_resource type="Script" uid="uid://cipjcc7bkh1pc" path="res://addons/dialogue_manager/views/main_view.gd" id="1_h6qfq"]
[ext_resource type="PackedScene" uid="uid://civ6shmka5e8u" path="res://addons/dialogue_manager/components/code_edit.tscn" id="2_f73fm"]
[ext_resource type="PackedScene" uid="uid://dnufpcdrreva3" path="res://addons/dialogue_manager/components/files_list.tscn" id="2_npj2k"]
[ext_resource type="PackedScene" uid="uid://ctns6ouwwd68i" path="res://addons/dialogue_manager/components/title_list.tscn" id="2_onb4i"]
[ext_resource type="PackedScene" uid="uid://co8yl23idiwbi" path="res://addons/dialogue_manager/components/update_button.tscn" id="2_ph3vs"]
[ext_resource type="PackedScene" uid="uid://gr8nakpbrhby" path="res://addons/dialogue_manager/components/search_and_replace.tscn" id="6_ylh0t"]
[ext_resource type="PackedScene" uid="uid://cs8pwrxr5vxix" path="res://addons/dialogue_manager/components/errors_panel.tscn" id="7_5cvl4"]
[ext_resource type="Script" uid="uid://klpiq4tk3t7a" path="res://addons/dialogue_manager/components/code_edit_syntax_highlighter.gd" id="7_necsa"]
[ext_resource type="Texture2D" uid="uid://cnm67htuohhlo" path="res://addons/dialogue_manager/assets/banner.png" id="9_y6rqu"]
[sub_resource type="Image" id="Image_faxki"]
data = {
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id="ImageTexture_ka3gk"]
image = SubResource("Image_faxki")
[sub_resource type="Image" id="Image_y6rqu"]
data = {
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id="ImageTexture_57eek"]
image = SubResource("Image_y6rqu")
[sub_resource type="SyntaxHighlighter" id="SyntaxHighlighter_mpdoc"]
script = ExtResource("7_necsa")
[node name="MainView" type="Control" unique_id=1975859718]
clip_contents = true
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_h6qfq")
[node name="ParseTimer" type="Timer" parent="." unique_id=1210958138]
[node name="Margin" type="MarginContainer" parent="." unique_id=424731994]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 3
theme_override_constants/margin_left = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
metadata/_edit_layout_mode = 1
[node name="Content" type="HSplitContainer" parent="Margin" unique_id=267962742]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
dragger_visibility = 1
[node name="SidePanel" type="VBoxContainer" parent="Margin/Content" unique_id=408822052]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
size_flags_horizontal = 3
[node name="Toolbar" type="HBoxContainer" parent="Margin/Content/SidePanel" unique_id=1890446441]
layout_mode = 2
[node name="NewButton" type="Button" parent="Margin/Content/SidePanel/Toolbar" unique_id=916776070]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Start a new file"
flat = true
[node name="OpenButton" type="MenuButton" parent="Margin/Content/SidePanel/Toolbar" unique_id=880106178]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Open a file"
item_count = 9
popup/item_0/text = "Open..."
popup/item_0/icon = SubResource("ImageTexture_ka3gk")
popup/item_0/id = 100
popup/item_1/icon = SubResource("ImageTexture_ka3gk")
popup/item_1/id = 101
popup/item_2/id = -1
popup/item_2/separator = true
popup/item_3/text = "res://examples/dialogue.dialogue"
popup/item_3/icon = SubResource("ImageTexture_ka3gk")
popup/item_3/id = 3
popup/item_4/text = "res://examples/dialogue_with_input.dialogue"
popup/item_4/icon = SubResource("ImageTexture_ka3gk")
popup/item_4/id = 4
popup/item_5/text = "res://examples/dialogue_for_point_n_click.dialogue"
popup/item_5/icon = SubResource("ImageTexture_ka3gk")
popup/item_5/id = 5
popup/item_6/text = "res://examples/dialogue_for_visual_novel.dialogue"
popup/item_6/icon = SubResource("ImageTexture_ka3gk")
popup/item_6/id = 6
popup/item_7/id = -1
popup/item_7/separator = true
popup/item_8/text = "Clear recent files"
popup/item_8/id = 102
[node name="SaveAllButton" type="Button" parent="Margin/Content/SidePanel/Toolbar" unique_id=940841574]
unique_name_in_owner = true
layout_mode = 2
disabled = true
flat = true
[node name="FindInFilesButton" type="Button" parent="Margin/Content/SidePanel/Toolbar" unique_id=213493052]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Find in files..."
flat = true
[node name="Bookmarks" type="VSplitContainer" parent="Margin/Content/SidePanel" unique_id=1966503844]
layout_mode = 2
size_flags_vertical = 3
[node name="FilesList" parent="Margin/Content/SidePanel/Bookmarks" unique_id=1460458494 instance=ExtResource("2_npj2k")]
unique_name_in_owner = true
visible = false
layout_mode = 2
[node name="FilesPopupMenu" type="PopupMenu" parent="Margin/Content/SidePanel/Bookmarks/FilesList" unique_id=253084069]
unique_name_in_owner = true
[node name="TitleList" parent="Margin/Content/SidePanel/Bookmarks" unique_id=2063152064 instance=ExtResource("2_onb4i")]
unique_name_in_owner = true
visible = false
layout_mode = 2
[node name="CodePanel" type="VBoxContainer" parent="Margin/Content" unique_id=2013417278]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 4.0
[node name="Toolbar" type="HBoxContainer" parent="Margin/Content/CodePanel" unique_id=177899511]
layout_mode = 2
[node name="InsertButton" type="MenuButton" parent="Margin/Content/CodePanel/Toolbar" unique_id=1765432833]
unique_name_in_owner = true
layout_mode = 2
disabled = true
text = "Insert"
item_count = 15
popup/item_0/text = "Wave BBCode"
popup/item_0/icon = SubResource("ImageTexture_57eek")
popup/item_0/id = 0
popup/item_1/text = "Shake BBCode"
popup/item_1/icon = SubResource("ImageTexture_57eek")
popup/item_1/id = 1
popup/item_2/id = -1
popup/item_2/separator = true
popup/item_3/text = "Typing pause"
popup/item_3/icon = SubResource("ImageTexture_57eek")
popup/item_3/id = 3
popup/item_4/text = "Typing speed change"
popup/item_4/icon = SubResource("ImageTexture_57eek")
popup/item_4/id = 4
popup/item_5/text = "Auto advance"
popup/item_5/icon = SubResource("ImageTexture_57eek")
popup/item_5/id = 5
popup/item_6/text = "Templates"
popup/item_6/id = -1
popup/item_6/separator = true
popup/item_7/text = "Title"
popup/item_7/icon = SubResource("ImageTexture_57eek")
popup/item_7/id = 6
popup/item_8/text = "Dialogue"
popup/item_8/icon = SubResource("ImageTexture_57eek")
popup/item_8/id = 7
popup/item_9/text = "Response"
popup/item_9/icon = SubResource("ImageTexture_57eek")
popup/item_9/id = 8
popup/item_10/text = "Random lines"
popup/item_10/icon = SubResource("ImageTexture_57eek")
popup/item_10/id = 9
popup/item_11/text = "Random text"
popup/item_11/icon = SubResource("ImageTexture_57eek")
popup/item_11/id = 10
popup/item_12/text = "Actions"
popup/item_12/id = -1
popup/item_12/separator = true
popup/item_13/text = "Jump to title"
popup/item_13/icon = SubResource("ImageTexture_57eek")
popup/item_13/id = 11
popup/item_14/text = "End dialogue"
popup/item_14/icon = SubResource("ImageTexture_57eek")
popup/item_14/id = 12
[node name="TranslationsButton" type="MenuButton" parent="Margin/Content/CodePanel/Toolbar" unique_id=2010201295]
unique_name_in_owner = true
layout_mode = 2
disabled = true
text = "Translations"
item_count = 5
popup/item_0/text = "Generate line IDs"
popup/item_0/icon = SubResource("ImageTexture_57eek")
popup/item_0/id = 100
popup/item_1/id = -1
popup/item_1/separator = true
popup/item_2/text = "Save character names to CSV..."
popup/item_2/icon = SubResource("ImageTexture_57eek")
popup/item_2/id = 201
popup/item_3/text = "Save lines to CSV..."
popup/item_3/icon = SubResource("ImageTexture_57eek")
popup/item_3/id = 202
popup/item_4/text = "Import line changes from CSV..."
popup/item_4/icon = SubResource("ImageTexture_57eek")
popup/item_4/id = 203
[node name="Separator" type="VSeparator" parent="Margin/Content/CodePanel/Toolbar" unique_id=821562382]
layout_mode = 2
[node name="SearchButton" type="Button" parent="Margin/Content/CodePanel/Toolbar" unique_id=121689358]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Search for text"
disabled = true
toggle_mode = true
flat = true
[node name="Separator2" type="VSeparator" parent="Margin/Content/CodePanel/Toolbar" unique_id=175043853]
layout_mode = 2
[node name="TestButton" type="Button" parent="Margin/Content/CodePanel/Toolbar" unique_id=1610822770]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Test dialogue"
disabled = true
flat = true
[node name="TestLineButton" type="Button" parent="Margin/Content/CodePanel/Toolbar" unique_id=1575726308]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Test dialogue"
disabled = true
flat = true
[node name="Spacer2" type="Control" parent="Margin/Content/CodePanel/Toolbar" unique_id=249482575]
layout_mode = 2
size_flags_horizontal = 3
[node name="SupportButton" type="Button" parent="Margin/Content/CodePanel/Toolbar" unique_id=1042093313]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Support Dialogue Manager"
text = "Sponsor"
flat = true
[node name="Separator4" type="VSeparator" parent="Margin/Content/CodePanel/Toolbar" unique_id=321395257]
layout_mode = 2
[node name="DocsButton" type="Button" parent="Margin/Content/CodePanel/Toolbar" unique_id=1404920471]
unique_name_in_owner = true
layout_mode = 2
text = "Docs"
flat = true
[node name="VersionLabel" type="Label" parent="Margin/Content/CodePanel/Toolbar" unique_id=630990714]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0.490196)
layout_mode = 2
text = "v2.42.2"
vertical_alignment = 1
[node name="UpdateButton" parent="Margin/Content/CodePanel/Toolbar" unique_id=1595256128 instance=ExtResource("2_ph3vs")]
unique_name_in_owner = true
layout_mode = 2
text = "v2.44.1 available"
[node name="SearchAndReplace" parent="Margin/Content/CodePanel" unique_id=2132004091 instance=ExtResource("6_ylh0t")]
unique_name_in_owner = true
layout_mode = 2
[node name="CodeEdit" parent="Margin/Content/CodePanel" unique_id=302141693 instance=ExtResource("2_f73fm")]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_colors/font_color = Color(0.972549, 0.972549, 0.94902, 1)
theme_override_colors/background_color = Color(0.156863, 0.164706, 0.211765, 1)
theme_override_colors/current_line_color = Color(0.266667, 0.278431, 0.352941, 0.243137)
theme_override_font_sizes/font_size = 14
theme_override_colors/bookmark_color = Color(1, 0.333333, 0.333333, 1)
text = "~ start
Nathan: Hi, I'm Nathan and this is Coco.
Coco: Meow.
Nathan: Here are some response options.
- First one
Nathan: You picked the first one.
- Second one
Nathan: You picked the second one.
- Start again => start
- End the conversation => END
Nathan: I hope this example is helpful.
Coco: Meow.
=> END"
scroll_smooth = true
syntax_highlighter = SubResource("SyntaxHighlighter_mpdoc")
[node name="ErrorsPanel" parent="Margin/Content/CodePanel" unique_id=1975824789 instance=ExtResource("7_5cvl4")]
unique_name_in_owner = true
layout_mode = 2
[node name="Banner" type="CenterContainer" parent="." unique_id=1848328987]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 34.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="PanelContainer" type="VBoxContainer" parent="Banner" unique_id=1211498578]
layout_mode = 2
theme_override_constants/separation = 5
[node name="BannerImage" type="TextureRect" parent="Banner/PanelContainer" unique_id=899616034]
custom_minimum_size = Vector2(600, 200)
layout_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 2
texture = ExtResource("9_y6rqu")
expand_mode = 3
[node name="HBoxContainer" type="HBoxContainer" parent="Banner/PanelContainer" unique_id=874356896]
layout_mode = 2
theme_override_constants/separation = 5
[node name="BannerNewButton" type="Button" parent="Banner/PanelContainer/HBoxContainer" unique_id=1034773049]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "New Dialogue..."
[node name="BannerQuickOpen" type="Button" parent="Banner/PanelContainer/HBoxContainer" unique_id=1614953837]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Quick open..."
[node name="BannerExamples" type="Button" parent="Banner/PanelContainer/HBoxContainer" unique_id=1066745213]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Example projects..."
[node name="NewDialog" type="FileDialog" parent="." unique_id=458925087]
size = Vector2i(900, 750)
min_size = Vector2i(600, 500)
dialog_hide_on_ok = true
filters = PackedStringArray("*.dialogue ; Dialogue")
[node name="SaveDialog" type="FileDialog" parent="." unique_id=325906832]
size = Vector2i(900, 750)
min_size = Vector2i(600, 500)
dialog_hide_on_ok = true
filters = PackedStringArray("*.dialogue ; Dialogue")
[node name="OpenDialog" type="FileDialog" parent="." unique_id=1252768767]
title = "Open a File"
size = Vector2i(900, 750)
min_size = Vector2i(600, 500)
ok_button_text = "Open"
dialog_hide_on_ok = true
file_mode = 0
filters = PackedStringArray("*.dialogue ; Dialogue")
[node name="QuickOpenDialog" type="ConfirmationDialog" parent="." unique_id=254740052]
title = "Quick open"
size = Vector2i(600, 900)
min_size = Vector2i(400, 600)
ok_button_text = "Open"
[node name="QuickOpenFilesList" parent="QuickOpenDialog" unique_id=1813408245 instance=ExtResource("2_npj2k")]
[node name="ExportDialog" type="FileDialog" parent="." unique_id=2035775999]
size = Vector2i(900, 750)
min_size = Vector2i(600, 500)
[node name="ImportDialog" type="FileDialog" parent="." unique_id=1326083376]
title = "Open a File"
size = Vector2i(900, 750)
min_size = Vector2i(600, 500)
ok_button_text = "Open"
file_mode = 0
filters = PackedStringArray("*.csv ; Translation CSV")
[node name="ErrorsDialog" type="AcceptDialog" parent="." unique_id=2100629189]
title = "Error"
dialog_text = "You have errors in your script. Fix them and then try again."
[node name="BuildErrorDialog" type="AcceptDialog" parent="." unique_id=1879686579]
title = "Errors"
dialog_text = "You need to fix dialogue errors before you can run your game."
[node name="CloseConfirmationDialog" type="ConfirmationDialog" parent="." unique_id=1048140490]
title = "Unsaved changes"
ok_button_text = "Save changes"
[node name="UpdatedDialog" type="AcceptDialog" parent="." unique_id=955879802]
title = "Updated"
size = Vector2i(191, 100)
dialog_text = "You're now up to date!"
[node name="GenerateStaticIdsConfirmationDialog" type="ConfirmationDialog" parent="." unique_id=1311101975]
[connection signal="theme_changed" from="." to="." method="_on_main_view_theme_changed"]
[connection signal="visibility_changed" from="." to="." method="_on_main_view_visibility_changed"]
[connection signal="timeout" from="ParseTimer" to="." method="_on_parse_timer_timeout"]
[connection signal="pressed" from="Margin/Content/SidePanel/Toolbar/NewButton" to="." method="_on_new_button_pressed"]
[connection signal="about_to_popup" from="Margin/Content/SidePanel/Toolbar/OpenButton" to="." method="_on_open_button_about_to_popup"]
[connection signal="pressed" from="Margin/Content/SidePanel/Toolbar/SaveAllButton" to="." method="_on_save_all_button_pressed"]
[connection signal="pressed" from="Margin/Content/SidePanel/Toolbar/FindInFilesButton" to="." method="_on_find_in_files_button_pressed"]
[connection signal="file_middle_clicked" from="Margin/Content/SidePanel/Bookmarks/FilesList" to="." method="_on_files_list_file_middle_clicked"]
[connection signal="file_popup_menu_requested" from="Margin/Content/SidePanel/Bookmarks/FilesList" to="." method="_on_files_list_file_popup_menu_requested"]
[connection signal="file_selected" from="Margin/Content/SidePanel/Bookmarks/FilesList" to="." method="_on_files_list_file_selected"]
[connection signal="about_to_popup" from="Margin/Content/SidePanel/Bookmarks/FilesList/FilesPopupMenu" to="." method="_on_files_popup_menu_about_to_popup"]
[connection signal="id_pressed" from="Margin/Content/SidePanel/Bookmarks/FilesList/FilesPopupMenu" to="." method="_on_files_popup_menu_id_pressed"]
[connection signal="title_selected" from="Margin/Content/SidePanel/Bookmarks/TitleList" to="." method="_on_title_list_title_selected"]
[connection signal="toggled" from="Margin/Content/CodePanel/Toolbar/SearchButton" to="." method="_on_search_button_toggled"]
[connection signal="pressed" from="Margin/Content/CodePanel/Toolbar/TestButton" to="." method="_on_test_button_pressed"]
[connection signal="pressed" from="Margin/Content/CodePanel/Toolbar/TestLineButton" to="." method="_on_test_line_button_pressed"]
[connection signal="pressed" from="Margin/Content/CodePanel/Toolbar/SupportButton" to="." method="_on_support_button_pressed"]
[connection signal="pressed" from="Margin/Content/CodePanel/Toolbar/DocsButton" to="." method="_on_docs_button_pressed"]
[connection signal="close_requested" from="Margin/Content/CodePanel/SearchAndReplace" to="." method="_on_search_and_replace_close_requested"]
[connection signal="open_requested" from="Margin/Content/CodePanel/SearchAndReplace" to="." method="_on_search_and_replace_open_requested"]
[connection signal="active_title_change" from="Margin/Content/CodePanel/CodeEdit" to="." method="_on_code_edit_active_title_change"]
[connection signal="caret_changed" from="Margin/Content/CodePanel/CodeEdit" to="." method="_on_code_edit_caret_changed"]
[connection signal="error_clicked" from="Margin/Content/CodePanel/CodeEdit" to="." method="_on_code_edit_error_clicked"]
[connection signal="external_file_requested" from="Margin/Content/CodePanel/CodeEdit" to="." method="_on_code_edit_external_file_requested"]
[connection signal="text_changed" from="Margin/Content/CodePanel/CodeEdit" to="." method="_on_code_edit_text_changed"]
[connection signal="error_pressed" from="Margin/Content/CodePanel/ErrorsPanel" to="." method="_on_errors_panel_error_pressed"]
[connection signal="gui_input" from="Banner/PanelContainer/BannerImage" to="." method="_on_banner_image_gui_input"]
[connection signal="pressed" from="Banner/PanelContainer/HBoxContainer/BannerNewButton" to="." method="_on_banner_new_button_pressed"]
[connection signal="pressed" from="Banner/PanelContainer/HBoxContainer/BannerQuickOpen" to="." method="_on_banner_quick_open_pressed"]
[connection signal="pressed" from="Banner/PanelContainer/HBoxContainer/BannerExamples" to="." method="_on_banner_examples_pressed"]
[connection signal="confirmed" from="NewDialog" to="." method="_on_new_dialog_confirmed"]
[connection signal="file_selected" from="NewDialog" to="." method="_on_new_dialog_file_selected"]
[connection signal="file_selected" from="SaveDialog" to="." method="_on_save_dialog_file_selected"]
[connection signal="file_selected" from="OpenDialog" to="." method="_on_open_dialog_file_selected"]
[connection signal="confirmed" from="QuickOpenDialog" to="." method="_on_quick_open_dialog_confirmed"]
[connection signal="file_double_clicked" from="QuickOpenDialog/QuickOpenFilesList" to="." method="_on_quick_open_files_list_file_double_clicked"]
[connection signal="file_selected" from="ExportDialog" to="." method="_on_export_dialog_file_selected"]
[connection signal="file_selected" from="ImportDialog" to="." method="_on_import_dialog_file_selected"]
[connection signal="confirmed" from="CloseConfirmationDialog" to="." method="_on_close_confirmation_dialog_confirmed"]
[connection signal="custom_action" from="CloseConfirmationDialog" to="." method="_on_close_confirmation_dialog_custom_action"]
[connection signal="confirmed" from="GenerateStaticIdsConfirmationDialog" to="." method="_on_generate_static_ids_confirmation_dialog_confirmed"]