mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-21 08:53:47 +00:00
Updated dialogic
This commit is contained in:
parent
1d11462073
commit
cbb82512ee
483 changed files with 5743 additions and 2177 deletions
|
|
@ -23,9 +23,10 @@ var shortcode_events := {}
|
|||
var custom_syntax_events := []
|
||||
var text_event: DialogicTextEvent = null
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Compile RegEx's
|
||||
completion_word_regex.compile("(?<s>(\\W)|^)(?<word>\\w*)\\x{FFFF}")
|
||||
completion_word_regex.compile(r"(?<s>(\W)|^)(?<word>[\w]*)\x{FFFF}")
|
||||
completion_shortcode_getter_regex.compile("\\[(?<code>\\w*)")
|
||||
completion_shortcode_param_getter_regex.compile("(?<param>\\w*)\\W*=\\s*\"?(\\w|\\s)*"+String.chr(0xFFFF))
|
||||
completion_shortcode_value_regex.compile(r'(\[|\s)[^\[\s=]*="(?<value>[^"$]*)'+String.chr(0xFFFF))
|
||||
|
|
@ -143,25 +144,9 @@ func request_code_completion(force:bool, text:CodeEdit, mode:=Modes.FULL_HIGHLIG
|
|||
|
||||
# suggest values
|
||||
elif symbol == '=' or symbol == '"':
|
||||
var current_parameter_gex := completion_shortcode_param_getter_regex.search(line)
|
||||
if !current_parameter_gex:
|
||||
text.update_code_completion_options(false)
|
||||
return
|
||||
|
||||
var current_parameter := current_parameter_gex.get_string('param')
|
||||
if !shortcode_events[code].get_shortcode_parameters().has(current_parameter):
|
||||
text.update_code_completion_options(false)
|
||||
return
|
||||
if !shortcode_events[code].get_shortcode_parameters()[current_parameter].has('suggestions'):
|
||||
if typeof(shortcode_events[code].get_shortcode_parameters()[current_parameter].default) == TYPE_BOOL:
|
||||
suggest_bool(text, shortcode_events[code].event_color.lerp(syntax_highlighter.normal_color, 0.3))
|
||||
elif len(word) > 0:
|
||||
text.add_code_completion_option(CodeEdit.KIND_VARIABLE, word, word, shortcode_events[code].event_color.lerp(syntax_highlighter.normal_color, 0.3), text.get_theme_icon("GuiScrollArrowRight", "EditorIcons"), '" ')
|
||||
text.update_code_completion_options(true)
|
||||
return
|
||||
|
||||
var suggestions: Dictionary = shortcode_events[code].get_shortcode_parameters()[current_parameter]['suggestions'].call()
|
||||
suggest_custom_suggestions(suggestions, text, shortcode_events[code].event_color.lerp(syntax_highlighter.normal_color, 0.3))
|
||||
suggest_shortcode_values(text, shortcode_events[code], line, word)
|
||||
text.update_code_completion_options(true)
|
||||
return
|
||||
|
||||
# Force update and showing of the popup
|
||||
text.update_code_completion_options(true)
|
||||
|
|
@ -172,7 +157,7 @@ func request_code_completion(force:bool, text:CodeEdit, mode:=Modes.FULL_HIGHLIG
|
|||
if mode == Modes.TEXT_EVENT_ONLY and !event is DialogicTextEvent:
|
||||
continue
|
||||
|
||||
if ! ' ' in line_part:
|
||||
if not ' ' in line_part:
|
||||
event._get_start_code_completion(self, text)
|
||||
|
||||
if event.is_valid_event(line):
|
||||
|
|
@ -182,19 +167,23 @@ func request_code_completion(force:bool, text:CodeEdit, mode:=Modes.FULL_HIGHLIG
|
|||
# Force update and showing of the popup
|
||||
text.update_code_completion_options(true)
|
||||
|
||||
# USEFUL FOR DEBUGGING
|
||||
#print(text.get_code_completion_options().map(func(x):return "{display_text}".format(x)))
|
||||
|
||||
|
||||
|
||||
# Helper that adds all characters as options
|
||||
func suggest_characters(text:CodeEdit, type := CodeEdit.KIND_MEMBER, text_event_start:=false) -> void:
|
||||
func suggest_characters(text:CodeEdit, type := CodeEdit.KIND_MEMBER, event:DialogicEvent=null) -> void:
|
||||
for character in DialogicResourceUtil.get_character_directory():
|
||||
var result: String = character
|
||||
if " " in character:
|
||||
result = '"'+character+'"'
|
||||
if text_event_start and load(DialogicResourceUtil.get_character_directory()[character]).portraits.is_empty():
|
||||
result += ':'
|
||||
if event and event is DialogicTextEvent and load(DialogicResourceUtil.get_character_directory()[character]).portraits.is_empty():
|
||||
result += ': '
|
||||
elif event and event is DialogicCharacterEvent:
|
||||
result += " "
|
||||
text.add_code_completion_option(type, character, result, syntax_highlighter.character_name_color, load("res://addons/dialogic/Editor/Images/Resources/character.svg"))
|
||||
|
||||
|
||||
# Helper that adds all timelines as options
|
||||
func suggest_timelines(text:CodeEdit, type := CodeEdit.KIND_MEMBER, color:=Color()) -> void:
|
||||
for timeline in DialogicResourceUtil.get_timeline_directory():
|
||||
|
|
@ -209,7 +198,7 @@ func suggest_labels(text:CodeEdit, timeline:String='', end:='', color:=Color())
|
|||
|
||||
# Helper that adds all portraits of a given character as options
|
||||
func suggest_portraits(text:CodeEdit, character_name:String, end_check:=')') -> void:
|
||||
if !character_name in DialogicResourceUtil.get_character_directory():
|
||||
if not character_name in DialogicResourceUtil.get_character_directory():
|
||||
return
|
||||
var character_resource: DialogicCharacter = load(DialogicResourceUtil.get_character_directory()[character_name])
|
||||
for portrait in character_resource.portraits:
|
||||
|
|
@ -238,10 +227,30 @@ func suggest_custom_suggestions(suggestions:Dictionary, text:CodeEdit, color:Col
|
|||
text.add_code_completion_option(CodeEdit.KIND_VARIABLE, key, str(suggestions[key].value), color, suggestions[key].get('icon', null), '" ')
|
||||
|
||||
|
||||
# Filters the list of all possible options, depending on what was typed
|
||||
# Purpose of the different Kinds is explained in [_request_code_completion]
|
||||
func suggest_shortcode_values(text:CodeEdit, event:DialogicEvent, line:String, word:String) -> void:
|
||||
var current_parameter_gex := completion_shortcode_param_getter_regex.search(line)
|
||||
if !current_parameter_gex:
|
||||
return
|
||||
|
||||
var current_parameter := current_parameter_gex.get_string('param')
|
||||
if !event.get_shortcode_parameters().has(current_parameter):
|
||||
return
|
||||
if !event.get_shortcode_parameters()[current_parameter].has('suggestions'):
|
||||
if typeof(event.get_shortcode_parameters()[current_parameter].default) == TYPE_BOOL:
|
||||
suggest_bool(text, event.event_color.lerp(syntax_highlighter.normal_color, 0.3))
|
||||
elif len(word) > 0:
|
||||
text.add_code_completion_option(CodeEdit.KIND_VARIABLE, word, word, event.event_color.lerp(syntax_highlighter.normal_color, 0.3), text.get_theme_icon("GuiScrollArrowRight", "EditorIcons"), '" ')
|
||||
return
|
||||
|
||||
var suggestions: Dictionary = event.get_shortcode_parameters()[current_parameter]['suggestions'].call()
|
||||
suggest_custom_suggestions(suggestions, text, event.event_color.lerp(syntax_highlighter.normal_color, 0.3))
|
||||
|
||||
|
||||
## Filters the list of all possible options, depending on what was typed
|
||||
## Purpose of the different Kinds is explained in [_request_code_completion]
|
||||
func filter_code_completion_candidates(candidates:Array, text:CodeEdit) -> Array:
|
||||
var valid_candidates := []
|
||||
|
||||
var current_word := get_code_completion_word(text)
|
||||
for candidate in candidates:
|
||||
if candidate.kind == text.KIND_PLAIN_TEXT:
|
||||
|
|
@ -289,7 +298,7 @@ func confirm_code_completion(replace:bool, text:CodeEdit) -> void:
|
|||
|
||||
if code_completion.has('default_value') and typeof(code_completion['default_value']) == TYPE_STRING:
|
||||
var next_letter := text.get_line(text.get_caret_line()).substr(text.get_caret_column(), len(code_completion['default_value']))
|
||||
if next_letter == code_completion['default_value'] or next_letter[0] == code_completion['default_value'][0]:
|
||||
if next_letter and (next_letter == code_completion['default_value'] or next_letter[0] == code_completion['default_value'][0]):
|
||||
text.set_caret_column(text.get_caret_column()+1)
|
||||
else:
|
||||
text.insert_text_at_caret(code_completion['default_value'])
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
uid://b60na7qjgkmaa
|
||||
uid://camdhr6iwaywr
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ var mode := Modes.FULL_HIGHLIGHTING
|
|||
var word_regex := RegEx.new()
|
||||
var region_regex := RegEx.new()
|
||||
var number_regex := RegEx.create_from_string(r"(\d|\.)+")
|
||||
var shortcode_regex := RegEx.create_from_string(r"\W*\[(?<id>\w*)(?<args>[^\]]*)?")
|
||||
var shortcode_regex := RegEx.create_from_string(r'\W*\[(?<id>\w*)(?<args>([^\]"]|"[^"]*")*)?')
|
||||
var shortcode_param_regex := RegEx.create_from_string(r'((?<parameter>[^\s=]*)\s*=\s*"(?<value>([^=]|\\=)*)(?<!\\)")')
|
||||
|
||||
## Colors
|
||||
|
|
@ -179,9 +179,10 @@ func color_region(dict:Dictionary, color:Color, line:String, start:String, end:S
|
|||
end = "\\"+end
|
||||
|
||||
if end.is_empty():
|
||||
region_regex.compile("(?<!\\\\)"+start+".*")
|
||||
region_regex.compile(r"(?<!\\)"+start+".*")
|
||||
else:
|
||||
region_regex.compile("(?<!\\\\)"+start+"((?!"+end+").)*"+end)
|
||||
r"(?<!\\){([^{}]|({[^}]*}))*}"
|
||||
region_regex.compile(r"(?<!\\)"+start+"([^"+start+end+"]|("+start+"[^"+end+"]*"+end+"))*"+end)
|
||||
if to <= from:
|
||||
to = len(line)-1
|
||||
for region in region_regex.search_all(line.substr(from, to-from+2)):
|
||||
|
|
@ -199,3 +200,13 @@ func color_shortcode_content(dict:Dictionary, line:String, from:int = 0, to:int
|
|||
dict[x.get_start('value')+from-1] = {"color":base_color.lerp(normal_color, 0.7)}
|
||||
dict[x.get_end()+from] = {"color":normal_color}
|
||||
return dict
|
||||
|
||||
|
||||
func dict_get_color_at_column(dict:Dictionary, column:int) -> Color:
|
||||
var prev_idx := -1
|
||||
for i in dict:
|
||||
if i > prev_idx and i <= column:
|
||||
prev_idx = i
|
||||
if prev_idx != -1:
|
||||
return dict[prev_idx].color
|
||||
return normal_color
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
uid://ccjw4fyc586j1
|
||||
uid://bf2nivn8txcw5
|
||||
|
|
|
|||
|
|
@ -4,15 +4,19 @@ extends CodeEdit
|
|||
## Sub-Editor that allows editing timelines in a text format.
|
||||
|
||||
@onready var timeline_editor := get_parent().get_parent()
|
||||
@onready var code_completion_helper: Node= find_parent('EditorsManager').get_node('CodeCompletionHelper')
|
||||
@onready var code_completion_helper: Node = find_parent('EditorsManager').get_node('CodeCompletionHelper')
|
||||
|
||||
var label_regex := RegEx.create_from_string('label +(?<name>[^\n]+)')
|
||||
var channel_regex := RegEx.create_from_string(r'audio +(?<channel>[\w-]{2,}|[\w]+)')
|
||||
|
||||
func _ready() -> void:
|
||||
await find_parent('EditorView').ready
|
||||
syntax_highlighter = code_completion_helper.syntax_highlighter
|
||||
timeline_editor.editors_manager.sidebar.content_item_activated.connect(_on_content_item_clicked)
|
||||
|
||||
get_menu().add_icon_item(get_theme_icon("PlayStart", "EditorIcons"), "Play from here", 42)
|
||||
get_menu().id_pressed.connect(_on_context_menu_id_pressed)
|
||||
|
||||
|
||||
func _on_text_editor_text_changed() -> void:
|
||||
timeline_editor.current_resource_state = DialogicEditor.ResourceStates.UNSAVED
|
||||
|
|
@ -72,22 +76,52 @@ func text_timeline_to_array(text:String) -> Array:
|
|||
## HELPFUL EDITOR FUNCTIONALITY
|
||||
################################################################################
|
||||
|
||||
func _on_context_menu_id_pressed(id:int) -> void:
|
||||
if id == 42:
|
||||
play_from_here()
|
||||
|
||||
|
||||
func play_from_here() -> void:
|
||||
timeline_editor.play_timeline(timeline_editor.current_resource.get_index_from_text_line(text, get_caret_line()))
|
||||
|
||||
|
||||
func _gui_input(event):
|
||||
if not event is InputEventKey: return
|
||||
if not event.is_pressed(): return
|
||||
match event.as_text():
|
||||
"Ctrl+K":
|
||||
"Ctrl+K", "Ctrl+Slash":
|
||||
toggle_comment()
|
||||
# TODO clean this up when dropping 4.2 support
|
||||
"Alt+Up":
|
||||
move_line(-1)
|
||||
if has_method("move_lines_up"):
|
||||
call("move_lines_up")
|
||||
"Alt+Down":
|
||||
move_line(1)
|
||||
"Ctrl+Shift+D":
|
||||
duplicate_line()
|
||||
if has_method("move_lines_down"):
|
||||
call("move_lines_down")
|
||||
|
||||
"Ctrl+Shift+D", "Ctrl+D":
|
||||
duplicate_lines()
|
||||
|
||||
"Ctrl+F6" when OS.get_name() != "macOS": # Play from here
|
||||
play_from_here()
|
||||
"Ctrl+Shift+B" when OS.get_name() == "macOS": # Play from here
|
||||
play_from_here()
|
||||
"Enter":
|
||||
if get_code_completion_options():
|
||||
return
|
||||
for caret in range(get_caret_count()):
|
||||
var line := get_line(get_caret_line(caret)).strip_edges()
|
||||
var event_res := DialogicTimeline.event_from_string(line, DialogicResourceUtil.get_event_cache())
|
||||
var indent_format: String = timeline_editor.current_resource.indent_format
|
||||
if event_res.can_contain_events:
|
||||
insert_text_at_caret("\n"+indent_format.repeat(get_indent_level(get_caret_line(caret))/4+1), caret)
|
||||
else:
|
||||
insert_text_at_caret("\n"+indent_format.repeat(get_indent_level(get_caret_line(caret))/4), caret)
|
||||
_:
|
||||
return
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
|
||||
# Toggle the selected lines as comments
|
||||
func toggle_comment() -> void:
|
||||
var cursor: Vector2 = Vector2(get_caret_column(), get_caret_line())
|
||||
|
|
@ -127,78 +161,27 @@ func toggle_comment() -> void:
|
|||
text_changed.emit()
|
||||
|
||||
|
||||
# Move the selected lines up or down
|
||||
func move_line(offset: int) -> void:
|
||||
offset = clamp(offset, -1, 1)
|
||||
|
||||
var cursor: Vector2 = Vector2(get_caret_column(), get_caret_line())
|
||||
var reselect: bool = false
|
||||
var from: int = cursor.y
|
||||
var to: int = cursor.y
|
||||
if has_selection():
|
||||
reselect = true
|
||||
from = get_selection_from_line()
|
||||
to = get_selection_to_line()
|
||||
|
||||
var lines := text.split("\n")
|
||||
|
||||
if from + offset < 0 or to + offset >= lines.size(): return
|
||||
|
||||
var target_from_index: int = from - 1 if offset == -1 else to + 1
|
||||
var target_to_index: int = to if offset == -1 else from
|
||||
var line_to_move: String = lines[target_from_index]
|
||||
lines.remove_at(target_from_index)
|
||||
lines.insert(target_to_index, line_to_move)
|
||||
|
||||
text = "\n".join(lines)
|
||||
|
||||
cursor.y += offset
|
||||
from += offset
|
||||
to += offset
|
||||
if reselect:
|
||||
select(from, 0, to, get_line_width(to))
|
||||
set_caret_line(cursor.y)
|
||||
set_caret_column(cursor.x)
|
||||
text_changed.emit()
|
||||
|
||||
|
||||
func duplicate_line() -> void:
|
||||
var cursor: Vector2 = Vector2(get_caret_column(), get_caret_line())
|
||||
var from: int = cursor.y
|
||||
var to: int = cursor.y+1
|
||||
if has_selection():
|
||||
from = get_selection_from_line()
|
||||
to = get_selection_to_line()+1
|
||||
|
||||
var lines := text.split("\n")
|
||||
var lines_to_dupl: PackedStringArray = lines.slice(from, to)
|
||||
|
||||
text = "\n".join(lines.slice(0, from)+lines_to_dupl+lines.slice(from))
|
||||
|
||||
set_caret_line(cursor.y+to-from)
|
||||
set_caret_column(cursor.x)
|
||||
text_changed.emit()
|
||||
|
||||
|
||||
# Allows dragging files into the editor
|
||||
## Allows dragging files into the editor
|
||||
func _can_drop_data(at_position:Vector2, data:Variant) -> bool:
|
||||
if typeof(data) == TYPE_DICTIONARY and 'files' in data.keys() and len(data.files) == 1:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
# Allows dragging files into the editor
|
||||
## Allows dragging files into the editor
|
||||
func _drop_data(at_position:Vector2, data:Variant) -> void:
|
||||
if typeof(data) == TYPE_DICTIONARY and 'files' in data.keys() and len(data.files) == 1:
|
||||
set_caret_column(get_line_column_at_pos(at_position).x)
|
||||
set_caret_line(get_line_column_at_pos(at_position).y)
|
||||
var result: String = data.files[0]
|
||||
if get_line(get_caret_line())[get_caret_column()-1] != '"':
|
||||
var line := get_line(get_caret_line())
|
||||
if line[get_caret_column()-1] != '"':
|
||||
result = '"'+result
|
||||
if get_line(get_caret_line())[get_caret_column()] != '"':
|
||||
if line.length() == get_caret_column() or line[get_caret_column()] != '"':
|
||||
result = result+'"'
|
||||
|
||||
insert_text_at_caret(result)
|
||||
grab_focus()
|
||||
|
||||
|
||||
func _on_update_timer_timeout() -> void:
|
||||
|
|
@ -211,6 +194,11 @@ func update_content_list() -> void:
|
|||
labels.append(i.get_string('name'))
|
||||
timeline_editor.editors_manager.sidebar.update_content_list(labels)
|
||||
|
||||
var channels: PackedStringArray = []
|
||||
for i in channel_regex.search_all(text):
|
||||
channels.append(i.get_string('channel'))
|
||||
timeline_editor.update_audio_channel_cache(channels)
|
||||
|
||||
|
||||
func _on_content_item_clicked(label:String) -> void:
|
||||
if label == "~ Top":
|
||||
|
|
@ -227,12 +215,23 @@ func _on_content_item_clicked(label:String) -> void:
|
|||
return
|
||||
|
||||
|
||||
func _search_timeline(search_text:String) -> bool:
|
||||
set_search_text(search_text)
|
||||
queue_redraw()
|
||||
func _search_timeline(search_text:String, match_case := false, whole_words := false) -> bool:
|
||||
var flags := 0
|
||||
if match_case:
|
||||
flags = flags | SEARCH_MATCH_CASE
|
||||
if whole_words:
|
||||
flags = flags | SEARCH_WHOLE_WORDS
|
||||
set_meta("current_search", search_text)
|
||||
set_meta("current_search_flags", flags)
|
||||
|
||||
return search(search_text, 0, 0, 0).y != -1
|
||||
set_search_text(search_text)
|
||||
set_search_flags(flags)
|
||||
queue_redraw()
|
||||
|
||||
var result := search(search_text, flags, get_selection_from_line(), get_selection_from_column())
|
||||
if result.y != -1:
|
||||
select.call_deferred(result.y, result.x, result.y, result.x + search_text.length())
|
||||
return result.y != -1
|
||||
|
||||
|
||||
func _search_navigate_down() -> void:
|
||||
|
|
@ -244,8 +243,18 @@ func _search_navigate_up() -> void:
|
|||
|
||||
|
||||
func search_navigate(navigate_up := false) -> void:
|
||||
if not has_meta("current_search"):
|
||||
var pos := get_next_search_position(navigate_up)
|
||||
if pos.x == -1:
|
||||
return
|
||||
select(pos.y, pos.x, pos.y, pos.x+len(get_meta("current_search")))
|
||||
set_caret_line(pos.y)
|
||||
center_viewport_to_caret()
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func get_next_search_position(navigate_up := false) -> Vector2i:
|
||||
if not has_meta("current_search"):
|
||||
return Vector2i(-1, -1)
|
||||
var pos: Vector2i
|
||||
var search_from_line := 0
|
||||
var search_from_column := 0
|
||||
|
|
@ -266,30 +275,75 @@ func search_navigate(navigate_up := false) -> void:
|
|||
search_from_line = get_caret_line()
|
||||
search_from_column = get_caret_column()
|
||||
|
||||
pos = search(get_meta("current_search"), 4 if navigate_up else 0, search_from_line, search_from_column)
|
||||
select(pos.y, pos.x, pos.y, pos.x+len(get_meta("current_search")))
|
||||
var flags: int = get_meta("current_search_flags", 0)
|
||||
if navigate_up:
|
||||
flags = flags | SEARCH_BACKWARDS
|
||||
|
||||
pos = search(get_meta("current_search"), flags, search_from_line, search_from_column)
|
||||
return pos
|
||||
|
||||
|
||||
func replace(replace_text:String) -> void:
|
||||
if has_selection():
|
||||
set_caret_line(get_selection_from_line())
|
||||
set_caret_column(get_selection_from_column())
|
||||
|
||||
var pos := get_next_search_position()
|
||||
if pos.x == -1:
|
||||
return
|
||||
|
||||
if not has_meta("current_search"):
|
||||
return
|
||||
|
||||
begin_complex_operation()
|
||||
insert_text("@@", pos.y, pos.x)
|
||||
if get_meta("current_search_flags") & SEARCH_MATCH_CASE:
|
||||
text = text.replace("@@"+get_meta("current_search"), replace_text)
|
||||
else:
|
||||
text = text.replacen("@@"+get_meta("current_search"), replace_text)
|
||||
end_complex_operation()
|
||||
|
||||
set_caret_line(pos.y)
|
||||
center_viewport_to_caret()
|
||||
queue_redraw()
|
||||
set_caret_column(pos.x)
|
||||
|
||||
timeline_editor.replace_in_timeline()
|
||||
|
||||
|
||||
func replace_all(replace_text:String) -> void:
|
||||
begin_complex_operation()
|
||||
var next_pos := get_next_search_position()
|
||||
var counter := 0
|
||||
while next_pos.y != -1:
|
||||
insert_text("@@", next_pos.y, next_pos.x)
|
||||
if get_meta("current_search_flags") & SEARCH_MATCH_CASE:
|
||||
text = text.replace("@@"+get_meta("current_search"), replace_text)
|
||||
else:
|
||||
text = text.replacen("@@"+get_meta("current_search"), replace_text)
|
||||
next_pos = get_next_search_position()
|
||||
set_caret_line(next_pos.y)
|
||||
set_caret_column(next_pos.x)
|
||||
end_complex_operation()
|
||||
|
||||
timeline_editor.replace_in_timeline()
|
||||
|
||||
|
||||
################################################################################
|
||||
## AUTO COMPLETION
|
||||
################################################################################
|
||||
|
||||
# Called if something was typed
|
||||
## Called if something was typed
|
||||
func _request_code_completion(force:bool):
|
||||
code_completion_helper.request_code_completion(force, self)
|
||||
|
||||
|
||||
# Filters the list of all possible options, depending on what was typed
|
||||
# Purpose of the different Kinds is explained in [_request_code_completion]
|
||||
## Filters the list of all possible options, depending on what was typed
|
||||
## Purpose of the different Kinds is explained in [_request_code_completion]
|
||||
func _filter_code_completion_candidates(candidates:Array) -> Array:
|
||||
return code_completion_helper.filter_code_completion_candidates(candidates, self)
|
||||
|
||||
|
||||
# Called when code completion was activated
|
||||
# Inserts the selected item
|
||||
## Called when code completion was activated
|
||||
## Inserts the selected item
|
||||
func _confirm_code_completion(replace:bool) -> void:
|
||||
code_completion_helper.confirm_code_completion(replace, self)
|
||||
|
||||
|
|
@ -298,11 +352,11 @@ func _confirm_code_completion(replace:bool) -> void:
|
|||
## SYMBOL CLICKING
|
||||
################################################################################
|
||||
|
||||
# Performs an action (like opening a link) when a valid symbol was clicked
|
||||
## Performs an action (like opening a link) when a valid symbol was clicked
|
||||
func _on_symbol_lookup(symbol, line, column):
|
||||
code_completion_helper.symbol_lookup(symbol, line, column)
|
||||
|
||||
|
||||
# Called to test if a symbol can be clicked
|
||||
## Called to test if a symbol can be clicked
|
||||
func _on_symbol_validate(symbol:String) -> void:
|
||||
code_completion_helper.symbol_validate(symbol, self)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
uid://ckdcx4qnilpv1
|
||||
uid://dshp0vy2xrxv
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://defdeav8rli6o"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ckdcx4qnilpv1" path="res://addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.gd" id="1_1kbx2"]
|
||||
[ext_resource type="Script" uid="uid://dshp0vy2xrxv" path="res://addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.gd" id="1_1kbx2"]
|
||||
|
||||
[node name="TimelineTextEditor" type="CodeEdit"]
|
||||
offset_top = 592.0
|
||||
offset_right = 1024.0
|
||||
offset_bottom = 600.0
|
||||
theme_override_constants/line_spacing = 10
|
||||
wrap_mode = 1
|
||||
highlight_current_line = true
|
||||
draw_tabs = true
|
||||
minimap_draw = true
|
||||
caret_blink = true
|
||||
highlight_current_line = true
|
||||
draw_tabs = true
|
||||
symbol_lookup_on_click = true
|
||||
line_folding = true
|
||||
gutters_draw_line_numbers = true
|
||||
gutters_draw_fold_gutter = true
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
uid://ckqar2hsatqrt
|
||||
uid://dofrrscd4c61l
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://depcrpeh3f4rv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ckqar2hsatqrt" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.gd" id="1_s43sc"]
|
||||
[ext_resource type="Script" uid="uid://dofrrscd4c61l" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.gd" id="1_s43sc"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qx31r"]
|
||||
content_margin_left = 4.0
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
uid://b1y8xx4okklym
|
||||
uid://b6ka2avnh1u55
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ signal timeline_loaded
|
|||
################################################################################
|
||||
var _batches := []
|
||||
var _building_timeline := false
|
||||
var _timeline_changed_while_loading := false
|
||||
var _cancel_loading := false
|
||||
var _initialized := false
|
||||
|
||||
################## TIMELINE EVENT MANAGEMENT ###################################
|
||||
|
|
@ -75,11 +75,8 @@ func _notification(what:int) -> void:
|
|||
|
||||
|
||||
func load_timeline(resource:DialogicTimeline) -> void:
|
||||
if _building_timeline:
|
||||
_timeline_changed_while_loading = true
|
||||
await batch_loaded
|
||||
_timeline_changed_while_loading = false
|
||||
_building_timeline = false
|
||||
# In case another timeline is still loading
|
||||
cancel_loading()
|
||||
|
||||
clear_timeline_nodes()
|
||||
|
||||
|
|
@ -99,11 +96,24 @@ func load_timeline(resource:DialogicTimeline) -> void:
|
|||
while batch_events(data, batch_size, page).size() != 0:
|
||||
_batches.append(batch_events(data, batch_size, page))
|
||||
page += 1
|
||||
set_meta("batch_count", len(_batches))
|
||||
batch_loaded.emit()
|
||||
# Reset the scroll position
|
||||
%TimelineArea.scroll_vertical = 0
|
||||
|
||||
|
||||
func is_loading_timeline() -> bool:
|
||||
return _building_timeline
|
||||
|
||||
func cancel_loading() -> void:
|
||||
timeline_editor.set_progress(1)
|
||||
if _building_timeline:
|
||||
_cancel_loading = true
|
||||
await batch_loaded
|
||||
_cancel_loading = false
|
||||
_building_timeline = false
|
||||
|
||||
|
||||
func batch_events(array: Array, size: int, batch_number: int) -> Array:
|
||||
return array.slice((batch_number - 1) * size, batch_number * size)
|
||||
|
||||
|
|
@ -127,19 +137,27 @@ func load_batch(data:Array) -> void:
|
|||
|
||||
|
||||
func _on_batch_loaded() -> void:
|
||||
if _timeline_changed_while_loading:
|
||||
if _cancel_loading:
|
||||
return
|
||||
|
||||
if _batches.size() > 0:
|
||||
indent_events()
|
||||
var progress: float = 1-(1.0/get_meta("batch_count")*len(_batches))
|
||||
timeline_editor.set_progress(progress)
|
||||
await get_tree().process_frame
|
||||
load_batch(_batches)
|
||||
return
|
||||
|
||||
# This hides the progress bar again
|
||||
timeline_editor.set_progress(1)
|
||||
|
||||
if opener_events_stack:
|
||||
for ev in opener_events_stack:
|
||||
if is_instance_valid(ev):
|
||||
create_end_branch_event(%Timeline.get_child_count(), ev)
|
||||
|
||||
timeline_loaded.emit()
|
||||
|
||||
opener_events_stack = []
|
||||
indent_events()
|
||||
update_content_list()
|
||||
|
|
@ -195,7 +213,7 @@ func load_event_buttons() -> void:
|
|||
var button_scene := load("res://addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.tscn")
|
||||
|
||||
var scripts := DialogicResourceUtil.get_event_cache()
|
||||
var hidden_buttons :Array = DialogicUtil.get_editor_setting('hidden_event_buttons', [])
|
||||
var hidden_buttons: Array = DialogicUtil.get_editor_setting('hidden_event_buttons', [])
|
||||
var sections := {}
|
||||
|
||||
for event_script in scripts:
|
||||
|
|
@ -283,6 +301,7 @@ func update_content_list() -> void:
|
|||
if not is_inside_tree():
|
||||
return
|
||||
|
||||
var channels: PackedStringArray = []
|
||||
var labels: PackedStringArray = []
|
||||
|
||||
for event in %Timeline.get_children():
|
||||
|
|
@ -290,7 +309,12 @@ func update_content_list() -> void:
|
|||
if 'event_name' in event.resource and event.resource is DialogicLabelEvent:
|
||||
labels.append(event.resource.name)
|
||||
|
||||
if 'event_name' in event.resource and event.resource is DialogicAudioEvent:
|
||||
if not event.resource.channel_name in channels:
|
||||
channels.append(event.resource.channel_name)
|
||||
|
||||
timeline_editor.editors_manager.sidebar.update_content_list(labels)
|
||||
timeline_editor.update_audio_channel_cache(channels)
|
||||
|
||||
|
||||
#endregion
|
||||
|
|
@ -312,6 +336,11 @@ func _on_event_block_gui_input(event: InputEvent, item: Node) -> void:
|
|||
|
||||
drag_allowed = true
|
||||
|
||||
if event.is_released() and not %TimelineArea.dragging and not Input.is_key_pressed(KEY_SHIFT):
|
||||
if len(selected_items) > 1 and item in selected_items and not Input.is_key_pressed(KEY_CTRL):
|
||||
deselect_all_items()
|
||||
select_item(item)
|
||||
|
||||
if len(selected_items) > 0 and event is InputEventMouseMotion:
|
||||
if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT):
|
||||
if !%TimelineArea.dragging and !get_viewport().gui_is_dragging() and drag_allowed:
|
||||
|
|
@ -357,6 +386,8 @@ func add_event_node(event_resource:DialogicEvent, at_index:int = -1, auto_select
|
|||
|
||||
if event_resource.event_name == "Label":
|
||||
block.content_changed.connect(update_content_list)
|
||||
if event_resource.event_name == "Audio":
|
||||
block.content_changed.connect(update_content_list)
|
||||
if at_index == -1:
|
||||
if len(selected_items) != 0:
|
||||
selected_items[0].add_sibling(block)
|
||||
|
|
@ -387,7 +418,7 @@ func create_end_branch_event(at_index:int, parent_node:Node) -> Node:
|
|||
end_branch_event.gui_input.connect(_on_event_block_gui_input.bind(end_branch_event))
|
||||
parent_node.end_node = end_branch_event
|
||||
end_branch_event.parent_node = parent_node
|
||||
end_branch_event.add_end_control(parent_node.resource.get_end_branch_control())
|
||||
end_branch_event.add_end_control(parent_node.resource._get_end_branch_control())
|
||||
%Timeline.add_child(end_branch_event)
|
||||
%Timeline.move_child(end_branch_event, at_index)
|
||||
return end_branch_event
|
||||
|
|
@ -425,12 +456,12 @@ func get_events_indexed(events:Array) -> Dictionary:
|
|||
if event.resource is DialogicEndBranchEvent:
|
||||
continue
|
||||
|
||||
indexed_dict[event.get_index()] = event.resource.to_text()
|
||||
indexed_dict[event.get_index()] = event.resource._store_as_string()
|
||||
|
||||
# store an end branch if it is selected or connected to a selected event
|
||||
if 'end_node' in event and event.end_node:
|
||||
event = event.end_node
|
||||
indexed_dict[event.get_index()] = event.resource.to_text()
|
||||
indexed_dict[event.get_index()] = event.resource._store_as_string()
|
||||
elif event.resource is DialogicEndBranchEvent:
|
||||
if event.parent_node in events: # add local index
|
||||
indexed_dict[event.get_index()] += str(events.find(event.parent_node))
|
||||
|
|
@ -465,13 +496,13 @@ func add_events_indexed(indexed_events:Dictionary) -> void:
|
|||
var events := []
|
||||
for event_idx in indexes:
|
||||
# first get a new resource from the text version
|
||||
var event_resource :DialogicEvent
|
||||
var event_resource: DialogicEvent
|
||||
for i in DialogicResourceUtil.get_event_cache():
|
||||
if i._test_event_string(indexed_events[event_idx]):
|
||||
event_resource = i.duplicate()
|
||||
break
|
||||
|
||||
event_resource.from_text(indexed_events[event_idx])
|
||||
event_resource._load_from_string(indexed_events[event_idx])
|
||||
|
||||
# now create the visual block.
|
||||
deselect_all_items()
|
||||
|
|
@ -540,14 +571,16 @@ func copy_selected_events() -> void:
|
|||
if len(selected_items) == 0:
|
||||
return
|
||||
|
||||
sort_selection()
|
||||
var event_copy_array := []
|
||||
for item in selected_items:
|
||||
event_copy_array.append(item.resource.to_text())
|
||||
event_copy_array.append(item.resource._store_as_string())
|
||||
if item.resource is DialogicEndBranchEvent:
|
||||
if item.parent_node in selected_items: # add local index
|
||||
event_copy_array[-1] += str(selected_items.find(item.parent_node))
|
||||
else: # add global index
|
||||
event_copy_array[-1] += '#'+str(item.parent_node.get_index())
|
||||
|
||||
DisplayServer.clipboard_set(var_to_str({
|
||||
"events":event_copy_array,
|
||||
"project_name": ProjectSettings.get_setting("application/config/name")
|
||||
|
|
@ -905,25 +938,30 @@ func indent_events() -> void:
|
|||
#region SPECIAL BLOCK OPERATIONS
|
||||
################################################################################
|
||||
|
||||
func _on_event_popup_menu_index_pressed(index:int) -> void:
|
||||
func _on_event_popup_menu_id_pressed(id:int) -> void:
|
||||
var item: Control = %EventPopupMenu.current_event
|
||||
if index == 0:
|
||||
if id == 0:
|
||||
if not item in selected_items:
|
||||
selected_items = [item]
|
||||
duplicate_selected()
|
||||
elif index == 2:
|
||||
|
||||
elif id == 1:
|
||||
play_from_here(%EventPopupMenu.current_event.get_index())
|
||||
|
||||
elif id == 2:
|
||||
if not item.resource.help_page_path.is_empty():
|
||||
OS.shell_open(item.resource.help_page_path)
|
||||
elif index == 3:
|
||||
|
||||
elif id == 3:
|
||||
find_parent('EditorView').plugin_reference.get_editor_interface().set_main_screen_editor('Script')
|
||||
find_parent('EditorView').plugin_reference.get_editor_interface().edit_script(item.resource.get_script(), 1, 1)
|
||||
elif index == 5 or index == 6:
|
||||
if index == 5:
|
||||
elif id == 4 or id == 5:
|
||||
if id == 4:
|
||||
offset_blocks_by_index(selected_items, -1)
|
||||
else:
|
||||
offset_blocks_by_index(selected_items, +1)
|
||||
|
||||
elif index == 8:
|
||||
elif id == 6:
|
||||
var events_indexed : Dictionary
|
||||
if item in selected_items:
|
||||
events_indexed = get_events_indexed(selected_items)
|
||||
|
|
@ -936,6 +974,12 @@ func _on_event_popup_menu_index_pressed(index:int) -> void:
|
|||
indent_events()
|
||||
|
||||
|
||||
func play_from_here(index:=-1) -> void:
|
||||
if index == -1:
|
||||
if not selected_items.is_empty():
|
||||
index = selected_items[0].get_index()
|
||||
timeline_editor.play_timeline(index)
|
||||
|
||||
func _on_right_sidebar_resized() -> void:
|
||||
var _scale := DialogicUtil.get_editor_scale()
|
||||
|
||||
|
|
@ -1045,6 +1089,11 @@ func _input(event:InputEvent) -> void:
|
|||
_add_event_button_pressed(DialogicLabelEvent.new(), true)
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
"Ctrl+F6" when OS.get_name() != "macOS": # Play from here
|
||||
play_from_here()
|
||||
"Ctrl+Shift+B" when OS.get_name() == "macOS": # Play from here
|
||||
play_from_here()
|
||||
|
||||
## Some shortcuts should be disabled when writing text.
|
||||
var focus_owner: Control = get_viewport().gui_get_focus_owner()
|
||||
if focus_owner is TextEdit or focus_owner is LineEdit or (focus_owner is Button and focus_owner.get_parent_control().name == "Spin"):
|
||||
|
|
@ -1099,16 +1148,17 @@ func _input(event:InputEvent) -> void:
|
|||
get_viewport().set_input_as_handled()
|
||||
|
||||
"Ctrl+C":
|
||||
select_events_indexed(get_events_indexed(selected_items))
|
||||
copy_selected_events()
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
"Ctrl+V":
|
||||
var events_list := get_clipboard_data()
|
||||
var paste_position := -1
|
||||
var paste_position := 0
|
||||
if selected_items:
|
||||
paste_position = selected_items[-1].get_index()+1
|
||||
else:
|
||||
paste_position = %Timeline.get_child_count()-1
|
||||
paste_position = %Timeline.get_child_count()
|
||||
if events_list:
|
||||
TimelineUndoRedo.create_action("[D] Pasting "+str(len(events_list))+" event(s).")
|
||||
TimelineUndoRedo.add_do_method(add_events_at_index.bind(events_list, paste_position))
|
||||
|
|
@ -1178,23 +1228,37 @@ func get_previous_character(double_previous := false) -> DialogicCharacter:
|
|||
################################################################################
|
||||
|
||||
var search_results := {}
|
||||
func _search_timeline(search_text:String) -> bool:
|
||||
for event in search_results:
|
||||
if is_instance_valid(search_results[event]):
|
||||
search_results[event].set_search_text("")
|
||||
search_results[event].deselect()
|
||||
search_results[event].queue_redraw()
|
||||
func _search_timeline(search_text:String, match_case := false, whole_words := false) -> bool:
|
||||
var flags := 0
|
||||
if match_case:
|
||||
flags = flags | TextEdit.SEARCH_MATCH_CASE
|
||||
if whole_words:
|
||||
flags = flags | TextEdit.SEARCH_WHOLE_WORDS
|
||||
|
||||
search_results.clear()
|
||||
|
||||
# This checks all text events for whether they contain the text.
|
||||
# If so, the text field is stored in search_results
|
||||
# which is later used to navigate through only the relevant text fields.
|
||||
|
||||
for block in %Timeline.get_children():
|
||||
if block.resource is DialogicTextEvent:
|
||||
var text_field: TextEdit = block.get_node("%BodyContent").find_child("Field_Text_Multiline", true, false)
|
||||
var text_field: TextEdit = block.get_field_node("text")
|
||||
|
||||
text_field.deselect()
|
||||
text_field.set_search_text(search_text)
|
||||
if text_field.search(search_text, 0, 0, 0).x != -1:
|
||||
text_field.set_search_flags(flags)
|
||||
|
||||
if text_field.search(search_text, flags, 0, 0).x != -1:
|
||||
search_results[block] = text_field
|
||||
text_field.queue_redraw()
|
||||
|
||||
text_field.queue_redraw()
|
||||
|
||||
set_meta("current_search", search_text)
|
||||
set_meta("current_search_flags", flags)
|
||||
|
||||
search_navigate(false)
|
||||
|
||||
return not search_results.is_empty()
|
||||
|
||||
|
||||
|
|
@ -1207,25 +1271,61 @@ func _search_navigate_up() -> void:
|
|||
|
||||
|
||||
func search_navigate(navigate_up := false) -> void:
|
||||
var next_pos := get_next_search_position(navigate_up)
|
||||
if next_pos:
|
||||
var event: Node = next_pos[0]
|
||||
var field: TextEdit = next_pos[1]
|
||||
var result: Vector2i = next_pos[2]
|
||||
if not event in selected_items:
|
||||
select_item(next_pos[0], false)
|
||||
%TimelineArea.ensure_control_visible(event)
|
||||
event._on_ToggleBodyVisibility_toggled(true)
|
||||
field.call_deferred("select", result.y, result.x, result.y, result.x+len(get_meta("current_search")))
|
||||
|
||||
|
||||
func get_next_search_position(navigate_up:= false, include_current := false) -> Array:
|
||||
var search_text: String = get_meta("current_search", "")
|
||||
var search_flags: int = get_meta("current_search_flags", 0)
|
||||
|
||||
if search_results.is_empty() or %Timeline.get_child_count() == 0:
|
||||
return
|
||||
if selected_items.is_empty():
|
||||
select_item(%Timeline.get_child(0), false)
|
||||
return []
|
||||
|
||||
# We start the search on the selected item,
|
||||
# so these checks make sure something sensible is selected
|
||||
|
||||
# Try to select the event that has focus
|
||||
if get_viewport().gui_get_focus_owner() is TextEdit and get_viewport().gui_get_focus_owner() is DialogicVisualEditorField:
|
||||
select_item(get_viewport().gui_get_focus_owner().event_resource.editor_node, false)
|
||||
get_viewport().gui_get_focus_owner().deselect()
|
||||
|
||||
# Select the first event if nothing is selected
|
||||
if selected_items.is_empty():
|
||||
select_item(search_results.keys()[0], false)
|
||||
|
||||
# Loop to the next event that where something was found
|
||||
if not selected_items[0] in search_results:
|
||||
var index: int = selected_items[0].get_index()
|
||||
while not %Timeline.get_child(index) in search_results:
|
||||
index = wrapi(index+1, 0, %Timeline.get_child_count()-1)
|
||||
select_item(%Timeline.get_child(index), false)
|
||||
|
||||
while not selected_items[0] in search_results:
|
||||
select_item(%Timeline.get_child(wrapi(selected_items[0].get_index()+1, 0, %Timeline.get_child_count()-1)), false)
|
||||
|
||||
var event: Node = selected_items[0]
|
||||
var counter := 0
|
||||
var first := true
|
||||
while true:
|
||||
counter += 1
|
||||
var field: TextEdit = search_results[event]
|
||||
field.queue_redraw()
|
||||
var result := search_text_field(field, search_text, navigate_up)
|
||||
|
||||
# First locates the next result in this field
|
||||
var result := search_text_field(field, search_text, search_flags, navigate_up, first and include_current)
|
||||
var current_line := field.get_selection_from_line() if field.has_selection() else -1
|
||||
var current_column := field.get_selection_from_column() if field.has_selection() else -1
|
||||
|
||||
first = false
|
||||
|
||||
# Determines if the found result is valid or navigation should continue into the next event
|
||||
var next_is_in_this_event := false
|
||||
if result.y == -1:
|
||||
next_is_in_this_event = false
|
||||
|
|
@ -1234,28 +1334,27 @@ func search_navigate(navigate_up := false) -> void:
|
|||
current_line = field.get_line_count()-1
|
||||
current_column = field.get_line(current_line).length()
|
||||
next_is_in_this_event = result.x < current_column or result.y < current_line
|
||||
elif include_current:
|
||||
next_is_in_this_event = true
|
||||
else:
|
||||
next_is_in_this_event = result.x > current_column or result.y > current_line
|
||||
|
||||
# If the next result was found return it
|
||||
if next_is_in_this_event:
|
||||
if not event in selected_items:
|
||||
select_item(event, false)
|
||||
%TimelineArea.ensure_control_visible(event)
|
||||
event._on_ToggleBodyVisibility_toggled(true)
|
||||
field.select(result.y, result.x, result.y, result.x+len(search_text))
|
||||
break
|
||||
return [event, field, result]
|
||||
|
||||
else:
|
||||
field.deselect()
|
||||
var index := search_results.keys().find(event)
|
||||
event = search_results.keys()[wrapi(index+(-1 if navigate_up else 1), 0, search_results.size())]
|
||||
# Otherwise deselct this field and continue in the next/previous
|
||||
field.deselect()
|
||||
var index := search_results.keys().find(event)
|
||||
event = search_results.keys()[wrapi(index+(-1 if navigate_up else 1), 0, search_results.size())]
|
||||
|
||||
if counter > 5:
|
||||
print("[Dialogic] Search failed.")
|
||||
break
|
||||
return []
|
||||
|
||||
|
||||
func search_text_field(field:TextEdit, search_text := "", navigate_up:= false) -> Vector2i:
|
||||
func search_text_field(field:TextEdit, search_text := "", flags:= 0, navigate_up:= false, include_current := false) -> Vector2i:
|
||||
var search_from_line: int = 0
|
||||
var search_from_column: int = 0
|
||||
if field.has_selection():
|
||||
|
|
@ -1267,6 +1366,9 @@ func search_text_field(field:TextEdit, search_text := "", navigate_up:= false) -
|
|||
if search_from_line == -1:
|
||||
return Vector2i(-1, -1)
|
||||
search_from_column = field.get_line(search_from_line).length()-1
|
||||
elif include_current:
|
||||
search_from_line = field.get_selection_from_line()
|
||||
search_from_column = field.get_selection_from_column()
|
||||
else:
|
||||
search_from_line = field.get_selection_to_line()
|
||||
search_from_column = field.get_selection_to_column()
|
||||
|
|
@ -1275,7 +1377,62 @@ func search_text_field(field:TextEdit, search_text := "", navigate_up:= false) -
|
|||
search_from_line = field.get_line_count()-1
|
||||
search_from_column = field.get_line(search_from_line).length()-1
|
||||
|
||||
var search := field.search(search_text, 4 if navigate_up else 0, search_from_line, search_from_column)
|
||||
if navigate_up:
|
||||
flags = flags | TextEdit.SEARCH_BACKWARDS
|
||||
|
||||
var search := field.search(search_text, flags, search_from_line, search_from_column)
|
||||
return search
|
||||
|
||||
|
||||
func replace(replace_text:String) -> void:
|
||||
var next_pos := get_next_search_position(false, true)
|
||||
var event: Node = next_pos[0]
|
||||
var field: TextEdit = next_pos[1]
|
||||
var result: Vector2i = next_pos[2]
|
||||
|
||||
if field.has_selection():
|
||||
field.set_caret_column(field.get_selection_from_column())
|
||||
field.set_caret_line(field.get_selection_from_line())
|
||||
|
||||
field.begin_complex_operation()
|
||||
field.insert_text("@@", result.y, result.x)
|
||||
if get_meta("current_search_flags") & TextEdit.SEARCH_MATCH_CASE:
|
||||
field.text = field.text.replace("@@"+get_meta("current_search"), replace_text)
|
||||
else:
|
||||
field.text = field.text.replacen("@@"+get_meta("current_search"), replace_text)
|
||||
field.end_complex_operation()
|
||||
|
||||
timeline_editor.replace_in_timeline()
|
||||
|
||||
|
||||
func replace_all(replace_text:String) -> void:
|
||||
var next_pos := get_next_search_position()
|
||||
if not next_pos:
|
||||
return
|
||||
var event: Node = next_pos[0]
|
||||
var field: TextEdit = next_pos[1]
|
||||
var result: Vector2i = next_pos[2]
|
||||
field.begin_complex_operation()
|
||||
while next_pos:
|
||||
event = next_pos[0]
|
||||
if field != next_pos[1]:
|
||||
field.end_complex_operation()
|
||||
field = next_pos[1]
|
||||
field.begin_complex_operation()
|
||||
result = next_pos[2]
|
||||
|
||||
if field.has_selection():
|
||||
field.set_caret_column(field.get_selection_from_column())
|
||||
field.set_caret_line(field.get_selection_from_line())
|
||||
|
||||
field.insert_text("@@", result.y, result.x)
|
||||
if get_meta("current_search_flags") & TextEdit.SEARCH_MATCH_CASE:
|
||||
field.text = field.text.replace("@@"+get_meta("current_search"), replace_text)
|
||||
else:
|
||||
field.text = field.text.replacen("@@"+get_meta("current_search"), replace_text)
|
||||
|
||||
next_pos = get_next_search_position()
|
||||
field.end_complex_operation()
|
||||
timeline_editor.replace_in_timeline()
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
uid://csmcfo7lnabpw
|
||||
uid://cvgok7bxva5e2
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://ysqbusmy0qma"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://csmcfo7lnabpw" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd" id="1_8smxc"]
|
||||
[ext_resource type="Script" uid="uid://cvgok7bxva5e2" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd" id="1_8smxc"]
|
||||
[ext_resource type="Theme" uid="uid://cqst728xxipcw" path="res://addons/dialogic/Editor/Theme/MainTheme.tres" id="2_x0fhp"]
|
||||
[ext_resource type="Script" uid="uid://b1y8xx4okklym" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd" id="3_sap1x"]
|
||||
[ext_resource type="Script" uid="uid://doek0kltvf65w" path="res://addons/dialogic/Editor/Events/EventBlock/event_right_click_menu.gd" id="4_ugiq6"]
|
||||
[ext_resource type="Script" uid="uid://b6ka2avnh1u55" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd" id="3_sap1x"]
|
||||
[ext_resource type="Script" uid="uid://n1knm2ohcehu" path="res://addons/dialogic/Editor/Events/EventBlock/event_right_click_menu.gd" id="4_ugiq6"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_phyjj"]
|
||||
content_margin_top = 10.0
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_plab4"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6gqu8"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dov6v"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jujwh"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
|
|
@ -33,7 +33,7 @@ data = {
|
|||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_vg181"]
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_xe7d2"]
|
||||
image = SubResource("Image_3temo")
|
||||
|
||||
[node name="TimelineVisualEditor" type="MarginContainer"]
|
||||
|
|
@ -70,27 +70,32 @@ size_flags_vertical = 3
|
|||
[node name="EventPopupMenu" type="PopupMenu" parent="View/TimelineArea"]
|
||||
unique_name_in_owner = true
|
||||
size = Vector2i(165, 124)
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_plab4")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_dov6v")
|
||||
item_count = 6
|
||||
item_0/text = "Documentation"
|
||||
item_0/icon = SubResource("ImageTexture_vg181")
|
||||
item_0/id = 0
|
||||
item_1/text = ""
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_6gqu8")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_jujwh")
|
||||
item_count = 9
|
||||
item_0/text = "Duplicate"
|
||||
item_0/icon = SubResource("ImageTexture_xe7d2")
|
||||
item_1/id = -1
|
||||
item_1/separator = true
|
||||
item_2/text = "Move up"
|
||||
item_2/icon = SubResource("ImageTexture_vg181")
|
||||
item_2/text = "Documentation"
|
||||
item_2/icon = SubResource("ImageTexture_xe7d2")
|
||||
item_2/id = 2
|
||||
item_3/text = "Move down"
|
||||
item_3/icon = SubResource("ImageTexture_vg181")
|
||||
item_3/text = "Open Code"
|
||||
item_3/icon = SubResource("ImageTexture_xe7d2")
|
||||
item_3/id = 3
|
||||
item_4/text = ""
|
||||
item_4/id = -1
|
||||
item_4/separator = true
|
||||
item_5/text = "Delete"
|
||||
item_5/icon = SubResource("ImageTexture_vg181")
|
||||
item_5/text = "Move up"
|
||||
item_5/icon = SubResource("ImageTexture_xe7d2")
|
||||
item_5/id = 5
|
||||
item_6/text = "Move down"
|
||||
item_6/icon = SubResource("ImageTexture_xe7d2")
|
||||
item_6/id = 6
|
||||
item_7/id = -1
|
||||
item_7/separator = true
|
||||
item_8/text = "Delete"
|
||||
item_8/icon = SubResource("ImageTexture_xe7d2")
|
||||
item_8/id = 8
|
||||
script = ExtResource("4_ugiq6")
|
||||
|
||||
[node name="RightSidebar" type="ScrollContainer" parent="View"]
|
||||
|
|
@ -107,5 +112,5 @@ size_flags_vertical = 3
|
|||
size_flags_stretch_ratio = 0.2
|
||||
|
||||
[connection signal="drag_completed" from="View/TimelineArea" to="." method="_on_timeline_area_drag_completed"]
|
||||
[connection signal="index_pressed" from="View/TimelineArea/EventPopupMenu" to="." method="_on_event_popup_menu_index_pressed"]
|
||||
[connection signal="id_pressed" from="View/TimelineArea/EventPopupMenu" to="." method="_on_event_popup_menu_id_pressed"]
|
||||
[connection signal="resized" from="View/RightSidebar" to="." method="_on_right_sidebar_resized"]
|
||||
|
|
|
|||
118
addons/dialogic/Editor/TimelineEditor/shortcut_popup.gd
Normal file
118
addons/dialogic/Editor/TimelineEditor/shortcut_popup.gd
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
@tool
|
||||
extends PanelContainer
|
||||
|
||||
|
||||
var shortcuts := [
|
||||
|
||||
{"shortcut":"Ctrl+T", "text":"Add Text event", "editor":"VisualEditor"},
|
||||
{"shortcut":"Ctrl+Shift+T", "text":"Add Text event with current character", "editor":"VisualEditor"},
|
||||
{"shortcut":"Ctrl+Alt/Opt+T", "text":"Add Text event with previous character", "editor":"VisualEditor"},
|
||||
{"shortcut":"Ctrl+E", "text":"Add Character join event", "editor":"VisualEditor"},
|
||||
{"shortcut":"Ctrl+Shift+E", "text":"Add Character update event", "editor":"VisualEditor"},
|
||||
{"shortcut":"Ctrl+Alt/Opt+E", "text":"Add Character leave event", "editor":"VisualEditor"},
|
||||
{"shortcut":"Ctrl+J", "text":"Add Jump event", "editor":"VisualEditor"},
|
||||
{"shortcut":"Ctrl+L", "text":"Add Label event", "editor":"VisualEditor"},
|
||||
{},
|
||||
{"shortcut":"Alt/Opt+Up", "text":"Move selected events/lines up"},
|
||||
{"shortcut":"Alt/Opt+Down", "text":"Move selected events/lines down"},
|
||||
{},
|
||||
{"shortcut":"Ctrl+F", "text":"Search"},
|
||||
{"shortcut":"Ctrl+R", "text":"Replace"},
|
||||
{},
|
||||
{"shortcut":"Ctrl+F5", "text":"Play timeline", "platform":"-macOS"},
|
||||
{"shortcut":"Ctrl+B", "text":"Play timeline", "platform":"macOS"},
|
||||
{"shortcut":"Ctrl+F6", "text":"Play timeline from here", "platform":"-macOS"},
|
||||
{"shortcut":"Ctrl+Shift+B", "text":"Play timeline from here", "platform":"macOS"},
|
||||
|
||||
{},
|
||||
{"shortcut":"Ctrl+C", "text":"Copy"},
|
||||
{"shortcut":"Ctrl+V", "text":"Paste"},
|
||||
{"shortcut":"Ctrl+D", "text":"Duplicate selected events/lines"},
|
||||
{"shortcut":"Ctrl+X", "text":"Cut selected events/lines"},
|
||||
{"shortcut":"Ctrl+K", "text":"Toggle Comment" , "editor":"TextEditor"},
|
||||
{"shortcut":"Delete", "text":"Delete events", "editor":"VisualEditor"},
|
||||
{},
|
||||
{"shortcut":"Ctrl+A", "text":"Select All"},
|
||||
{"shortcut":"Ctrl+Shift+A", "text":"Select Nothing", "editor":"VisualEditor"},
|
||||
{"shortcut":"Up", "text":"Select previous event", "editor":"VisualEditor"},
|
||||
{"shortcut":"Down", "text":"Select next event", "editor":"VisualEditor"},
|
||||
{},
|
||||
{"shortcut":"Ctrl+Z", "text":"Undo"},
|
||||
{"shortcut":"Ctrl+Shift+Z", "text":"Redo"},
|
||||
{},
|
||||
]
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
%CloseShortcutPanel.icon = get_theme_icon("Close", "EditorIcons")
|
||||
get_theme_stylebox("panel").bg_color = get_theme_color("dark_color_3", "Editor")
|
||||
|
||||
|
||||
func reload_shortcuts() -> void:
|
||||
for i in %ShortcutList.get_children():
|
||||
i.queue_free()
|
||||
|
||||
var is_text_editor: bool = %TextEditor.visible
|
||||
for i in shortcuts:
|
||||
if i.is_empty():
|
||||
%ShortcutList.add_child(HSeparator.new())
|
||||
%ShortcutList.add_child(HSeparator.new())
|
||||
continue
|
||||
|
||||
if "editor" in i and not get_node("%"+i.editor).visible:
|
||||
continue
|
||||
|
||||
if "platform" in i:
|
||||
var platform := OS.get_name()
|
||||
if not (platform == i.platform.trim_prefix("-") != i.platform.begins_with("-")):
|
||||
continue
|
||||
|
||||
var hbox := HBoxContainer.new()
|
||||
hbox.add_theme_constant_override("separation", 0)
|
||||
for key_text in i.shortcut.split("+"):
|
||||
if hbox.get_child_count():
|
||||
var plus_l := Label.new()
|
||||
plus_l.text = "+"
|
||||
hbox.add_child(plus_l)
|
||||
|
||||
var key := Button.new()
|
||||
if key_text == "Up":
|
||||
key.icon = get_theme_icon("ArrowUp", "EditorIcons")
|
||||
elif key_text == "Down":
|
||||
key.icon = get_theme_icon("ArrowDown", "EditorIcons")
|
||||
else:
|
||||
key_text = key_text.replace("Alt/Opt", "Opt" if OS.get_name() == "macOS" else "Alt")
|
||||
key.text = key_text
|
||||
key.disabled = true
|
||||
key.theme_type_variation = "ShortcutKeyLabel"
|
||||
key.add_theme_font_override("font", get_theme_font("source", "EditorFonts"))
|
||||
hbox.add_child(key)
|
||||
|
||||
%ShortcutList.add_child(hbox)
|
||||
|
||||
var text := Label.new()
|
||||
text.text = i.text.replace("events/lines", "lines" if is_text_editor else "events")
|
||||
text.theme_type_variation = "DialogicHintText2"
|
||||
%ShortcutList.add_child(text)
|
||||
|
||||
|
||||
func open():
|
||||
if visible:
|
||||
close()
|
||||
return
|
||||
reload_shortcuts()
|
||||
|
||||
show()
|
||||
await get_tree().process_frame
|
||||
size = get_parent().size - Vector2(100, 100)*DialogicUtil.get_editor_scale()
|
||||
size.x = %ShortcutList.get_minimum_size().x + 100
|
||||
size.y = min(size.y, %ShortcutList.get_minimum_size().y+100)
|
||||
global_position = get_parent().global_position+get_parent().size/2-size/2
|
||||
|
||||
|
||||
func _on_close_shortcut_panel_pressed() -> void:
|
||||
close()
|
||||
|
||||
func close() -> void:
|
||||
hide()
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://b35hvsvrvjjl4
|
||||
|
|
@ -15,9 +15,10 @@ func _ready() -> void:
|
|||
|
||||
randomize()
|
||||
var current_timeline: String = DialogicUtil.get_editor_setting("current_timeline_path", "")
|
||||
var start_from_index: int = DialogicUtil.get_editor_setting("play_from_index", -1)
|
||||
if not current_timeline:
|
||||
get_tree().quit()
|
||||
DialogicUtil.autoload().start(current_timeline)
|
||||
DialogicUtil.autoload().start(current_timeline, start_from_index)
|
||||
DialogicUtil.autoload().timeline_ended.connect(get_tree().quit)
|
||||
DialogicUtil.autoload().signal_event.connect(receive_event_signal)
|
||||
DialogicUtil.autoload().text_signal.connect(receive_text_signal)
|
||||
|
|
@ -41,4 +42,3 @@ func _input(event:InputEvent) -> void:
|
|||
|
||||
auto_skip.disable_on_unread_text = false
|
||||
auto_skip.enabled = not is_auto_skip_enabled
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
uid://c8m3dmu53kupl
|
||||
uid://cbq0n68r4pwu7
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://ud18ke1g2nw4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c8m3dmu53kupl" path="res://addons/dialogic/Editor/TimelineEditor/test_timeline_scene.gd" id="1_bamud"]
|
||||
[ext_resource type="Script" uid="uid://cbq0n68r4pwu7" path="res://addons/dialogic/Editor/TimelineEditor/test_timeline_scene.gd" id="1_bamud"]
|
||||
|
||||
[node name="TestTimelineScene" type="Control"]
|
||||
layout_mode = 3
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ func _open_resource(resource:Resource) -> void:
|
|||
EditorMode.TEXT:
|
||||
%TextEditor.load_timeline(current_resource)
|
||||
$NoTimelineScreen.hide()
|
||||
%TimelineName.text = DialogicResourceUtil.get_unique_identifier(current_resource.resource_path)
|
||||
%TimelineName.text = current_resource.get_identifier()
|
||||
play_timeline_button.disabled = false
|
||||
|
||||
|
||||
|
|
@ -100,16 +100,20 @@ func _input(event: InputEvent) -> void:
|
|||
if is_ancestor_of(get_viewport().gui_get_focus_owner()):
|
||||
search_timeline()
|
||||
|
||||
if event.keycode == KEY_R and event.pressed:
|
||||
if Input.is_key_pressed(KEY_CTRL):
|
||||
if is_ancestor_of(get_viewport().gui_get_focus_owner()):
|
||||
replace_in_timeline(true)
|
||||
|
||||
## Method to play the current timeline. Connected to the button in the sidebar.
|
||||
func play_timeline() -> void:
|
||||
func play_timeline(index := -1) -> void:
|
||||
_save()
|
||||
|
||||
var dialogic_plugin := DialogicUtil.get_dialogic_plugin()
|
||||
|
||||
# Save the current opened timeline
|
||||
DialogicUtil.set_editor_setting('current_timeline_path', current_resource.resource_path)
|
||||
|
||||
DialogicUtil.set_editor_setting('play_from_index', index)
|
||||
DialogicUtil.get_dialogic_plugin().get_editor_interface().play_custom_scene("res://addons/dialogic/Editor/TimelineEditor/test_timeline_scene.tscn")
|
||||
|
||||
|
||||
|
|
@ -118,19 +122,25 @@ func toggle_editor_mode() -> void:
|
|||
match current_editor_mode:
|
||||
EditorMode.VISUAL:
|
||||
current_editor_mode = EditorMode.TEXT
|
||||
%VisualEditor.save_timeline()
|
||||
if %VisualEditor.is_loading_timeline():
|
||||
%VisualEditor.cancel_loading()
|
||||
else:
|
||||
%VisualEditor.save_timeline()
|
||||
%VisualEditor.hide()
|
||||
%TextEditor.show()
|
||||
%TextEditor.load_timeline(current_resource)
|
||||
%SwitchEditorMode.text = "Visual Editor"
|
||||
_on_search_text_changed(%Search.text)
|
||||
EditorMode.TEXT:
|
||||
_on_search_text_changed.bind("")
|
||||
current_editor_mode = EditorMode.VISUAL
|
||||
%TextEditor.save_timeline()
|
||||
%TextEditor.hide()
|
||||
%VisualEditor.load_timeline(current_resource)
|
||||
%VisualEditor.show()
|
||||
%SwitchEditorMode.text = "Text Editor"
|
||||
_on_search_text_changed(%Search.text)
|
||||
if not %VisualEditor.timeline_loaded.is_connected(_on_search_text_changed):
|
||||
%VisualEditor.timeline_loaded.connect(_on_search_text_changed.bind(%Search.text), CONNECT_ONE_SHOT)
|
||||
DialogicUtil.set_editor_setting('timeline_editor_mode', current_editor_mode)
|
||||
|
||||
|
||||
|
|
@ -147,6 +157,9 @@ func _on_resource_saved() -> void:
|
|||
func new_timeline(path:String) -> void:
|
||||
_save()
|
||||
var new_timeline := DialogicTimeline.new()
|
||||
if not path.ends_with(".dtl"):
|
||||
path = path.trim_suffix(".")
|
||||
path += ".dtl"
|
||||
new_timeline.resource_path = path
|
||||
new_timeline.set_meta('timeline_not_saved', true)
|
||||
var err := ResourceSaver.save(new_timeline)
|
||||
|
|
@ -155,6 +168,20 @@ func new_timeline(path:String) -> void:
|
|||
editors_manager.edit_resource(new_timeline)
|
||||
|
||||
|
||||
func update_audio_channel_cache(list:PackedStringArray) -> void:
|
||||
var timeline_directory := DialogicResourceUtil.get_timeline_directory()
|
||||
var channel_directory := DialogicResourceUtil.get_audio_channel_cache()
|
||||
if current_resource != null:
|
||||
for i in timeline_directory:
|
||||
if timeline_directory[i] == current_resource.resource_path:
|
||||
channel_directory[i] = list
|
||||
|
||||
# also always store the current timelines channels for easy access
|
||||
channel_directory[""] = list
|
||||
|
||||
DialogicResourceUtil.set_audio_channel_cache(channel_directory)
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$NoTimelineScreen.add_theme_stylebox_override("panel", get_theme_stylebox("Background", "EditorStyles"))
|
||||
|
||||
|
|
@ -164,10 +191,19 @@ func _ready() -> void:
|
|||
%SwitchEditorMode.pressed.connect(toggle_editor_mode)
|
||||
%SwitchEditorMode.custom_minimum_size.x = 200 * DialogicUtil.get_editor_scale()
|
||||
|
||||
%Shortcuts.icon = get_theme_icon("InputEventShortcut", "EditorIcons")
|
||||
%Shortcuts.pressed.connect(%ShortcutsPanel.open)
|
||||
|
||||
%SearchClose.icon = get_theme_icon("Close", "EditorIcons")
|
||||
%SearchUp.icon = get_theme_icon("MoveUp", "EditorIcons")
|
||||
%SearchDown.icon = get_theme_icon("MoveDown", "EditorIcons")
|
||||
|
||||
%ReplaceGlobal.icon = get_theme_icon("ExternalLink", "EditorIcons")
|
||||
|
||||
%ProgressSection.hide()
|
||||
|
||||
%SearchReplaceSection.hide()
|
||||
%SearchReplaceSection.add_theme_stylebox_override("panel", get_theme_stylebox("PanelForeground", "EditorStyles"))
|
||||
|
||||
|
||||
func _on_create_timeline_button_pressed() -> void:
|
||||
|
|
@ -199,24 +235,25 @@ func get_current_editor() -> Node:
|
|||
#region SEARCH
|
||||
|
||||
func search_timeline() -> void:
|
||||
%SearchReplaceSection.show()
|
||||
%SearchSection.show()
|
||||
%ReplaceSection.hide()
|
||||
if get_viewport().gui_get_focus_owner() is TextEdit:
|
||||
%Search.text = get_viewport().gui_get_focus_owner().get_selected_text()
|
||||
_on_search_text_changed(%Search.text)
|
||||
else:
|
||||
%Search.text = ""
|
||||
if get_viewport().gui_get_focus_owner().get_selected_text():
|
||||
%Search.text = get_viewport().gui_get_focus_owner().get_selected_text()
|
||||
_on_search_text_changed(%Search.text)
|
||||
%Search.grab_focus()
|
||||
|
||||
|
||||
func _on_close_search_pressed() -> void:
|
||||
%SearchSection.hide()
|
||||
%SearchReplaceSection.hide()
|
||||
%Search.text = ""
|
||||
_on_search_text_changed('')
|
||||
|
||||
|
||||
func _on_search_text_changed(new_text: String) -> void:
|
||||
var editor: Node = null
|
||||
var anything_found: bool = get_current_editor()._search_timeline(new_text)
|
||||
var anything_found: bool = get_current_editor()._search_timeline(new_text, %MatchCase.button_pressed, %WholeWords.button_pressed)
|
||||
if anything_found or new_text.is_empty():
|
||||
%SearchLabel.hide()
|
||||
%Search.add_theme_color_override("font_color", get_theme_color("font_color", "Editor"))
|
||||
|
|
@ -234,6 +271,51 @@ func _on_search_down_pressed() -> void:
|
|||
func _on_search_up_pressed() -> void:
|
||||
get_current_editor()._search_navigate_up()
|
||||
|
||||
|
||||
func _on_match_case_toggled(toggled_on: bool) -> void:
|
||||
_on_search_text_changed(%Search.text)
|
||||
|
||||
|
||||
func _on_whole_words_toggled(toggled_on: bool) -> void:
|
||||
_on_search_text_changed(%Search.text)
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region REPLACE
|
||||
|
||||
func replace_in_timeline(focus_grab:=false) -> void:
|
||||
search_timeline()
|
||||
%ReplaceSection.show()
|
||||
if focus_grab:
|
||||
%ReplaceText.grab_focus()
|
||||
%ReplaceText.select_all()
|
||||
|
||||
|
||||
func _on_replace_button_pressed() -> void:
|
||||
get_current_editor().replace(%ReplaceText.text)
|
||||
|
||||
|
||||
func _on_replace_all_button_pressed() -> void:
|
||||
get_current_editor().replace_all(%ReplaceText.text)
|
||||
|
||||
|
||||
func _on_replace_global_pressed() -> void:
|
||||
editors_manager.reference_manager.add_ref_change(%Search.text, %ReplaceText.text, 0, 0, [],
|
||||
%WholeWords.button_pressed, %MatchCase.button_pressed)
|
||||
editors_manager.reference_manager.open()
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region PROGRESS
|
||||
|
||||
func set_progress(percentage:float, text := "") -> void:
|
||||
%ProgressSection.visible = percentage != 1
|
||||
|
||||
%ProgressBar.value = percentage
|
||||
%ProgressLabel.text = text
|
||||
%ProgressLabel.visible = not text.is_empty()
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
uid://c86cjvf8l8e3t
|
||||
uid://x21vral0xsxy
|
||||
|
|
|
|||
|
|
@ -1,27 +1,24 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://crce0na84rhfd"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://crce0na84rhfd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c86cjvf8l8e3t" path="res://addons/dialogic/Editor/TimelineEditor/timeline_editor.gd" id="1_4aceh"]
|
||||
[ext_resource type="Script" uid="uid://x21vral0xsxy" path="res://addons/dialogic/Editor/TimelineEditor/timeline_editor.gd" id="1_4aceh"]
|
||||
[ext_resource type="PackedScene" uid="uid://ysqbusmy0qma" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.tscn" id="2_qs7vc"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_yqd26"]
|
||||
[ext_resource type="PackedScene" uid="uid://defdeav8rli6o" path="res://addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.tscn" id="3_up2bn"]
|
||||
[ext_resource type="Script" uid="uid://ccjw4fyc586j1" path="res://addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd" id="4_1t6bf"]
|
||||
[ext_resource type="Script" uid="uid://b35hvsvrvjjl4" path="res://addons/dialogic/Editor/TimelineEditor/shortcut_popup.gd" id="6_rfuk0"]
|
||||
|
||||
[sub_resource type="Image" id="Image_6bv6r"]
|
||||
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),
|
||||
"data": PackedByteArray(255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 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, 0, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 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, 0, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 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, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 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, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 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, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 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, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 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, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 231, 255, 90, 90, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 90, 90, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 42, 255, 90, 90, 0, 255, 94, 94, 0, 255, 91, 91, 42, 255, 93, 93, 233, 255, 92, 92, 232, 255, 93, 93, 41, 255, 90, 90, 0, 255, 94, 94, 0, 255, 91, 91, 42, 255, 93, 93, 233, 255, 92, 92, 232, 255, 92, 92, 0, 255, 92, 92, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 93, 93, 44, 255, 91, 91, 0, 255, 91, 91, 42, 255, 91, 91, 42, 255, 93, 93, 0, 255, 91, 91, 45, 255, 93, 93, 44, 255, 91, 91, 0, 255, 91, 91, 42, 255, 91, 91, 42, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 92, 92, 235, 255, 92, 92, 234, 255, 89, 89, 43, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 92, 92, 235, 255, 92, 92, 234, 255, 89, 89, 43, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 91, 91, 59, 255, 92, 92, 61, 255, 92, 92, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 91, 91, 59, 255, 92, 92, 61, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 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, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 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, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0),
|
||||
"format": "RGBA8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_lvr8x"]
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_u2118"]
|
||||
image = SubResource("Image_6bv6r")
|
||||
|
||||
[sub_resource type="SyntaxHighlighter" id="SyntaxHighlighter_7lpql"]
|
||||
script = ExtResource("4_1t6bf")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lpeon"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_boacm"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
|
|
@ -34,6 +31,45 @@ border_width_right = 2
|
|||
border_width_bottom = 2
|
||||
corner_detail = 1
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4bvbc"]
|
||||
content_margin_left = 0.0
|
||||
content_margin_top = 0.0
|
||||
content_margin_right = 0.0
|
||||
content_margin_bottom = 0.0
|
||||
bg_color = Color(0.458405, 0.458405, 0.458405, 1)
|
||||
draw_center = false
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.370364, 0.370365, 0.370364, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[sub_resource type="Theme" id="Theme_feml8"]
|
||||
HSeparator/constants/separation = 10
|
||||
ShortcutKeyLabel/base_type = &"Button"
|
||||
ShortcutKeyLabel/colors/font_disabled_color = Color(1, 1, 1, 1)
|
||||
ShortcutKeyLabel/colors/icon_disabled_color = Color(1, 1, 1, 1)
|
||||
ShortcutKeyLabel/font_sizes/font_size = 14
|
||||
ShortcutKeyLabel/styles/disabled = SubResource("StyleBoxFlat_4bvbc")
|
||||
ShortcutKeyLabel/styles/normal = SubResource("StyleBoxFlat_4bvbc")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_j85ew"]
|
||||
content_margin_left = 20.0
|
||||
content_margin_top = 20.0
|
||||
content_margin_right = 20.0
|
||||
content_margin_bottom = 20.0
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
shadow_color = Color(0, 0, 0, 0.407843)
|
||||
shadow_size = 15
|
||||
|
||||
[node name="Timeline" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
|
|
@ -66,7 +102,7 @@ tooltip_text = "This unique identifier is based on the file name. You can change
|
|||
This is what you should use in a jump event to reference this timeline.
|
||||
|
||||
You can also use this name in Dialogic.start()."
|
||||
texture = SubResource("ImageTexture_lvr8x")
|
||||
texture = null
|
||||
hint_text = "This unique identifier is based on the file name. You can change it in the Reference Manager.
|
||||
This is what you should use in a jump event to reference this timeline.
|
||||
|
||||
|
|
@ -80,7 +116,15 @@ size_flags_horizontal = 10
|
|||
size_flags_vertical = 4
|
||||
tooltip_text = "Switch between Text Editor and Visual Editor"
|
||||
text = "Text editor"
|
||||
icon = SubResource("ImageTexture_lvr8x")
|
||||
icon = SubResource("ImageTexture_u2118")
|
||||
|
||||
[node name="Shortcuts" type="Button" parent="VBox/HBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
tooltip_text = "Shortcuts"
|
||||
icon = SubResource("ImageTexture_u2118")
|
||||
|
||||
[node name="VisualEditor" parent="VBox" instance=ExtResource("2_qs7vc")]
|
||||
unique_name_in_owner = true
|
||||
|
|
@ -95,36 +139,98 @@ theme_override_constants/margin_bottom = 0
|
|||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
syntax_highlighter = SubResource("SyntaxHighlighter_7lpql")
|
||||
symbol_lookup_on_click = true
|
||||
line_folding = false
|
||||
gutters_draw_fold_gutter = false
|
||||
|
||||
[node name="SearchSection" type="HBoxContainer" parent="VBox"]
|
||||
[node name="SearchReplaceSection" type="PanelContainer" parent="VBox"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_boacm")
|
||||
|
||||
[node name="Search" type="LineEdit" parent="VBox/SearchSection"]
|
||||
[node name="VBox" type="VBoxContainer" parent="VBox/SearchReplaceSection"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SearchSection" type="HBoxContainer" parent="VBox/SearchReplaceSection/VBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Search" type="LineEdit" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Search"
|
||||
|
||||
[node name="SearchLabel" type="Label" parent="VBox/SearchSection"]
|
||||
[node name="SearchLabel" type="Label" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SearchUp" type="Button" parent="VBox/SearchSection"]
|
||||
[node name="SearchUp" type="Button" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
icon = SubResource("ImageTexture_u2118")
|
||||
flat = true
|
||||
|
||||
[node name="SearchDown" type="Button" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
icon = SubResource("ImageTexture_u2118")
|
||||
flat = true
|
||||
|
||||
[node name="MatchCase" type="CheckBox" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Match Case"
|
||||
|
||||
[node name="WholeWords" type="CheckBox" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Whole Words"
|
||||
|
||||
[node name="SearchClose" type="Button" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
icon = SubResource("ImageTexture_u2118")
|
||||
flat = true
|
||||
|
||||
[node name="ReplaceSection" type="HBoxContainer" parent="VBox/SearchReplaceSection/VBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SearchDown" type="Button" parent="VBox/SearchSection"]
|
||||
[node name="ReplaceText" type="LineEdit" parent="VBox/SearchReplaceSection/VBox/ReplaceSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Replace"
|
||||
|
||||
[node name="SearchClose" type="Button" parent="VBox/SearchSection"]
|
||||
[node name="ReplaceButton" type="Button" parent="VBox/SearchReplaceSection/VBox/ReplaceSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Replace"
|
||||
|
||||
[node name="ReplaceAllButton" type="Button" parent="VBox/SearchReplaceSection/VBox/ReplaceSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Replace All"
|
||||
|
||||
[node name="ReplaceGlobal" type="Button" parent="VBox/SearchReplaceSection/VBox/ReplaceSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Replace in all timelines"
|
||||
icon = SubResource("ImageTexture_u2118")
|
||||
|
||||
[node name="ProgressSection" type="HBoxContainer" parent="VBox"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="VBox/ProgressSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
max_value = 1.0
|
||||
step = 0.001
|
||||
|
||||
[node name="ProgressLabel" type="Label" parent="VBox/ProgressSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
|
|
@ -136,7 +242,7 @@ anchor_right = 1.0
|
|||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_lpeon")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_boacm")
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="NoTimelineScreen"]
|
||||
layout_mode = 2
|
||||
|
|
@ -156,8 +262,54 @@ autowrap_mode = 3
|
|||
layout_mode = 2
|
||||
text = "Create New Timeline"
|
||||
|
||||
[connection signal="text_changed" from="VBox/SearchSection/Search" to="." method="_on_search_text_changed"]
|
||||
[connection signal="pressed" from="VBox/SearchSection/SearchUp" to="." method="_on_search_up_pressed"]
|
||||
[connection signal="pressed" from="VBox/SearchSection/SearchDown" to="." method="_on_search_down_pressed"]
|
||||
[connection signal="pressed" from="VBox/SearchSection/SearchClose" to="." method="_on_close_search_pressed"]
|
||||
[node name="ShortcutsPanel" type="PanelContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 51.0
|
||||
offset_top = 57.0
|
||||
offset_right = 571.0
|
||||
offset_bottom = 416.0
|
||||
theme = SubResource("Theme_feml8")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_j85ew")
|
||||
script = ExtResource("6_rfuk0")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ShortcutsPanel"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="ShortcutsPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ShortcutsPanel/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_type_variation = &"DialogicSectionBig"
|
||||
text = "Shortcuts "
|
||||
|
||||
[node name="CloseShortcutPanel" type="Button" parent="ShortcutsPanel/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
icon = SubResource("ImageTexture_u2118")
|
||||
flat = true
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="ShortcutsPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ShortcutList" type="GridContainer" parent="ShortcutsPanel/VBoxContainer/ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_constants/h_separation = 11
|
||||
columns = 2
|
||||
|
||||
[connection signal="text_changed" from="VBox/SearchReplaceSection/VBox/SearchSection/Search" to="." method="_on_search_text_changed"]
|
||||
[connection signal="pressed" from="VBox/SearchReplaceSection/VBox/SearchSection/SearchUp" to="." method="_on_search_up_pressed"]
|
||||
[connection signal="pressed" from="VBox/SearchReplaceSection/VBox/SearchSection/SearchDown" to="." method="_on_search_down_pressed"]
|
||||
[connection signal="toggled" from="VBox/SearchReplaceSection/VBox/SearchSection/MatchCase" to="." method="_on_match_case_toggled"]
|
||||
[connection signal="toggled" from="VBox/SearchReplaceSection/VBox/SearchSection/WholeWords" to="." method="_on_whole_words_toggled"]
|
||||
[connection signal="pressed" from="VBox/SearchReplaceSection/VBox/SearchSection/SearchClose" to="." method="_on_close_search_pressed"]
|
||||
[connection signal="pressed" from="VBox/SearchReplaceSection/VBox/ReplaceSection/ReplaceButton" to="." method="_on_replace_button_pressed"]
|
||||
[connection signal="pressed" from="VBox/SearchReplaceSection/VBox/ReplaceSection/ReplaceAllButton" to="." method="_on_replace_all_button_pressed"]
|
||||
[connection signal="pressed" from="VBox/SearchReplaceSection/VBox/ReplaceSection/ReplaceGlobal" to="." method="_on_replace_global_pressed"]
|
||||
[connection signal="pressed" from="NoTimelineScreen/CenterContainer/VBoxContainer/CreateTimelineButton" to="." method="_on_create_timeline_button_pressed"]
|
||||
[connection signal="pressed" from="ShortcutsPanel/VBoxContainer/HBoxContainer/CloseShortcutPanel" to="ShortcutsPanel" method="_on_close_shortcut_panel_pressed"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue