Add addons
|
|
@ -0,0 +1,511 @@
|
|||
@tool
|
||||
extends DialogicEditor
|
||||
|
||||
## Editor for editing character resources.
|
||||
|
||||
signal character_loaded(resource_path:String)
|
||||
signal portrait_selected()
|
||||
|
||||
|
||||
# Enums
|
||||
enum PreviewModes {Full, Real}
|
||||
|
||||
# Current state
|
||||
var current_preview_mode = PreviewModes.Full
|
||||
var loading = false
|
||||
var current_previewed_scene = null
|
||||
|
||||
# References
|
||||
var selected_item: TreeItem
|
||||
|
||||
##############################################################################
|
||||
## RESOURCE LOGIC
|
||||
##############################################################################
|
||||
|
||||
# Method is called once editors manager is ready to accept registers.
|
||||
func _register() -> void:
|
||||
# Makes the editor open this when a .dch file is selected.
|
||||
# Then _open_resource() is called.
|
||||
editors_manager.register_resource_editor("dch", self)
|
||||
# Add an "add character" button
|
||||
var add_character_button = editors_manager.add_icon_button(
|
||||
load("res://addons/dialogic/Editor/Images/Toolbar/add-character.svg"),
|
||||
'Add Character',
|
||||
self)
|
||||
add_character_button.pressed.connect(
|
||||
editors_manager.show_add_resource_dialog.bind(
|
||||
new_character,
|
||||
'*.dch; DialogicCharacter',
|
||||
'Create new character',
|
||||
'character',
|
||||
))
|
||||
|
||||
|
||||
# Called when a character is opened somehow
|
||||
func _open_resource(resource:Resource) -> void:
|
||||
# update resource
|
||||
current_resource = (resource as DialogicCharacter)
|
||||
|
||||
# make sure changes in the ui won't trigger saving
|
||||
loading = true
|
||||
|
||||
## Load other main tabs
|
||||
for main_edit in %MainEditTabs.get_children():
|
||||
main_edit._load_character(current_resource)
|
||||
|
||||
%DefaultPortraitPicker.set_value(resource.default_portrait)
|
||||
|
||||
%MainScale.value = 100*resource.scale
|
||||
%MainOffsetX.value = resource.offset.x
|
||||
%MainOffsetY.value = resource.offset.y
|
||||
%MainMirror.button_pressed = resource.mirror
|
||||
|
||||
# Portrait section
|
||||
%PortraitSearch.text = ""
|
||||
load_portrait_tree()
|
||||
|
||||
loading = false
|
||||
character_loaded.emit(resource.resource_path)
|
||||
|
||||
|
||||
func _save_resource() -> void:
|
||||
if ! visible or not current_resource:
|
||||
return
|
||||
|
||||
# Portrait list
|
||||
current_resource.portraits = get_updated_portrait_dict()
|
||||
|
||||
# Portrait settings
|
||||
if %DefaultPortraitPicker.current_value in current_resource.portraits.keys():
|
||||
current_resource.default_portrait = %DefaultPortraitPicker.current_value
|
||||
elif !current_resource.portraits.is_empty():
|
||||
current_resource.default_portrait = current_resource.portraits.keys()[0]
|
||||
else:
|
||||
current_resource.default_portrait = ""
|
||||
|
||||
current_resource.scale = %MainScale.value/100.0
|
||||
current_resource.offset = Vector2(%MainOffsetX.value, %MainOffsetY.value)
|
||||
current_resource.mirror = %MainMirror.button_pressed
|
||||
|
||||
# Main tabs
|
||||
for main_edit in %MainEditTabs.get_children():
|
||||
current_resource = main_edit._save_changes(current_resource)
|
||||
|
||||
ResourceSaver.save(current_resource, current_resource.resource_path)
|
||||
current_resource_state = ResourceStates.Saved
|
||||
editors_manager.resource_helper.rebuild_character_directory()
|
||||
|
||||
|
||||
# Saves a new empty character to the given path
|
||||
func new_character(path: String) -> void:
|
||||
var resource := DialogicCharacter.new()
|
||||
resource.resource_path = path
|
||||
resource.display_name = path.get_file().trim_suffix("."+path.get_extension())
|
||||
resource.color = Color(1,1,1,1)
|
||||
resource.default_portrait = ""
|
||||
resource.custom_info = {}
|
||||
ResourceSaver.save(resource, path)
|
||||
editors_manager.edit_resource(resource)
|
||||
|
||||
|
||||
##############################################################################
|
||||
## INTERFACE
|
||||
##############################################################################
|
||||
|
||||
func _ready() -> void:
|
||||
setup_portrait_list_tab()
|
||||
|
||||
setup_portrait_settings_tab()
|
||||
|
||||
%PreviewMode.item_selected.connect(_on_PreviewMode_item_selected)
|
||||
%PreviewMode.select(DialogicUtil.get_project_setting('dialogic/editor/character_preview_mode', 0))
|
||||
_on_PreviewMode_item_selected(%PreviewMode.selected)
|
||||
|
||||
## General Styling
|
||||
var panel_style = DCSS.inline({
|
||||
'border-radius': 5,
|
||||
'border': 1,
|
||||
'border_color':get_theme_color("dark_color_3", "Editor"),
|
||||
'background': get_theme_color("base_color", "Editor"),
|
||||
'padding': [10, 10],
|
||||
})
|
||||
|
||||
var tab_panel :StyleBoxFlat = get_theme_stylebox('tab_selected', 'TabContainer').duplicate()
|
||||
tab_panel.bg_color = get_theme_color("base_color", "Editor")
|
||||
|
||||
%MainEditTabs.add_theme_stylebox_override('panel', panel_style)
|
||||
%MainEditTabs.add_theme_stylebox_override('tab_selected', tab_panel)
|
||||
%MainEditTabs.add_theme_constant_override('side_margin', 5)
|
||||
%PortraitListSection.add_theme_stylebox_override('panel', panel_style)
|
||||
%PortraitListSection.add_theme_stylebox_override('tab_selected', tab_panel)
|
||||
%PortraitListSection.add_theme_constant_override('side_margin', 5)
|
||||
%PortraitPreviewSection.add_theme_stylebox_override('panel', panel_style)
|
||||
%PortraitSettingsSection.add_theme_stylebox_override('panel', panel_style)
|
||||
%PortraitSettingsSection.add_theme_stylebox_override('tab_selected', tab_panel)
|
||||
%PortraitSettingsSection.add_theme_constant_override('side_margin', 5)
|
||||
|
||||
%RealPreviewPivot.texture = get_theme_icon("EditorPivot", "EditorIcons")
|
||||
|
||||
# Add general tab
|
||||
add_main_tab("res://addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.tscn")
|
||||
|
||||
# Load main tabs from subsystems/events
|
||||
for indexer in DialogicUtil.get_indexers():
|
||||
for main_tab in indexer._get_character_editor_tabs():
|
||||
add_main_tab(main_tab)
|
||||
|
||||
for child in %PortraitSettingsSection.get_children():
|
||||
if !child is DialogicCharacterEditorPortraitSettingsTab:
|
||||
printerr("[Dialogic Editor] Portrait settings tabs should extend the right class!")
|
||||
else:
|
||||
child.character_editor = self
|
||||
child.changed.connect(something_changed)
|
||||
child.update_preview.connect(update_preview)
|
||||
|
||||
|
||||
func add_main_tab(scene_path:String) -> void:
|
||||
var edit: DialogicCharacterEditorMainTab = load(scene_path).instantiate()
|
||||
edit.changed.connect(something_changed)
|
||||
edit.character_editor = self
|
||||
%MainEditTabs.add_child(edit)
|
||||
|
||||
|
||||
func something_changed(fake_argument = "", fake_arg2 = null) -> void:
|
||||
if not loading:
|
||||
current_resource_state = ResourceStates.Unsaved
|
||||
editors_manager.save_current_resource() #TODO, should this happen?
|
||||
|
||||
|
||||
##############################################################################
|
||||
## PORTRAIT SECTION
|
||||
##############################################################################
|
||||
|
||||
func setup_portrait_list_tab() -> void:
|
||||
%PortraitTree.editor = self
|
||||
|
||||
## Portrait section styling/connections
|
||||
%AddPortraitButton.icon = get_theme_icon("Add", "EditorIcons")
|
||||
%AddPortraitButton.pressed.connect(add_portrait)
|
||||
%AddPortraitGroupButton.icon = get_theme_icon("Groups", "EditorIcons")
|
||||
%AddPortraitGroupButton.pressed.connect(add_portrait_group)
|
||||
%ImportPortraitsButton.icon = get_theme_icon("Folder", "EditorIcons")
|
||||
%ImportPortraitsButton.pressed.connect(open_portrait_folder_select)
|
||||
%PortraitSearch.right_icon = get_theme_icon("Search", "EditorIcons")
|
||||
%PortraitSearch.text_changed.connect(filter_portrait_list)
|
||||
|
||||
%PortraitTree.item_selected.connect(load_selected_portrait)
|
||||
%PortraitTree.item_edited.connect(_on_item_edited)
|
||||
|
||||
func open_portrait_folder_select() -> void:
|
||||
find_parent("EditorView").godot_file_dialog(
|
||||
import_portraits_from_folder, "*",
|
||||
EditorFileDialog.FILE_MODE_OPEN_DIR)
|
||||
|
||||
|
||||
func import_portraits_from_folder(path:String) -> void:
|
||||
var parent: TreeItem = %PortraitTree.get_root()
|
||||
if %PortraitTree.get_selected() and %PortraitTree.get_selected().get_metadata(0).has('group'):
|
||||
parent = %PortraitTree.get_selected()
|
||||
|
||||
var dir := DirAccess.open(path)
|
||||
dir.list_dir_begin()
|
||||
var file_name :String = dir.get_next()
|
||||
while file_name != "":
|
||||
if not dir.current_is_dir():
|
||||
var file_lower = file_name.to_lower()
|
||||
if '.svg' in file_lower or '.png' in file_lower:
|
||||
if not '.import' in file_lower:
|
||||
var final_name: String= path+ "/" + file_name
|
||||
%PortraitTree.add_portrait_item(file_name.trim_suffix('.'+file_name.get_extension()),
|
||||
{'scene':"",'image':final_name, 'scale':1, 'offset':Vector2(), 'mirror':false}, parent)
|
||||
file_name = dir.get_next()
|
||||
something_changed()
|
||||
|
||||
|
||||
func add_portrait(portrait_name:String='New portrait', portrait_data:Dictionary={'scene':"", 'image':'', 'scale':1, 'offset':Vector2(), 'mirror':false}) -> void:
|
||||
var parent: TreeItem = %PortraitTree.get_root()
|
||||
if %PortraitTree.get_selected():
|
||||
if %PortraitTree.get_selected().get_metadata(0).has('group'):
|
||||
parent = %PortraitTree.get_selected()
|
||||
else:
|
||||
parent = %PortraitTree.get_selected().get_parent()
|
||||
%PortraitTree.add_portrait_item(portrait_name, portrait_data, parent).select(0)
|
||||
something_changed()
|
||||
|
||||
|
||||
func add_portrait_group() -> void:
|
||||
var parent_item :TreeItem = %PortraitTree.get_root()
|
||||
if %PortraitTree.get_selected() and %PortraitTree.get_selected().get_metadata(0).has('group'):
|
||||
parent_item = %PortraitTree.get_selected()
|
||||
%PortraitTree.add_portrait_group("Group", parent_item)
|
||||
|
||||
|
||||
func load_portrait_tree() -> void:
|
||||
%PortraitTree.clear_tree()
|
||||
var root:TreeItem = %PortraitTree.create_item()
|
||||
|
||||
for portrait in current_resource.portraits.keys():
|
||||
var portrait_label = portrait
|
||||
var parent = %PortraitTree.get_root()
|
||||
if '/' in portrait:
|
||||
parent = %PortraitTree.create_necessary_group_items(portrait)
|
||||
portrait_label = portrait.split('/')[-1]
|
||||
|
||||
%PortraitTree.add_portrait_item(portrait_label, current_resource.portraits[portrait], parent)
|
||||
|
||||
update_default_portrait_star(current_resource.default_portrait)
|
||||
|
||||
if root.get_child_count():
|
||||
root.get_first_child().select(0)
|
||||
else:
|
||||
# Call anyways to clear preview and hide portrait settings section
|
||||
load_selected_portrait()
|
||||
|
||||
|
||||
func filter_portrait_list(filter_term:String = '') -> void:
|
||||
filter_branch(%PortraitTree.get_root(), filter_term)
|
||||
|
||||
|
||||
func filter_branch(parent:TreeItem, filter_term:String) -> bool:
|
||||
var anything_visible := false
|
||||
for item in parent.get_children():
|
||||
if item.get_metadata(0).has('group'):
|
||||
item.visible = filter_branch(item, filter_term)
|
||||
anything_visible = item.visible
|
||||
elif filter_term.is_empty() or filter_term.to_lower() in item.get_text(0).to_lower():
|
||||
item.visible = true
|
||||
anything_visible = true
|
||||
else:
|
||||
item.visible = false
|
||||
return anything_visible
|
||||
|
||||
|
||||
# this is used to save the portrait data
|
||||
func get_updated_portrait_dict() -> Dictionary:
|
||||
return list_portraits(%PortraitTree.get_root().get_children())
|
||||
|
||||
|
||||
func list_portraits(tree_items:Array[TreeItem], dict:Dictionary = {}, path_prefix = "") -> Dictionary:
|
||||
for item in tree_items:
|
||||
if item.get_metadata(0).has('group'):
|
||||
dict = list_portraits(item.get_children(), dict, path_prefix+item.get_text(0)+"/")
|
||||
else:
|
||||
dict[path_prefix +item.get_text(0)] = item.get_metadata(0)
|
||||
return dict
|
||||
|
||||
|
||||
func load_selected_portrait():
|
||||
if selected_item and is_instance_valid(selected_item):
|
||||
selected_item.set_editable(0, false)
|
||||
|
||||
selected_item = %PortraitTree.get_selected()
|
||||
|
||||
|
||||
if selected_item and !selected_item.get_metadata(0).has('group'):
|
||||
%PortraitSettingsSection.show()
|
||||
var current_portrait_data :Dictionary = selected_item.get_metadata(0)
|
||||
portrait_selected.emit(%PortraitTree.get_full_item_name(selected_item), current_portrait_data)
|
||||
|
||||
update_preview()
|
||||
|
||||
for tab in %PortraitSettingsSection.get_children():
|
||||
if !tab is DialogicCharacterEditorPortraitSettingsTab:
|
||||
printerr("[Dialogic Editor] Portrait settings tabs should extend the right class!")
|
||||
else:
|
||||
tab.selected_item = selected_item
|
||||
tab._load_portrait_data(current_portrait_data)
|
||||
|
||||
# switch tabs if the current one is hidden (until the next not hidden tab)
|
||||
for i in range(%PortraitSettingsSection.get_tab_count()):
|
||||
if %PortraitSettingsSection.is_tab_hidden(%PortraitSettingsSection.current_tab):
|
||||
if %PortraitSettingsSection.current_tab == %PortraitSettingsSection.get_tab_count()-1:
|
||||
%PortraitSettingsSection.current_tab = 0
|
||||
else:
|
||||
%PortraitSettingsSection.current_tab += 1
|
||||
else:
|
||||
break
|
||||
else:
|
||||
%PortraitSettingsSection.hide()
|
||||
update_preview()
|
||||
|
||||
if selected_item:
|
||||
await get_tree().create_timer(0.01).timeout
|
||||
selected_item.set_editable(0, true)
|
||||
|
||||
|
||||
func delete_portrait_item(item:TreeItem) -> void:
|
||||
item.free()
|
||||
something_changed()
|
||||
|
||||
|
||||
func duplicate_item(item:TreeItem) -> void:
|
||||
%PortraitTree.add_portrait_item(item.get_text(0)+'_duplicated', item.get_metadata(0), item.get_parent()).select(0)
|
||||
|
||||
|
||||
func _on_portrait_tree_button_clicked(item:TreeItem, column:int, id:int, mouse_button_index:int):
|
||||
# DELETE BUTTON
|
||||
if id == 1:
|
||||
delete_portrait_item(item)
|
||||
# DUPLICATE ITEM
|
||||
if id == 3:
|
||||
duplicate_item(item)
|
||||
|
||||
|
||||
# this removes/and adds the DEFAULT star on the portrait list
|
||||
func update_default_portrait_star(default_portrait_name:String) -> void:
|
||||
var item_list : Array = %PortraitTree.get_root().get_children()
|
||||
while true:
|
||||
var item = item_list.pop_back()
|
||||
if item.get_button_by_id(0, 2) != -1:
|
||||
item.erase_button(0, item.get_button_by_id(0, 2))
|
||||
if %PortraitTree.get_full_item_name(item) == default_portrait_name:
|
||||
item.erase_button(0, item.get_button_by_id(0, 1))
|
||||
item.erase_button(0, item.get_button_by_id(0, 3))
|
||||
item.add_button(0, get_theme_icon('Favorites', 'EditorIcons'), 2, true, 'Default')
|
||||
item.add_button(0, get_theme_icon('Duplicate', 'EditorIcons'), 3, false, 'Duplicate')
|
||||
item.add_button(0, get_theme_icon('Remove', 'EditorIcons'), 1, false, 'Remove')
|
||||
item_list.append_array(item.get_children())
|
||||
|
||||
if item_list.is_empty():
|
||||
break
|
||||
|
||||
|
||||
func _on_item_edited():
|
||||
selected_item = %PortraitTree.get_selected()
|
||||
something_changed()
|
||||
if selected_item:
|
||||
if %PreviewLabel.text.trim_prefix('Preview of "').trim_suffix('"') == current_resource.default_portrait:
|
||||
current_resource.default_portrait = %PortraitTree.get_full_item_name(selected_item)
|
||||
update_preview()
|
||||
|
||||
|
||||
|
||||
##############################################################################
|
||||
## PORTRAIT SETTINGS TAB
|
||||
##############################################################################
|
||||
|
||||
func setup_portrait_settings_tab() -> void:
|
||||
%DefaultPortraitPicker.value_changed.connect(default_portrait_changed)
|
||||
%MainScale.value_changed.connect(main_portrait_settings_update)
|
||||
%MainOffsetX.value_changed.connect(main_portrait_settings_update)
|
||||
%MainOffsetY.value_changed.connect(main_portrait_settings_update)
|
||||
%MainMirror.toggled.connect(main_portrait_settings_update)
|
||||
|
||||
# Setting up Default Portrait Picker
|
||||
%DefaultPortraitPicker.resource_icon = load("res://addons/dialogic/Editor/Images/Resources/portrait.svg")
|
||||
%DefaultPortraitPicker.get_suggestions_func = suggest_portraits
|
||||
%DefaultPortraitPicker.set_left_text("")
|
||||
|
||||
|
||||
# Make sure preview get's updated when portrait settings change
|
||||
func main_portrait_settings_update(value = null) -> void:
|
||||
current_resource.scale = %MainScale.value/100.0
|
||||
current_resource.offset = Vector2(%MainOffsetX.value, %MainOffsetY.value)
|
||||
current_resource.mirror = %MainMirror.button_pressed
|
||||
update_preview()
|
||||
something_changed()
|
||||
|
||||
|
||||
func default_portrait_changed(property:String, value:String) -> void:
|
||||
current_resource.default_portrait = value
|
||||
update_default_portrait_star(value)
|
||||
|
||||
|
||||
# Get suggestions for DefaultPortraitPicker
|
||||
func suggest_portraits(search:String) -> Dictionary:
|
||||
var suggestions := {}
|
||||
for portrait in get_updated_portrait_dict().keys():
|
||||
suggestions[portrait] = {'value':portrait}
|
||||
return suggestions
|
||||
|
||||
|
||||
##############################################################################
|
||||
## PREVIEW
|
||||
##############################################################################
|
||||
|
||||
func update_preview() -> void:
|
||||
%ScenePreviewWarning.hide()
|
||||
if selected_item and is_instance_valid(selected_item) and !selected_item.get_metadata(0).has('group'):
|
||||
%PreviewLabel.text = 'Preview of "'+%PortraitTree.get_full_item_name(selected_item)+'"'
|
||||
var current_portrait_data: Dictionary = selected_item.get_metadata(0)
|
||||
var mirror:bool = current_portrait_data.get('mirror', false) != current_resource.mirror
|
||||
var scale:float = current_portrait_data.get('scale', 1) * current_resource.scale
|
||||
var offset:Vector2 =current_portrait_data.get('offset', Vector2()) + current_resource.offset
|
||||
|
||||
if current_previewed_scene != null \
|
||||
and current_previewed_scene.get_meta('path', null) == current_portrait_data.get('scene') \
|
||||
and current_previewed_scene.has_method('_should_do_portrait_update') \
|
||||
and is_instance_valid(current_previewed_scene.get_script()) \
|
||||
and current_previewed_scene._should_do_portrait_update(current_resource, selected_item.get_text(0)):
|
||||
pass # we keep the same scene
|
||||
else:
|
||||
for node in %RealPreviewPivot.get_children():
|
||||
node.queue_free()
|
||||
current_previewed_scene = null
|
||||
if current_portrait_data.get('scene', '').is_empty():
|
||||
if FileAccess.file_exists("res://addons/dialogic/Events/Character/default_portrait.tscn"):
|
||||
current_previewed_scene = load("res://addons/dialogic/Events/Character/default_portrait.tscn").instantiate()
|
||||
current_previewed_scene.set_meta('path', '')
|
||||
else:
|
||||
if FileAccess.file_exists(current_portrait_data.get('scene')):
|
||||
current_previewed_scene = load(current_portrait_data.get('scene')).instantiate()
|
||||
current_previewed_scene.set_meta('path', current_portrait_data.get('scene'))
|
||||
if current_previewed_scene:
|
||||
%RealPreviewPivot.add_child(current_previewed_scene)
|
||||
|
||||
if current_previewed_scene != null:
|
||||
var scene = current_previewed_scene
|
||||
scene.show_behind_parent = true
|
||||
|
||||
for prop in current_portrait_data.get('export_overrides', {}).keys():
|
||||
scene.set(prop, str_to_var(current_portrait_data['export_overrides'][prop]))
|
||||
|
||||
if is_instance_valid(scene.get_script()) and scene.script.is_tool():
|
||||
if scene.has_method('_update_portrait'):
|
||||
scene._update_portrait(current_resource, %PortraitTree.get_full_item_name(selected_item))
|
||||
if scene.has_method('_set_mirror'):
|
||||
scene._set_mirror(mirror)
|
||||
if current_preview_mode == PreviewModes.Real:
|
||||
scene.position = Vector2() + offset
|
||||
|
||||
if current_portrait_data.get('scene', '').is_empty() or !current_portrait_data.get('ignore_char_scale', false):
|
||||
scene.scale = Vector2(1,1)*scale
|
||||
else:
|
||||
if is_instance_valid(scene.get_script()) and scene.script.is_tool() and scene.has_method('_get_covered_rect'):
|
||||
var rect :Rect2= scene._get_covered_rect()
|
||||
var available_rect:Rect2 = %FullPreviewAvailableRect.get_rect()
|
||||
scene.scale = Vector2(1,1) * min(available_rect.size.x/rect.size.x, available_rect.size.y/rect.size.y)
|
||||
%RealPreviewPivot.position = (rect.position)*-1*scene.scale
|
||||
%RealPreviewPivot.position.x = %FullPreviewAvailableRect.size.x/2
|
||||
scene.position = Vector2()
|
||||
else:
|
||||
%ScenePreviewWarning.show()
|
||||
else:
|
||||
%PreviewRealRect.texture = null
|
||||
%PreviewFullRect.texture = null
|
||||
%PreviewLabel.text = 'Nothing to preview'
|
||||
|
||||
else:
|
||||
%PreviewLabel.text = 'No portrait to preview.'
|
||||
for node in %RealPreviewPivot.get_children():
|
||||
node.queue_free()
|
||||
current_previewed_scene = null
|
||||
|
||||
|
||||
func _on_PreviewMode_item_selected(index:int) -> void:
|
||||
current_preview_mode = index
|
||||
# FULL VIEW
|
||||
if index == PreviewModes.Full:
|
||||
%RealSizeRemotePivotTransform.update_position = false
|
||||
# REAL SIZE
|
||||
if index == PreviewModes.Real or index == null:
|
||||
%RealSizeRemotePivotTransform.update_position = true
|
||||
update_preview()
|
||||
ProjectSettings.set_setting('dialogic/editor/character_preview_mode', index)
|
||||
ProjectSettings.save()
|
||||
|
||||
|
||||
func _on_full_preview_available_rect_resized():
|
||||
if current_preview_mode == PreviewModes.Full:
|
||||
update_preview()
|
||||
|
||||
|
|
@ -0,0 +1,493 @@
|
|||
[gd_scene load_steps=15 format=3 uid="uid://dlskc36c5hrwv"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="2_01va3"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_ptab_image.gd" id="2_cusvj"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_ptab_scene.gd" id="4_6tltp"]
|
||||
[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/FilePicker.tscn" id="4_a4bcu"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_ptab_layout.gd" id="5_eicvp"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_ptab_exports.gd" id="7_4enie"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kxihh"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_width_top = 2
|
||||
border_color = Color(1, 1, 1, 0.75)
|
||||
corner_detail = 1
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1pdx5"]
|
||||
content_margin_left = 7.5
|
||||
content_margin_top = 7.5
|
||||
content_margin_right = 7.5
|
||||
content_margin_bottom = 7.5
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[sub_resource type="Image" id="Image_8q5e2"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_uf4x7"]
|
||||
image = SubResource("Image_8q5e2")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4xgdx"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_81xk6"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(1, 0.365, 0.365, 1)
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
corner_detail = 1
|
||||
|
||||
[node name="CharacterEditor" type="MarginContainer"]
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 0
|
||||
theme_override_constants/margin_top = 0
|
||||
theme_override_constants/margin_right = 0
|
||||
theme_override_constants/margin_bottom = 0
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Split" type="HSplitContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Editor" type="VSplitContainer" parent="Split"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 11
|
||||
|
||||
[node name="EditorScroll" type="ScrollContainer" parent="Split/Editor"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.0
|
||||
vertical_scroll_mode = 0
|
||||
|
||||
[node name="MainEditTabs" type="TabContainer" parent="Split/Editor/EditorScroll"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/side_margin = 5
|
||||
theme_override_styles/tab_selected = SubResource("StyleBoxFlat_kxihh")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_1pdx5")
|
||||
|
||||
[node name="PortraitListSection" type="TabContainer" parent="Split/Editor"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_constants/side_margin = 5
|
||||
theme_override_styles/tab_selected = SubResource("StyleBoxFlat_kxihh")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_1pdx5")
|
||||
|
||||
[node name="Portraits" type="VBoxContainer" parent="Split/Editor/PortraitListSection"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PortraitListTools" type="HBoxContainer" parent="Split/Editor/PortraitListSection/Portraits"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="AddPortraitButton" type="Button" parent="Split/Editor/PortraitListSection/Portraits/PortraitListTools"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Add portrait"
|
||||
icon = SubResource("ImageTexture_uf4x7")
|
||||
|
||||
[node name="AddPortraitGroupButton" type="Button" parent="Split/Editor/PortraitListSection/Portraits/PortraitListTools"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Add Group"
|
||||
icon = SubResource("ImageTexture_uf4x7")
|
||||
|
||||
[node name="ImportPortraitsButton" type="Button" parent="Split/Editor/PortraitListSection/Portraits/PortraitListTools"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Import images from folder"
|
||||
icon = SubResource("ImageTexture_uf4x7")
|
||||
|
||||
[node name="PortraitSearch" type="LineEdit" parent="Split/Editor/PortraitListSection/Portraits/PortraitListTools"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
placeholder_text = "Search"
|
||||
expand_to_text_length = true
|
||||
clear_button_enabled = true
|
||||
right_icon = SubResource("ImageTexture_uf4x7")
|
||||
caret_blink = true
|
||||
caret_blink_interval = 0.5
|
||||
|
||||
[node name="Panel" type="PanelContainer" parent="Split/Editor/PortraitListSection/Portraits"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_4xgdx")
|
||||
|
||||
[node name="PortraitTree" type="Tree" parent="Split/Editor/PortraitListSection/Portraits/Panel"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
allow_rmb_select = true
|
||||
hide_root = true
|
||||
drop_mode_flags = 1
|
||||
script = ExtResource("2_vad0i")
|
||||
|
||||
[node name="P Settings" type="VBoxContainer" parent="Split/Editor/PortraitListSection"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DefaultPortrait" type="HBoxContainer" parent="Split/Editor/PortraitListSection/P Settings"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label5" type="Label" parent="Split/Editor/PortraitListSection/P Settings/DefaultPortrait"]
|
||||
layout_mode = 2
|
||||
text = "Default:"
|
||||
|
||||
[node name="DefaultPortraitPicker" parent="Split/Editor/PortraitListSection/P Settings/DefaultPortrait" instance=ExtResource("2_01va3")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Select Portrait"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Split/Editor/PortraitListSection/P Settings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PortraitMainSettings" type="HFlowContainer" parent="Split/Editor/PortraitListSection/P Settings"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings"]
|
||||
layout_mode = 2
|
||||
text = "Scale"
|
||||
|
||||
[node name="MainScale" type="SpinBox" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
value = 100.0
|
||||
allow_greater = true
|
||||
suffix = "%"
|
||||
|
||||
[node name="Offset" type="HBoxContainer" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/Offset"]
|
||||
layout_mode = 2
|
||||
text = "Offset"
|
||||
|
||||
[node name="MainOffsetX" type="SpinBox" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/Offset"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
allow_greater = true
|
||||
allow_lesser = true
|
||||
suffix = "X"
|
||||
|
||||
[node name="MainOffsetY" type="SpinBox" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/Offset"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
allow_greater = true
|
||||
allow_lesser = true
|
||||
suffix = "Y"
|
||||
|
||||
[node name="MirrorOption" type="HBoxContainer" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/MirrorOption"]
|
||||
layout_mode = 2
|
||||
text = "Mirror"
|
||||
|
||||
[node name="MainMirror" type="CheckBox" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/MirrorOption"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RightSection" type="VSplitContainer" parent="Split"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 1.5
|
||||
|
||||
[node name="PortraitPreviewSection" type="Panel" parent="Split/RightSection"]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_1pdx5")
|
||||
|
||||
[node name="Node2D" type="Node2D" parent="Split/RightSection/PortraitPreviewSection"]
|
||||
position = Vector2(13, 17)
|
||||
|
||||
[node name="RealPreviewPivot" type="Sprite2D" parent="Split/RightSection/PortraitPreviewSection/Node2D"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(330, 405)
|
||||
texture = SubResource("ImageTexture_uf4x7")
|
||||
|
||||
[node name="ScenePreviewWarning" type="Label" parent="Split/RightSection/PortraitPreviewSection"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -143.0
|
||||
offset_top = -44.5
|
||||
offset_right = 143.0
|
||||
offset_bottom = 85.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Custom scenes can only be viewed in \"Full mode\" if they are in @tool mode and override _get_covered_rect"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 3
|
||||
metadata/_edit_layout_mode = 1
|
||||
|
||||
[node name="PreviewReal" type="CenterContainer" parent="Split/RightSection/PortraitPreviewSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -302.0
|
||||
offset_top = -139.0
|
||||
offset_right = 302.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
metadata/_edit_layout_mode = 1
|
||||
|
||||
[node name="Control" type="Control" parent="Split/RightSection/PortraitPreviewSection/PreviewReal"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RealSizeRemotePivotTransform" type="RemoteTransform2D" parent="Split/RightSection/PortraitPreviewSection/PreviewReal/Control"]
|
||||
unique_name_in_owner = true
|
||||
remote_path = NodePath("../../../Node2D/RealPreviewPivot")
|
||||
update_position = false
|
||||
update_rotation = false
|
||||
update_scale = false
|
||||
|
||||
[node name="FullPreviewAvailableRect" type="Control" parent="Split/RightSection/PortraitPreviewSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 10.0
|
||||
offset_top = 13.0
|
||||
offset_right = -10.0
|
||||
offset_bottom = -16.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
metadata/_edit_layout_mode = 1
|
||||
|
||||
[node name="PreviewLabel" type="Label" parent="Split/RightSection/PortraitPreviewSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 23.0
|
||||
text = "No portrait to preview."
|
||||
|
||||
[node name="PreviewMode" type="OptionButton" parent="Split/RightSection/PortraitPreviewSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -121.0
|
||||
offset_top = 9.0
|
||||
offset_right = -9.0
|
||||
offset_bottom = 40.0
|
||||
grow_horizontal = 0
|
||||
item_count = 2
|
||||
selected = 0
|
||||
popup/item_0/text = "Full View"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Real Size"
|
||||
popup/item_1/id = 1
|
||||
metadata/_edit_layout_mode = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Split/RightSection/PortraitPreviewSection"]
|
||||
layout_mode = 0
|
||||
offset_top = -12.0
|
||||
offset_right = 597.0
|
||||
offset_bottom = -12.0
|
||||
|
||||
[node name="PortraitSettingsSection" type="TabContainer" parent="Split/RightSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 0.3
|
||||
theme_override_constants/side_margin = 5
|
||||
theme_override_styles/tab_selected = SubResource("StyleBoxFlat_kxihh")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_1pdx5")
|
||||
|
||||
[node name="Image" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"]
|
||||
custom_minimum_size = Vector2(0, 35)
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
script = ExtResource("2_cusvj")
|
||||
|
||||
[node name="Flow" type="HFlowContainer" parent="Split/RightSection/PortraitSettingsSection/Image"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="Split/RightSection/PortraitSettingsSection/Image/Flow"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
columns = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Split/RightSection/PortraitSettingsSection/Image/Flow/GridContainer"]
|
||||
layout_mode = 2
|
||||
text = "Image: "
|
||||
|
||||
[node name="ImagePicker" parent="Split/RightSection/PortraitSettingsSection/Image/Flow/GridContainer" instance=ExtResource("4_a4bcu")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
file_filter = "*.png, *.svg"
|
||||
resource_icon = SubResource("ImageTexture_uf4x7")
|
||||
|
||||
[node name="Scene" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(0, 35)
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
script = ExtResource("4_6tltp")
|
||||
|
||||
[node name="Flow" type="HFlowContainer" parent="Split/RightSection/PortraitSettingsSection/Scene"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
columns = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer"]
|
||||
layout_mode = 2
|
||||
text = "Scene: "
|
||||
|
||||
[node name="ScenePicker" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer" instance=ExtResource("4_a4bcu")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
file_filter = "*.tscn"
|
||||
placeholder = "Default scene"
|
||||
resource_icon = SubResource("ImageTexture_uf4x7")
|
||||
|
||||
[node name="Label2" type="Label" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer"]
|
||||
layout_mode = 2
|
||||
text = "Ignore scale: "
|
||||
|
||||
[node name="IgnoreScale" type="CheckBox" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Layout" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(0, 35)
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
script = ExtResource("5_eicvp")
|
||||
|
||||
[node name="Flow" type="HFlowContainer" parent="Split/RightSection/PortraitSettingsSection/Layout"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Scale:"
|
||||
|
||||
[node name="PortraitScale" type="SpinBox" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
value = 100.0
|
||||
allow_greater = true
|
||||
suffix = "%"
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Offset:"
|
||||
|
||||
[node name="PortraitOffsetX" type="SpinBox" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
allow_greater = true
|
||||
allow_lesser = true
|
||||
suffix = "X"
|
||||
|
||||
[node name="PortraitOffsetY" type="SpinBox" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
allow_greater = true
|
||||
allow_lesser = true
|
||||
suffix = "Y"
|
||||
|
||||
[node name="MirrorOption" type="HBoxContainer" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/MirrorOption"]
|
||||
layout_mode = 2
|
||||
text = "Mirror:"
|
||||
|
||||
[node name="PortraitMirror" type="CheckBox" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/MirrorOption"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Exports" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(0, 35)
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_81xk6")
|
||||
horizontal_scroll_mode = 0
|
||||
script = ExtResource("7_4enie")
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="Split/RightSection/PortraitSettingsSection/Exports"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/h_separation = 10
|
||||
columns = 2
|
||||
|
||||
[connection signal="button_clicked" from="Split/Editor/PortraitListSection/Portraits/Panel/PortraitTree" to="." method="_on_portrait_tree_button_clicked"]
|
||||
[connection signal="resized" from="Split/RightSection/PortraitPreviewSection/FullPreviewAvailableRect" to="." method="_on_full_preview_available_rect_resized"]
|
||||
[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Image/Flow/GridContainer/ImagePicker" to="Split/RightSection/PortraitSettingsSection/Image" method="_on_image_picker_value_changed"]
|
||||
[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer/ScenePicker" to="Split/RightSection/PortraitSettingsSection/Scene" method="_on_scene_picker_value_changed"]
|
||||
[connection signal="toggled" from="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer/IgnoreScale" to="Split/RightSection/PortraitSettingsSection/Scene" method="_on_ignore_scale_toggled"]
|
||||
[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer/PortraitScale" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_scale_value_changed"]
|
||||
[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2/PortraitOffsetX" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_offset_x_value_changed"]
|
||||
[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2/PortraitOffsetY" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_offset_y_value_changed"]
|
||||
[connection signal="toggled" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/MirrorOption/PortraitMirror" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_mirror_toggled"]
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
@tool
|
||||
class_name DialogicCharacterEditorMainTab
|
||||
extends Control
|
||||
|
||||
## Base class for all character editor main tabs. Methods should be overriden.
|
||||
|
||||
|
||||
# Emit this, if something changed
|
||||
signal changed
|
||||
|
||||
|
||||
var character_editor:Control
|
||||
|
||||
|
||||
func _load_character(resource:DialogicCharacter) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _save_changes(resource:DialogicCharacter) -> DialogicCharacter:
|
||||
return resource
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
@tool
|
||||
class_name DialogicCharacterEditorPortraitSettingsTab
|
||||
extends ScrollContainer
|
||||
|
||||
## Base class for all portrait settings tabs. Methods should be overriden.
|
||||
|
||||
# Emit this, if something changed
|
||||
signal changed
|
||||
signal update_preview
|
||||
|
||||
var character_editor:Control
|
||||
|
||||
var selected_item :TreeItem = null
|
||||
|
||||
func _load_portrait_data(data:Dictionary) -> void:
|
||||
pass
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
@tool
|
||||
extends Tree
|
||||
|
||||
## Tree that displays the portrait list as a hirarchy
|
||||
|
||||
var editor := find_parent('Character Editor')
|
||||
var current_group_nodes := {}
|
||||
|
||||
|
||||
func clear_tree() -> void:
|
||||
clear()
|
||||
current_group_nodes = {}
|
||||
|
||||
|
||||
func add_portrait_item(portrait_name:String, portrait_data:Dictionary, parent_item:TreeItem) -> TreeItem:
|
||||
var item :TreeItem = %PortraitTree.create_item(parent_item)
|
||||
item.set_text(0, portrait_name)
|
||||
item.set_metadata(0, portrait_data)
|
||||
if portrait_name == editor.current_resource.default_portrait:
|
||||
item.add_button(0, get_theme_icon('Favorites', 'EditorIcons'), 2, true, 'Default')
|
||||
item.add_button(0, get_theme_icon('Duplicate', 'EditorIcons'), 3, false, 'Duplicate')
|
||||
item.add_button(0, get_theme_icon('Remove', 'EditorIcons'), 1, false, 'Remove')
|
||||
return item
|
||||
|
||||
|
||||
func add_portrait_group(goup_name:String = "Group", parent_item:TreeItem = get_root()):
|
||||
var item :TreeItem = %PortraitTree.create_item(parent_item)
|
||||
item.set_icon(0, get_theme_icon("Groups", "EditorIcons"))
|
||||
item.set_text(0, goup_name)
|
||||
item.set_metadata(0, {'group':true})
|
||||
item.add_button(0, get_theme_icon('Remove', 'EditorIcons'), 1, false, 'Remove')
|
||||
return item
|
||||
|
||||
|
||||
func get_full_item_name(item:TreeItem) -> String:
|
||||
var item_name := item.get_text(0)
|
||||
while item.get_parent() != get_root() and item != get_root():
|
||||
item_name = item.get_parent().get_text(0)+"/"+item_name
|
||||
item = item.get_parent()
|
||||
return item_name
|
||||
|
||||
|
||||
# Will create all not yet existing folders in the given path.
|
||||
# Returns the last folder (the parent of the portrait item of this path).
|
||||
func create_necessary_group_items(path:String) -> void:
|
||||
var last_item := get_root()
|
||||
var item_path := ""
|
||||
|
||||
for i in Array(path.split('/')).slice(0, -1):
|
||||
item_path += "/"+i
|
||||
item_path = item_path.trim_prefix('/')
|
||||
if current_group_nodes.has(item_path+"/"+i):
|
||||
last_item = current_group_nodes[item_path+"/"+i]
|
||||
else:
|
||||
var new_item := add_portrait_group(i, last_item)
|
||||
current_group_nodes[item_path+"/"+i] = new_item
|
||||
last_item = new_item
|
||||
return last_item
|
||||
|
||||
|
||||
################################################################################
|
||||
## DRAG AND DROP
|
||||
################################################################################
|
||||
|
||||
func _get_drag_data(position:Vector2) -> Variant:
|
||||
set_drop_mode_flags(DROP_MODE_ON_ITEM)
|
||||
|
||||
var preview := Label.new()
|
||||
preview.text = " "+get_selected().get_text(0)
|
||||
preview.add_theme_stylebox_override('normal', get_theme_stylebox("Background", "EditorStyles"))
|
||||
set_drag_preview(preview)
|
||||
|
||||
return get_selected()
|
||||
|
||||
|
||||
func _can_drop_data(position:Vector2, data:Variant) -> bool:
|
||||
return data is TreeItem
|
||||
|
||||
|
||||
func _drop_data(position:Vector2, item:Variant) -> void:
|
||||
var to_item := get_item_at_position(position)
|
||||
if to_item:
|
||||
var test_item:= to_item
|
||||
while true:
|
||||
if test_item == item:
|
||||
return
|
||||
test_item = test_item.get_parent()
|
||||
if test_item == get_root():
|
||||
break
|
||||
|
||||
var parent := get_root()
|
||||
if to_item:
|
||||
parent = to_item.get_parent()
|
||||
|
||||
if to_item and to_item.get_metadata(0).has('group'):
|
||||
parent = to_item
|
||||
|
||||
var new_item := copy_branch_or_item(item, parent)
|
||||
|
||||
if to_item and !to_item.get_metadata(0).has('group'):
|
||||
new_item.move_after(to_item)
|
||||
|
||||
item.free()
|
||||
|
||||
|
||||
func copy_branch_or_item(item:TreeItem, new_parent:TreeItem) -> TreeItem:
|
||||
var new_item :TreeItem = null
|
||||
if item.get_metadata(0).has('group'):
|
||||
new_item = add_portrait_group(item.get_text(0), new_parent)
|
||||
else:
|
||||
new_item = add_portrait_item(item.get_text(0), item.get_metadata(0), new_parent)
|
||||
|
||||
for child in item.get_children():
|
||||
copy_branch_or_item(child, new_item)
|
||||
return new_item
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
@tool
|
||||
extends DialogicCharacterEditorPortraitSettingsTab
|
||||
|
||||
## Tab that allows setting values of exported scene variables
|
||||
## for custom portrait scenes
|
||||
|
||||
var current_portrait_data := {}
|
||||
|
||||
func _ready() -> void:
|
||||
get_parent().set_tab_icon(get_index(), get_theme_icon("EditInternal", "EditorIcons"))
|
||||
add_theme_stylebox_override('panel', get_theme_stylebox("Background", "EditorStyles"))
|
||||
|
||||
func _load_portrait_data(data:Dictionary) -> void:
|
||||
if data.get('scene', '').is_empty():
|
||||
get_parent().set_tab_hidden(get_index(), true)
|
||||
else:
|
||||
get_parent().set_tab_hidden(get_index(), false)
|
||||
|
||||
current_portrait_data = data
|
||||
load_portrait_scene_export_variables()
|
||||
|
||||
func load_portrait_scene_export_variables():
|
||||
var scene = null
|
||||
if !current_portrait_data.get('scene', '').is_empty():
|
||||
scene = load(current_portrait_data.get('scene'))
|
||||
|
||||
if !scene:
|
||||
return
|
||||
|
||||
for child in $Grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
scene = scene.instantiate()
|
||||
for i in scene.script.get_script_property_list():
|
||||
if i['usage'] & PROPERTY_USAGE_EDITOR:
|
||||
var label = Label.new()
|
||||
label.text = i['name']
|
||||
label.add_theme_stylebox_override('normal', get_theme_stylebox("CanvasItemInfoOverlay", "EditorStyles"))
|
||||
label.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
$Grid.add_child(label)
|
||||
|
||||
|
||||
var input = null
|
||||
var current_value :String = ""
|
||||
if current_portrait_data.has('export_overrides') and current_portrait_data['export_overrides'].has(i['name']):
|
||||
current_value = current_portrait_data['export_overrides'][i['name']]
|
||||
match typeof(scene.get(i['name'])):
|
||||
TYPE_BOOL:
|
||||
input = CheckBox.new()
|
||||
if current_value:
|
||||
input.button_pressed = current_value == "true"
|
||||
input.toggled.connect(_on_export_bool_submitted.bind(i['name']))
|
||||
TYPE_COLOR:
|
||||
input = ColorPickerButton.new()
|
||||
if current_value:
|
||||
input.color = str_to_var(current_value)
|
||||
input.color_changed.connect(_on_export_color_submitted.bind(i['name']))
|
||||
input.custom_minimum_size.x = DialogicUtil.get_editor_scale()*50
|
||||
TYPE_INT:
|
||||
if i['hint'] & PROPERTY_HINT_ENUM:
|
||||
input = OptionButton.new()
|
||||
for x in i['hint_string'].split(','):
|
||||
input.add_item(x)
|
||||
input.item_selected.connect(_on_export_int_enum_submitted.bind(i['name']))
|
||||
_:
|
||||
input = LineEdit.new()
|
||||
if current_value:
|
||||
input.text = current_value
|
||||
input.text_submitted.connect(_on_export_input_text_submitted.bind(i['name']))
|
||||
input.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
$Grid.add_child(input)
|
||||
if i['usage'] & PROPERTY_USAGE_GROUP:
|
||||
var title := Label.new()
|
||||
title.text = i['name']
|
||||
title.add_theme_stylebox_override('normal', get_theme_stylebox("ContextualToolbar", "EditorStyles"))
|
||||
$Grid.add_child(title)
|
||||
$Grid.add_child(Control.new())
|
||||
|
||||
func set_export_override(property_name:String, value:String = "") -> void:
|
||||
var data:Dictionary = selected_item.get_metadata(0)
|
||||
if !data.has('export_overrides'):
|
||||
data['export_overrides'] = {}
|
||||
|
||||
if !value.is_empty():
|
||||
data['export_overrides'][property_name] = value
|
||||
else:
|
||||
data['export_overrides'].erase(property_name)
|
||||
|
||||
changed.emit()
|
||||
update_preview.emit()
|
||||
|
||||
func _on_export_input_text_submitted(text:String, property_name:String) -> void:
|
||||
set_export_override(property_name, var_to_str(text))
|
||||
|
||||
func _on_export_bool_submitted(value:bool, property_name:String) -> void:
|
||||
set_export_override(property_name, var_to_str(value))
|
||||
|
||||
func _on_export_color_submitted(color:Color, property_name:String) -> void:
|
||||
set_export_override(property_name, var_to_str(color))
|
||||
|
||||
func _on_export_int_enum_submitted(item:int, property_name:String) -> void:
|
||||
set_export_override(property_name, var_to_str(item))
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
@tool
|
||||
extends DialogicCharacterEditorPortraitSettingsTab
|
||||
|
||||
## Tab that allows setting an image file on a portrait.
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
get_parent().set_tab_icon(get_index(), get_theme_icon('Image', 'EditorIcons'))
|
||||
%ImagePicker.file_filter = "*.png, *.svg"
|
||||
%ImagePicker.resource_icon = get_theme_icon('Image', 'EditorIcons')
|
||||
|
||||
|
||||
func _load_portrait_data(data:Dictionary) -> void:
|
||||
# hides/shows this tab based on the scene value of this portrait
|
||||
# (only shown if the default scene is used)
|
||||
get_parent().set_tab_hidden(get_index(), !data.get('scene', '').is_empty())
|
||||
|
||||
%ImagePicker.set_value(data.get('image', ''))
|
||||
|
||||
|
||||
func _on_image_picker_value_changed(prop_name:String, value:String):
|
||||
var data:Dictionary = selected_item.get_metadata(0)
|
||||
data['image'] = value
|
||||
changed.emit()
|
||||
update_preview.emit()
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
@tool
|
||||
extends DialogicCharacterEditorPortraitSettingsTab
|
||||
|
||||
## Tab that allows setting size, offset and mirror of a portrait.
|
||||
|
||||
|
||||
func _ready():
|
||||
get_parent().set_tab_icon(get_index(), get_theme_icon('EditorPivot', 'EditorIcons'))
|
||||
|
||||
|
||||
func _load_portrait_data(data:Dictionary) -> void:
|
||||
%PortraitScale.value = data.get('scale', 1.0)*100
|
||||
%PortraitOffsetX.value = data.get('offset', Vector2()).x
|
||||
%PortraitOffsetY.value = data.get('offset', Vector2()).y
|
||||
%PortraitMirror.button_pressed = data.get('mirror', false)
|
||||
|
||||
|
||||
func _on_portrait_scale_value_changed(value) -> void:
|
||||
var data:Dictionary = selected_item.get_metadata(0)
|
||||
data['scale'] = value/100.0
|
||||
update_preview.emit()
|
||||
changed.emit()
|
||||
|
||||
|
||||
func _on_portrait_offset_x_value_changed(value) -> void:
|
||||
var data:Dictionary = selected_item.get_metadata(0)
|
||||
data['offset'] = data.get('offset', Vector2())
|
||||
data['offset'].x = value
|
||||
update_preview.emit()
|
||||
changed.emit()
|
||||
|
||||
func _on_portrait_offset_y_value_changed(value)-> void:
|
||||
var data:Dictionary = selected_item.get_metadata(0)
|
||||
data['offset'] = data.get('offset', Vector2())
|
||||
data['offset'].y = value
|
||||
update_preview.emit()
|
||||
changed.emit()
|
||||
|
||||
func _on_portrait_mirror_toggled(button_pressed:bool)-> void:
|
||||
var data:Dictionary = selected_item.get_metadata(0)
|
||||
data['mirror'] = button_pressed
|
||||
update_preview.emit()
|
||||
changed.emit()
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
@tool
|
||||
extends DialogicCharacterEditorPortraitSettingsTab
|
||||
|
||||
## Tab that allows setting a custom scene.
|
||||
|
||||
|
||||
func _ready():
|
||||
get_parent().set_tab_icon(get_index(), get_theme_icon('PackedScene', 'EditorIcons'))
|
||||
%ScenePicker.file_filter = "*.tscn"
|
||||
%ScenePicker.resource_icon = get_theme_icon('PackedScene', 'EditorIcons')
|
||||
%ScenePicker.placeholder = 'Default scene'
|
||||
|
||||
|
||||
func _load_portrait_data(data:Dictionary) -> void:
|
||||
%ScenePicker.set_value(data.get('scene', ''))
|
||||
%IgnoreScale.button_pressed = data.get('ignore_char_scale', false)
|
||||
|
||||
|
||||
func _on_scene_picker_value_changed(prop_name:String, value:String) -> void:
|
||||
var data:Dictionary = selected_item.get_metadata(0)
|
||||
data['scene'] = value
|
||||
update_preview.emit()
|
||||
changed.emit()
|
||||
|
||||
|
||||
func _on_ignore_scale_toggled(button_pressed):
|
||||
var data:Dictionary = selected_item.get_metadata(0)
|
||||
data['ignore_char_scale'] = button_pressed
|
||||
update_preview.emit()
|
||||
changed.emit()
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
@tool
|
||||
extends DialogicCharacterEditorMainTab
|
||||
|
||||
## The general character settings tab
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Connecting all necessary signals
|
||||
%ColorPickerButton.color_changed.connect(character_editor.something_changed)
|
||||
%DisplayNameLineEdit.text_changed.connect(character_editor.something_changed)
|
||||
%NicknameLineEdit.text_changed.connect(character_editor.something_changed)
|
||||
%DescriptionTextEdit.text_changed.connect(character_editor.something_changed)
|
||||
|
||||
|
||||
func _load_character(resource:DialogicCharacter) -> void:
|
||||
%DisplayNameLineEdit.text = resource.display_name
|
||||
%ColorPickerButton.color = resource.color
|
||||
|
||||
%NicknameLineEdit.text = ""
|
||||
for nickname in resource.nicknames:
|
||||
%NicknameLineEdit.text += nickname +", "
|
||||
%NicknameLineEdit.text = %NicknameLineEdit.text.trim_suffix(', ')
|
||||
|
||||
%DescriptionTextEdit.text = resource.description
|
||||
|
||||
|
||||
func _save_changes(resource:DialogicCharacter) -> DialogicCharacter:
|
||||
resource.display_name = %DisplayNameLineEdit.text
|
||||
resource.color = %ColorPickerButton.color
|
||||
var nicknames := []
|
||||
for n_name in %NicknameLineEdit.text.split(','):
|
||||
nicknames.append(n_name.strip_edges())
|
||||
resource.nicknames = nicknames
|
||||
resource.description = %DescriptionTextEdit.text
|
||||
|
||||
return resource
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://de5kj4vd0we1w"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.gd" id="1_3e1i1"]
|
||||
|
||||
[node name="General" type="GridContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 7.5
|
||||
offset_top = 38.5
|
||||
offset_right = -7.5
|
||||
offset_bottom = -7.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/h_separation = 1
|
||||
theme_override_constants/v_separation = 6
|
||||
columns = 2
|
||||
script = ExtResource("1_3e1i1")
|
||||
|
||||
[node name="Label2" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
text = "Display Name: "
|
||||
|
||||
[node name="DisplayName" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="DisplayNameLineEdit" type="LineEdit" parent="DisplayName"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "This name will be displayed on the name label. You can use a dialogic variable. E.g. :{Player.name}"
|
||||
expand_to_text_length = true
|
||||
caret_blink = true
|
||||
caret_blink_interval = 0.5
|
||||
|
||||
[node name="ColorPickerButton" type="ColorPickerButton" parent="DisplayName"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(30, 0)
|
||||
layout_mode = 2
|
||||
tooltip_text = "This color can be used on the name label and for occurences of the characters name in text (autocolor names)."
|
||||
color = Color(1, 1, 1, 1)
|
||||
edit_alpha = false
|
||||
|
||||
[node name="Label3" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
text = "Nicknames:"
|
||||
|
||||
[node name="NicknameLineEdit" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
tooltip_text = "If autocolor names is enabled, these will be colored in the characters color as well."
|
||||
caret_blink = true
|
||||
caret_blink_interval = 0.5
|
||||
|
||||
[node name="Label4" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Description:"
|
||||
|
||||
[node name="DescriptionTextEdit" type="TextEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
tooltip_text = "No effect, just for you."
|
||||
wrap_mode = 1
|
||||
scroll_fit_content_height = true
|
||||
60
Sprout/addons/dialogic/Editor/Common/DCSS.gd
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
@tool
|
||||
class_name DCSS
|
||||
|
||||
static func get_editor_scale() -> float:
|
||||
return DialogicUtil.get_editor_scale()
|
||||
|
||||
static func inline(style:Dictionary) -> StyleBoxFlat:
|
||||
var scale:float = get_editor_scale()
|
||||
var s := StyleBoxFlat.new()
|
||||
for property in style.keys():
|
||||
match property:
|
||||
'border-left':
|
||||
s.set('border_width_left', style[property] * scale)
|
||||
'border-radius':
|
||||
var radius:float = style[property] * scale
|
||||
s.set('corner_radius_top_left', radius)
|
||||
s.set('corner_radius_top_right', radius)
|
||||
s.set('corner_radius_bottom_left', radius)
|
||||
s.set('corner_radius_bottom_right', radius)
|
||||
'background':
|
||||
s.set('bg_color', style[property])
|
||||
'border':
|
||||
var width:float = style[property] * scale
|
||||
s.set('border_width_left', width)
|
||||
s.set('border_width_right', width)
|
||||
s.set('border_width_top', width)
|
||||
s.set('border_width_bottom', width)
|
||||
'border-color':
|
||||
s.set('border_color', style[property])
|
||||
'padding':
|
||||
var value_v: float = 0.0
|
||||
var value_h: float = 0.0
|
||||
if style[property] is int:
|
||||
value_v = style[property] * scale
|
||||
value_h = value_v
|
||||
else:
|
||||
value_v = style[property][0] * scale
|
||||
value_h = style[property][1] * scale
|
||||
s.set('content_margin_top', value_v)
|
||||
s.set('content_margin_bottom', value_v)
|
||||
s.set('content_margin_left', value_h)
|
||||
s.set('content_margin_right', value_h)
|
||||
'padding-right':
|
||||
s.set('content_margin_right', style[property] * scale)
|
||||
'padding-left':
|
||||
s.set('content_margin_left', style[property] * scale)
|
||||
return s
|
||||
|
||||
static func style(node, style:Dictionary) -> StyleBoxFlat:
|
||||
var scale:float = get_editor_scale()
|
||||
var s:StyleBoxFlat = inline(style)
|
||||
|
||||
node.set('theme_override_styles/normal', s)
|
||||
node.set('theme_override_styles/focus', s)
|
||||
node.set('theme_override_styles/read_only', s)
|
||||
node.set('theme_override_styles/hover', s)
|
||||
node.set('theme_override_styles/pressed', s)
|
||||
node.set('theme_override_styles/disabled', s)
|
||||
node.set('theme_override_styles/panel', s)
|
||||
return s
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dmsjhgv22dns8"]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 5.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_right = 5.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color(0.545098, 0.545098, 0.545098, 0.211765)
|
||||
121
Sprout/addons/dialogic/Editor/Common/side_bar.tscn
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://cwe3r2tbh2og1"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Common/sidebar.gd" id="1_jnq65"]
|
||||
|
||||
[sub_resource type="Image" id="Image_32i3u"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_4kt7t"]
|
||||
image = SubResource("Image_32i3u")
|
||||
|
||||
[sub_resource type="Image" id="Image_u4vxh"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_41bcg"]
|
||||
image = SubResource("Image_u4vxh")
|
||||
|
||||
[node name="SideBar" type="VSplitContainer"]
|
||||
custom_minimum_size = Vector2(100, 130)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
split_offset = 100
|
||||
script = ExtResource("1_jnq65")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 5
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="IconButtons" type="HFlowContainer" parent="VBoxContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CurrentResource" type="Label" parent="VBoxContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CustomButtons" type="VBoxContainer" parent="VBoxContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 7
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="Panel" type="PanelContainer" parent="VBoxContainer/VBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Search" type="LineEdit" parent="VBoxContainer/VBox/Panel"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
placeholder_text = "Filter Resources"
|
||||
right_icon = SubResource("ImageTexture_4kt7t")
|
||||
caret_blink = true
|
||||
caret_blink_interval = 0.5
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/VBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ResourcesList" type="ItemList" parent="VBoxContainer/VBox/PanelContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
item_count = 1
|
||||
same_column_width = true
|
||||
item_0/text = "Chapter1.dtl"
|
||||
item_0/icon = SubResource("ImageTexture_41bcg")
|
||||
|
||||
[node name="VBox2" type="VBoxContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="Panel" type="PanelContainer" parent="VBox2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBox2/Panel"]
|
||||
layout_mode = 2
|
||||
text = "No resource"
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBox2"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ResourcesList" type="ItemList" parent="VBox2/PanelContainer"]
|
||||
layout_mode = 2
|
||||
item_count = 1
|
||||
same_column_width = true
|
||||
item_0/text = "Chapter1.dtl"
|
||||
item_0/icon = SubResource("ImageTexture_41bcg")
|
||||
|
||||
[connection signal="text_changed" from="VBoxContainer/VBox/Panel/Search" to="." method="_on_search_text_changed"]
|
||||
110
Sprout/addons/dialogic/Editor/Common/sidebar.gd
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
## Script that handles the editor sidebar.
|
||||
|
||||
signal file_activated(file_path)
|
||||
|
||||
@onready var editors_manager = get_parent().get_parent()
|
||||
|
||||
|
||||
func _ready():
|
||||
%ResourcesList.item_selected.connect(_on_resources_list_item_selected)
|
||||
editors_manager.resource_opened.connect(_on_editors_resource_opened)
|
||||
editors_manager.editor_changed.connect(_on_editors_editor_changed)
|
||||
%Search.right_icon = get_theme_icon("Search", "EditorIcons")
|
||||
|
||||
################################################################################
|
||||
## EDITOR BUTTONS/LABELS
|
||||
################################################################################
|
||||
|
||||
func add_icon_button(icon: Texture, tooltip: String) -> Button:
|
||||
var button := Button.new()
|
||||
button.icon = icon
|
||||
button.tooltip_text = tooltip
|
||||
%IconButtons.add_child(button)
|
||||
return button
|
||||
|
||||
|
||||
func add_custom_button(label:String, icon:Texture) -> Button:
|
||||
var button := Button.new()
|
||||
button.text = label
|
||||
button.icon = icon
|
||||
%CustomButtons.add_child(button)
|
||||
return button
|
||||
|
||||
|
||||
func hide_all_custom_buttons() -> void:
|
||||
for button in %CustomButtons.get_children():
|
||||
button.hide()
|
||||
|
||||
|
||||
func set_current_resource_text(text:String) -> void:
|
||||
%CurrentResource.text = text
|
||||
%CurrentResource.visible = not text.is_empty()
|
||||
|
||||
|
||||
func set_unsaved_indicator(saved:bool = true) -> void:
|
||||
if saved and %CurrentResource.text.ends_with('(*)'):
|
||||
%CurrentResource.text = %CurrentResource.text.trim_suffix('(*)')
|
||||
if not saved and not %CurrentResource.text.ends_with('(*)'):
|
||||
%CurrentResource.text = %CurrentResource.text+"(*)"
|
||||
|
||||
################################################################################
|
||||
## RESOURCE LIST
|
||||
################################################################################
|
||||
|
||||
func _on_editors_resource_opened(resource:Resource) -> void:
|
||||
update_resource_list()
|
||||
|
||||
|
||||
func _on_editors_editor_changed(previous:DialogicEditor, current:DialogicEditor) -> void:
|
||||
update_resource_list()
|
||||
|
||||
|
||||
func update_resource_list() -> void:
|
||||
var filter :String = %Search.text
|
||||
var current_file := ""
|
||||
if editors_manager.current_editor and editors_manager.current_editor.current_resource:
|
||||
current_file = editors_manager.current_editor.current_resource.resource_path
|
||||
|
||||
var character_directory: Dictionary = editors_manager.resource_helper.character_directory
|
||||
var timeline_directory: Dictionary = editors_manager.resource_helper.timeline_directory
|
||||
var latest_resources: Array = DialogicUtil.get_project_setting('dialogic/editor/last_resources', [])
|
||||
for res in latest_resources:
|
||||
if !FileAccess.file_exists(res):
|
||||
latest_resources.erase(res)
|
||||
ProjectSettings.set_setting('dialogic/editor/last_resources', latest_resources)
|
||||
|
||||
%ResourcesList.clear()
|
||||
var idx := 0
|
||||
for character in character_directory.values():
|
||||
if character['full_path'] in latest_resources:
|
||||
if filter.is_empty() or filter.to_lower() in character['unique_short_path'].to_lower():
|
||||
%ResourcesList.add_item(
|
||||
character['unique_short_path'],
|
||||
load("res://addons/dialogic/Editor/Images/Resources/character.svg"))
|
||||
%ResourcesList.set_item_metadata(idx, character['full_path'])
|
||||
%ResourcesList.set_item_tooltip(idx, character['full_path'])
|
||||
if character['full_path'] == current_file:
|
||||
%ResourcesList.select(idx)
|
||||
%ResourcesList.set_item_custom_fg_color(idx, get_theme_color("accent_color", "Editor"))
|
||||
idx += 1
|
||||
for timeline_name in timeline_directory:
|
||||
if timeline_directory[timeline_name] in latest_resources:
|
||||
if filter.is_empty() or filter.to_lower() in timeline_name.to_lower():
|
||||
%ResourcesList.add_item(timeline_name, get_theme_icon("TripleBar", "EditorIcons"))
|
||||
%ResourcesList.set_item_metadata(idx, timeline_directory[timeline_name])
|
||||
if timeline_directory[timeline_name] == current_file:
|
||||
%ResourcesList.select(idx)
|
||||
%ResourcesList.set_item_custom_fg_color(idx, get_theme_color("accent_color", "Editor"))
|
||||
idx += 1
|
||||
%ResourcesList.sort_items_by_text()
|
||||
|
||||
|
||||
func _on_resources_list_item_selected(index:int) -> void:
|
||||
editors_manager.edit_resource(load(%ResourcesList.get_item_metadata(index)))
|
||||
|
||||
|
||||
func _on_search_text_changed(new_text:String) -> void:
|
||||
update_resource_list()
|
||||
52
Sprout/addons/dialogic/Editor/Events/BranchEnd.gd
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
@tool
|
||||
extends Control
|
||||
var resource
|
||||
var parent_node
|
||||
|
||||
var end_control :Control
|
||||
|
||||
### the indent size
|
||||
var indent_size = 15
|
||||
var current_indent_level = 1
|
||||
|
||||
func _ready():
|
||||
$Icon.icon = get_theme_icon("GuiSpinboxUpdown", "EditorIcons")
|
||||
parent_node_changed()
|
||||
$Spacer.custom_minimum_size.x = 100*DialogicUtil.get_editor_scale()
|
||||
|
||||
|
||||
func visual_select():
|
||||
modulate = get_theme_color("warning_color", "Editor")
|
||||
|
||||
|
||||
func visual_deselect():
|
||||
modulate = Color(1,1,1,1)
|
||||
|
||||
|
||||
func highlight():
|
||||
modulate = parent_node.resource.event_color.lightened(0.5)
|
||||
|
||||
|
||||
func unhighlight():
|
||||
modulate = Color(1,1,1,1)
|
||||
|
||||
func set_indent(indent: int):
|
||||
var indent_node = $Indent
|
||||
indent_node.custom_minimum_size = Vector2(indent_size * indent, 0)
|
||||
indent_node.visible = indent != 0
|
||||
current_indent_level = indent
|
||||
queue_redraw()
|
||||
|
||||
func parent_node_changed():
|
||||
if parent_node:
|
||||
if end_control and end_control.has_method('refresh'):
|
||||
end_control.refresh()
|
||||
|
||||
func add_end_control(control:Control):
|
||||
add_child(control)
|
||||
if "parent_resource" in control:
|
||||
control.parent_resource = parent_node.resource
|
||||
if control.has_method('refresh'):
|
||||
control.refresh()
|
||||
end_control = control
|
||||
|
||||
42
Sprout/addons/dialogic/Editor/Events/BranchEnd.tscn
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://de13fdeebrkcb"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/BranchEnd.gd" id="1"]
|
||||
|
||||
[sub_resource type="Image" id="Image_cje5s"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_sojvl"]
|
||||
image = SubResource("Image_cje5s")
|
||||
|
||||
[node name="EndBranch" type="HBoxContainer"]
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 48.0
|
||||
mouse_filter = 0
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Indent" type="Control" parent="."]
|
||||
offset_bottom = 48.0
|
||||
|
||||
[node name="Spacer" type="Control" parent="."]
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
offset_left = 4.0
|
||||
offset_right = 304.0
|
||||
offset_bottom = 48.0
|
||||
|
||||
[node name="Icon" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(31, 0)
|
||||
offset_left = 308.0
|
||||
offset_top = 12.0
|
||||
offset_right = 339.0
|
||||
offset_bottom = 36.0
|
||||
size_flags_vertical = 4
|
||||
mouse_filter = 1
|
||||
icon = SubResource("ImageTexture_sojvl")
|
||||
flat = true
|
||||
408
Sprout/addons/dialogic/Editor/Events/EventNode/EventNode.gd
Normal file
|
|
@ -0,0 +1,408 @@
|
|||
@tool
|
||||
extends HBoxContainer
|
||||
|
||||
signal option_action(action_name)
|
||||
signal content_changed()
|
||||
|
||||
# Resource
|
||||
var resource : DialogicEvent
|
||||
|
||||
|
||||
### internal node eferences
|
||||
@onready var selected_style = %SelectedStyle
|
||||
@onready var warning = %Warning
|
||||
@onready var title_label = %TitleLabel
|
||||
@onready var icon_texture = %IconTexture
|
||||
@onready var header_content_container = %HeaderContent
|
||||
@onready var body_container = %Body
|
||||
@onready var body_content_container = %BodyContent
|
||||
@onready var indent_node = %Indent
|
||||
|
||||
# is the body visible
|
||||
var expanded = true
|
||||
|
||||
# does the body have elements?
|
||||
var has_body_content = false
|
||||
|
||||
# for choice and condition
|
||||
var end_node:Node = null:
|
||||
get:
|
||||
return end_node
|
||||
set(node):
|
||||
end_node = node
|
||||
%CollapseButton.visible = true if end_node else false
|
||||
|
||||
var collapsed = false
|
||||
|
||||
### extarnal node references
|
||||
var editor_reference
|
||||
|
||||
### the indent size
|
||||
var indent_size = 15
|
||||
var current_indent_level = 1
|
||||
|
||||
# Setting this to true will ignore the event while saving
|
||||
# Useful for making placeholder events in drag and drop
|
||||
var ignore_save = false
|
||||
|
||||
|
||||
## *****************************************************************************
|
||||
## PUBLIC METHODS
|
||||
## *****************************************************************************
|
||||
|
||||
func visual_select():
|
||||
selected_style.show()
|
||||
|
||||
|
||||
func visual_deselect():
|
||||
selected_style.hide()
|
||||
|
||||
|
||||
func is_selected() -> bool:
|
||||
return selected_style.visible
|
||||
|
||||
# called by the timeline before adding it to the tree
|
||||
func load_data(data):
|
||||
resource = data
|
||||
|
||||
|
||||
func set_warning(text):
|
||||
warning.show()
|
||||
warning.tooltip_text = text
|
||||
|
||||
|
||||
func remove_warning(text = ''):
|
||||
if warning.tooltip_text == text or text == '':
|
||||
warning.hide()
|
||||
|
||||
|
||||
func set_indent(indent: int):
|
||||
indent_node.custom_minimum_size = Vector2(indent_size * indent, 0)
|
||||
indent_node.visible = indent != 0
|
||||
current_indent_level = indent
|
||||
queue_redraw()
|
||||
|
||||
|
||||
## *****************************************************************************
|
||||
## PRIVATE METHODS
|
||||
## *****************************************************************************
|
||||
|
||||
func _set_event_icon(icon: Texture):
|
||||
icon_texture.texture = icon
|
||||
var _scale = DialogicUtil.get_editor_scale()
|
||||
var cpanel = %IconPanelCenterC
|
||||
var ip = %IconPanel
|
||||
var ipc = icon_texture
|
||||
|
||||
# Resizing the icon acording to the scale
|
||||
var icon_size = 32
|
||||
cpanel.custom_minimum_size = Vector2(icon_size, icon_size) * _scale
|
||||
ip.custom_minimum_size = cpanel.custom_minimum_size
|
||||
ipc.custom_minimum_size = ip.custom_minimum_size
|
||||
|
||||
# Updating the theme properties to scale
|
||||
var custom_style = ip.get_theme_stylebox('panel')
|
||||
custom_style.corner_radius_top_left = 5 * _scale
|
||||
custom_style.corner_radius_top_right = 5 * _scale
|
||||
custom_style.corner_radius_bottom_left = 5 * _scale
|
||||
custom_style.corner_radius_bottom_right = 5 * _scale
|
||||
|
||||
# Separation on the header
|
||||
%Header.add_theme_constant_override("custom_constants/separation", 5 * _scale)
|
||||
%BodySpacing.custom_minimum_size.x = title_label.position.x
|
||||
|
||||
|
||||
func _on_OptionsControl_action(index):
|
||||
if index == 0:
|
||||
if not resource.help_page_path.is_empty():
|
||||
OS.shell_open(resource.help_page_path)
|
||||
elif index == 2:
|
||||
emit_signal("option_action", "up")
|
||||
elif index == 3:
|
||||
emit_signal("option_action", "down")
|
||||
elif index == 5:
|
||||
emit_signal("option_action", "remove")
|
||||
|
||||
|
||||
func _on_Indent_visibility_changed():
|
||||
if not indent_node:
|
||||
return
|
||||
if resource:
|
||||
if resource.needs_indentation:
|
||||
if indent_node.visible:
|
||||
remove_warning("This event needs a question event around it!")
|
||||
else:
|
||||
set_warning("This event needs a question event around it!")
|
||||
|
||||
|
||||
func _request_selection():
|
||||
# TODO doesn't work. I'm sure - JS
|
||||
var timeline_editor = editor_reference.get_node_or_null('MainPanel/TimelineEditor')
|
||||
if (timeline_editor != null):
|
||||
# @todo select item and clear selection is marked as "private" in TimelineEditor.gd
|
||||
# consider to make it "public" or add a public helper function
|
||||
timeline_editor.select_item(self)
|
||||
|
||||
|
||||
# called to inform event parts, that a focus is wanted
|
||||
func focus():
|
||||
pass
|
||||
|
||||
|
||||
func toggle_collapse(toggled):
|
||||
collapsed = toggled
|
||||
$PanelContainer/MarginContainer/VBoxContainer/CollapsedBody.visible = toggled
|
||||
var timeline_editor = find_parent('TimelineVisualEditor')
|
||||
if (timeline_editor != null):
|
||||
# @todo select item and clear selection is marked as "private" in TimelineEditor.gd
|
||||
# consider to make it "public" or add a public helper function
|
||||
timeline_editor.indent_events()
|
||||
|
||||
|
||||
func build_editor():
|
||||
var p_list = resource._get_property_list()
|
||||
var edit_conditions_list = []
|
||||
var current_body_container = HFlowContainer.new()
|
||||
%BodyContent.add_child(current_body_container)
|
||||
for p in p_list:
|
||||
### --------------------------------------------------------------------
|
||||
### 1. CREATE A NODE OF THE CORRECT TYPE FOR THE PROPERTY
|
||||
var editor_node
|
||||
|
||||
### OTHER
|
||||
if p.name == "linebreak":
|
||||
current_body_container = HFlowContainer.new()
|
||||
%BodyContent.add_child(current_body_container)
|
||||
continue
|
||||
|
||||
### STRINGS
|
||||
elif p.dialogic_type == resource.ValueType.MultilineText:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/MultilineText.tscn").instantiate()
|
||||
elif p.dialogic_type == resource.ValueType.SinglelineText:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/SinglelineText.tscn").instantiate()
|
||||
editor_node.placeholder = p.display_info.get('placeholder', '')
|
||||
elif p.dialogic_type == resource.ValueType.Bool:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/Bool.tscn").instantiate()
|
||||
|
||||
elif p.dialogic_type == resource.ValueType.File:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/FilePicker.tscn").instantiate()
|
||||
editor_node.file_filter = p.display_info.get('file_filter', '')
|
||||
editor_node.placeholder = p.display_info.get('placeholder', '')
|
||||
editor_node.resource_icon = p.display_info.get('icon', null)
|
||||
if editor_node.resource_icon == null and p.display_info.has('editor_icon'):
|
||||
editor_node.resource_icon = callv('get_theme_icon', p.display_info.editor_icon)
|
||||
|
||||
elif p.dialogic_type == resource.ValueType.Condition:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/ConditionPicker.tscn").instantiate()
|
||||
|
||||
## Complex Picker
|
||||
elif p.dialogic_type == resource.ValueType.ComplexPicker:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn").instantiate()
|
||||
|
||||
editor_node.file_extension = p.display_info.get('file_extension', '')
|
||||
editor_node.get_suggestions_func = p.display_info.get('suggestions_func', editor_node.get_suggestions_func)
|
||||
editor_node.empty_text = p.display_info.get('empty_text', '')
|
||||
editor_node.placeholder_text = p.display_info.get('placeholder', 'Select Resource')
|
||||
editor_node.resource_icon = p.display_info.get('icon', null)
|
||||
editor_node.enable_pretty_name = p.display_info.get('enable_pretty_name', false)
|
||||
if editor_node.resource_icon == null and p.display_info.has('editor_icon'):
|
||||
editor_node.resource_icon = callv('get_theme_icon', p.display_info.editor_icon)
|
||||
|
||||
## INTEGERS
|
||||
elif p.dialogic_type == resource.ValueType.Integer:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/Number.tscn").instantiate()
|
||||
editor_node.use_int_mode()
|
||||
editor_node.max = p.display_info.get('max', 9999)
|
||||
editor_node.min = p.display_info.get('min', -9999)
|
||||
elif p.dialogic_type == resource.ValueType.Float:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/Number.tscn").instantiate()
|
||||
editor_node.use_float_mode()
|
||||
editor_node.max = p.display_info.get('max', 9999)
|
||||
editor_node.min = p.display_info.get('min', 0)
|
||||
elif p.dialogic_type == resource.ValueType.Decibel:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/Number.tscn").instantiate()
|
||||
editor_node.use_decibel_mode()
|
||||
elif p.dialogic_type == resource.ValueType.FixedOptionSelector:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/OptionSelector.tscn").instantiate()
|
||||
if p.display_info.has('selector_options'):
|
||||
editor_node.options = p.display_info.selector_options
|
||||
if p.display_info.has('disabled'):
|
||||
editor_node.disabled = p.display_info.disabled
|
||||
|
||||
elif p.dialogic_type == resource.ValueType.Vector2:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/Vector2.tscn").instantiate()
|
||||
|
||||
elif p.dialogic_type == resource.ValueType.StringArray:
|
||||
editor_node = load("res://addons/dialogic/Editor/Events/Fields/Array.tscn").instantiate()
|
||||
|
||||
elif p.dialogic_type == resource.ValueType.Label:
|
||||
editor_node = Label.new()
|
||||
editor_node.text = p.display_info.text
|
||||
editor_node.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
elif p.dialogic_type == resource.ValueType.Button:
|
||||
editor_node = Button.new()
|
||||
editor_node.text = p.display_info.text
|
||||
if typeof(p.display_info.icon) == TYPE_ARRAY:
|
||||
editor_node.icon = callv('get_theme_icon', p.display_info.icon)
|
||||
else:
|
||||
editor_node.icon = p.display_info.icon
|
||||
editor_node.flat = true
|
||||
editor_node.custom_minimum_size.x = 30*DialogicUtil.get_editor_scale()
|
||||
editor_node.tooltip_text = p.display_info.tooltip
|
||||
editor_node.pressed.connect(p.display_info.callable)
|
||||
## CUSTOM
|
||||
elif p.dialogic_type == resource.ValueType.Custom:
|
||||
if p.display_info.has('path'):
|
||||
editor_node = load(p.display_info.path).instantiate()
|
||||
|
||||
## ELSE
|
||||
else:
|
||||
editor_node = Label.new()
|
||||
editor_node.text = p.name
|
||||
|
||||
### --------------------------------------------------------------------
|
||||
### 2. ADD IT TO THE RIGHT PLACE (HEADER/BODY)
|
||||
var location = %HeaderContent
|
||||
if p.location == 1:
|
||||
location = current_body_container
|
||||
location.add_child(editor_node)
|
||||
|
||||
### --------------------------------------------------------------------
|
||||
### 3. FILL THE NEW NODE WITH INFORMATION AND LISTEN TO CHANGES
|
||||
if "event_resource" in editor_node:
|
||||
editor_node.event_resource = resource
|
||||
if 'property_name' in editor_node:
|
||||
editor_node.property_name = p.name
|
||||
if editor_node.has_method('set_value'):
|
||||
if resource.get(p.name) != null: # Got an error here saying that "Cannot convert argument 1 from Nil to bool." so I'm adding this check
|
||||
editor_node.set_value(resource.get(p.name))
|
||||
if editor_node.has_signal('value_changed'):
|
||||
editor_node.value_changed.connect(set_property)
|
||||
if editor_node.has_method('set_left_text'):
|
||||
editor_node.set_left_text(p.get('left_text', ''))
|
||||
if editor_node.has_method('set_right_text'):
|
||||
editor_node.set_right_text(p.get('right_text', ''))
|
||||
if p.has('condition'):
|
||||
edit_conditions_list.append([editor_node, p.condition])
|
||||
|
||||
|
||||
has_body_content = true
|
||||
if current_body_container.get_child_count() == 0:
|
||||
has_body_content = false
|
||||
expanded = false
|
||||
body_container.visible = false
|
||||
|
||||
content_changed.connect(recalculate_edit_visibility.bind(edit_conditions_list))
|
||||
recalculate_edit_visibility(edit_conditions_list)
|
||||
|
||||
func recalculate_edit_visibility(list):
|
||||
for node_con in list:
|
||||
if node_con[1].is_empty():
|
||||
node_con[0].show()
|
||||
else:
|
||||
var expr = Expression.new()
|
||||
expr.parse(node_con[1])
|
||||
if expr.execute([], resource):
|
||||
node_con[0].show()
|
||||
else:
|
||||
node_con[0].hide()
|
||||
if expr.has_execute_failed():
|
||||
var name = "unnamed" if "property_name" not in node_con[0] else node_con[0].property_name
|
||||
printerr("(recalculate_edit_visibility) condition expression failed with error: " + expr.get_error_text())
|
||||
|
||||
%ExpandButton.visible = false
|
||||
if body_content_container != null:
|
||||
for node in body_content_container.get_children():
|
||||
for sub_node in node.get_children():
|
||||
if sub_node.visible:
|
||||
%ExpandButton.visible = true
|
||||
break
|
||||
|
||||
func set_property(property_name, value):
|
||||
resource.set(property_name, value)
|
||||
emit_signal('content_changed')
|
||||
if end_node:
|
||||
end_node.parent_node_changed()
|
||||
|
||||
|
||||
func _update_color():
|
||||
if resource.dialogic_color_name != '':
|
||||
%IconPanel.self_modulate = DialogicUtil.get_color(resource.dialogic_color_name)
|
||||
## *****************************************************************************
|
||||
## OVERRIDES
|
||||
## *****************************************************************************
|
||||
|
||||
func _ready():
|
||||
|
||||
## DO SOME STYLING
|
||||
var _scale = DialogicUtil.get_editor_scale()
|
||||
selected_style.modulate = get_theme_color("accent_color", "Editor")
|
||||
warning.texture = get_theme_icon("NodeWarning", "EditorIcons")
|
||||
warning.size = Vector2(16 * _scale, 16 * _scale)
|
||||
title_label.add_theme_color_override("font_color", Color(1,1,1,1))
|
||||
if not get_theme_constant("dark_theme", "Editor"):
|
||||
title_label.add_theme_color_override("font_color", get_theme_color("font_color", "Editor"))
|
||||
|
||||
indent_size = indent_size * DialogicUtil.get_editor_scale()
|
||||
|
||||
%ExpandButton.icon = get_theme_icon("Tools", "EditorIcons")
|
||||
|
||||
|
||||
if resource:
|
||||
if resource.event_name:
|
||||
#title_label.text = DTS.translate(resource.event_name)
|
||||
title_label.text = resource.event_name
|
||||
if resource._get_icon() != null:
|
||||
_set_event_icon(resource._get_icon())
|
||||
|
||||
%IconPanel.self_modulate = resource.event_color
|
||||
|
||||
_on_ExpandButton_toggled(resource.expand_by_default)
|
||||
|
||||
# Only create this if it can collapse children events
|
||||
if resource.can_contain_events:
|
||||
var cb:HBoxContainer = HBoxContainer.new()
|
||||
cb.name = 'CollapsedBody'
|
||||
cb.visible = false
|
||||
var cb_label:Label = Label.new()
|
||||
cb_label.text = 'Contains Events (currently hidden)'
|
||||
cb_label.size_flags_horizontal = 3
|
||||
cb_label.horizontal_alignment = 1
|
||||
cb.add_child(cb_label)
|
||||
$PanelContainer/MarginContainer/VBoxContainer.add_child(cb)
|
||||
|
||||
set_focus_mode(1) # Allowing this node to grab focus
|
||||
|
||||
# signals
|
||||
# TODO godot4 react to changes of the colors, the signal was removed
|
||||
#ProjectSettings.project_settings_changed.connect(_update_color)
|
||||
$PopupMenu.index_pressed.connect(_on_OptionsControl_action)
|
||||
|
||||
|
||||
_on_Indent_visibility_changed()
|
||||
%CollapseButton.toggled.connect(toggle_collapse)
|
||||
%CollapseButton.icon = get_theme_icon("Collapse", "EditorIcons")
|
||||
%CollapseButton.hide()
|
||||
|
||||
|
||||
func _on_ExpandButton_toggled(button_pressed):
|
||||
%ExpandButton.set_pressed_no_signal(button_pressed)
|
||||
expanded = button_pressed
|
||||
body_container.visible = button_pressed
|
||||
get_parent().get_parent().queue_redraw()
|
||||
|
||||
|
||||
func _on_EventNode_gui_input(event):
|
||||
if event is InputEventMouseButton and event.is_pressed() and event.button_index == 1:
|
||||
grab_focus() # Grab focus to avoid copy pasting text or events
|
||||
if event.double_click:
|
||||
if has_body_content:
|
||||
_on_ExpandButton_toggled(!expanded)
|
||||
# For opening the context menu
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_RIGHT and event.pressed:
|
||||
$PopupMenu.popup_on_parent(Rect2(get_global_mouse_position(),Vector2()))
|
||||
if resource.help_page_path == "":
|
||||
$PopupMenu.set_item_disabled(0, true)
|
||||
else:
|
||||
$PopupMenu.set_item_disabled(0, false)
|
||||
220
Sprout/addons/dialogic/Editor/Events/EventNode/EventNode.tscn
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
[gd_scene load_steps=11 format=3 uid="uid://cx7w87y4t866f"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/EventNode/EventNode.gd" id="1"]
|
||||
[ext_resource type="StyleBox" uid="uid://obyrr26pqk2p" path="res://addons/dialogic/Editor/Events/styles/selected_styleboxflat.tres" id="2_vj6hl"]
|
||||
[ext_resource type="StyleBox" uid="uid://c8k6tbipodsg" path="res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres" id="5_wntx6"]
|
||||
[ext_resource type="Texture2D" uid="uid://b0jgbs777wfgw" path="res://addons/dialogic/Editor/Images/plugin-icon.svg" id="6"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/EventNode/PopupMenu.gd" id="8"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_otutu"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[sub_resource type="Image" id="Image_jdnqf"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_4d04d"]
|
||||
image = SubResource("Image_jdnqf")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_lj5gu"]
|
||||
|
||||
[sub_resource type="Theme" id="Theme_g6f7f"]
|
||||
PopupMenu/colors/font_color_hover = Color(0, 0, 0, 1)
|
||||
PopupMenu/styles/hover = SubResource("StyleBoxEmpty_lj5gu")
|
||||
PopupMenu/styles/panel = ExtResource("5_wntx6")
|
||||
|
||||
[node name="EventNode" type="HBoxContainer"]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
grow_horizontal = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 9
|
||||
focus_mode = 1
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Indent" type="Control" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
anchors_preset = 0
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 28.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="SelectedStyle" type="Panel" parent="PanelContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 2
|
||||
offset_right = 1024.0
|
||||
offset_bottom = 28.0
|
||||
theme_override_styles/panel = ExtResource("2_vj6hl")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 28.0
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 7
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
offset_left = 7.0
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 28.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Header" type="HBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_right = 1145.0
|
||||
offset_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="IconPanelCenterC" type="CenterContainer" parent="PanelContainer/MarginContainer/VBoxContainer/Header"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_bottom = 24.0
|
||||
|
||||
[node name="IconPanel" type="Panel" parent="PanelContainer/MarginContainer/VBoxContainer/Header/IconPanelCenterC"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_top = 12.0
|
||||
offset_bottom = 12.0
|
||||
mouse_filter = 1
|
||||
mouse_default_cursor_shape = 6
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_otutu")
|
||||
|
||||
[node name="IconTexture" type="TextureRect" parent="PanelContainer/MarginContainer/VBoxContainer/Header/IconPanelCenterC/IconPanel"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("6")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Warning" type="TextureRect" parent="PanelContainer/MarginContainer/VBoxContainer/Header/IconPanelCenterC/IconPanel"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 16.0
|
||||
offset_bottom = 16.0
|
||||
texture = SubResource("ImageTexture_4d04d")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer/Header"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 4.0
|
||||
offset_right = 5.0
|
||||
offset_bottom = 23.0
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HeaderContent" type="HBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer/Header"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 9.0
|
||||
offset_right = 561.0
|
||||
offset_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Spacer" type="Control" parent="PanelContainer/MarginContainer/VBoxContainer/Header"]
|
||||
layout_mode = 2
|
||||
anchors_preset = 0
|
||||
offset_left = 565.0
|
||||
offset_right = 1117.0
|
||||
offset_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="ExpandButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer/Header"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 1121.0
|
||||
offset_right = 1145.0
|
||||
offset_bottom = 24.0
|
||||
toggle_mode = true
|
||||
icon = SubResource("ImageTexture_4d04d")
|
||||
flat = true
|
||||
|
||||
[node name="CollapseButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer/Header"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
icon = SubResource("ImageTexture_4d04d")
|
||||
flat = true
|
||||
|
||||
[node name="Body" type="HBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_top = 28.0
|
||||
offset_right = 1145.0
|
||||
offset_bottom = 28.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="BodySpacing" type="Control" parent="PanelContainer/MarginContainer/VBoxContainer/Body"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(10, 0)
|
||||
layout_mode = 2
|
||||
anchors_preset = 0
|
||||
offset_right = 10.0
|
||||
|
||||
[node name="BodyContent" type="VBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer/Body"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 14.0
|
||||
offset_right = 1145.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="PopupMenu" type="PopupMenu" parent="."]
|
||||
theme = SubResource("Theme_g6f7f")
|
||||
item_count = 6
|
||||
item_0/text = "Documentation"
|
||||
item_0/icon = SubResource("ImageTexture_4d04d")
|
||||
item_0/id = 0
|
||||
item_1/text = ""
|
||||
item_1/id = -1
|
||||
item_1/separator = true
|
||||
item_2/text = "Move up"
|
||||
item_2/icon = SubResource("ImageTexture_4d04d")
|
||||
item_2/id = 2
|
||||
item_3/text = "Move down"
|
||||
item_3/icon = SubResource("ImageTexture_4d04d")
|
||||
item_3/id = 3
|
||||
item_4/text = ""
|
||||
item_4/id = -1
|
||||
item_4/separator = true
|
||||
item_5/text = "Delete"
|
||||
item_5/icon = SubResource("ImageTexture_4d04d")
|
||||
item_5/id = 5
|
||||
script = ExtResource("8")
|
||||
|
||||
[connection signal="gui_input" from="." to="." method="_on_EventNode_gui_input"]
|
||||
[connection signal="visibility_changed" from="Indent" to="." method="_on_Indent_visibility_changed"]
|
||||
[connection signal="toggled" from="PanelContainer/MarginContainer/VBoxContainer/Header/ExpandButton" to="." method="_on_ExpandButton_toggled"]
|
||||
17
Sprout/addons/dialogic/Editor/Events/EventNode/PopupMenu.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
@tool
|
||||
extends PopupMenu
|
||||
|
||||
func _ready():
|
||||
clear()
|
||||
add_icon_item(get_theme_icon("Help", "EditorIcons"), "Documentation")
|
||||
add_separator()
|
||||
add_icon_item(get_theme_icon("ArrowUp", "EditorIcons"), "Move up")
|
||||
add_icon_item(get_theme_icon("ArrowDown", "EditorIcons"), "Move down")
|
||||
add_separator()
|
||||
add_icon_item(get_theme_icon("Remove", "EditorIcons"), "Delete")
|
||||
|
||||
var menu_background = load("res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres")
|
||||
menu_background.bg_color = get_parent().get_theme_color("base_color", "Editor")
|
||||
theme.set_stylebox('panel', 'PopupMenu', menu_background)
|
||||
theme.set_stylebox('hover', 'PopupMenu', StyleBoxEmpty.new())
|
||||
theme.set_color('font_color_hover', 'PopupMenu', get_parent().get_theme_color("accent_color", "Editor"))
|
||||
44
Sprout/addons/dialogic/Editor/Events/Fields/Array.gd
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
@tool
|
||||
extends VBoxContainer
|
||||
|
||||
const ArrayValue = "res://addons/dialogic/Editor/Events/Fields/ArrayValue.tscn"
|
||||
|
||||
var property_name : String
|
||||
signal value_changed
|
||||
|
||||
|
||||
func set_value(value:Array):
|
||||
for child in %Values.get_children():
|
||||
child.queue_free()
|
||||
|
||||
for item in value:
|
||||
var x = load(ArrayValue).instantiate()
|
||||
%Values.add_child(x)
|
||||
x.set_value(item)
|
||||
x.value_changed.connect(recalculate_values)
|
||||
|
||||
func _on_value_changed(value):
|
||||
emit_signal("value_changed", property_name, value)
|
||||
|
||||
func recalculate_values():
|
||||
var arr = []
|
||||
for child in %Values.get_children():
|
||||
if !child.is_queued_for_deletion():
|
||||
arr.append(child.get_value())
|
||||
_on_value_changed(arr)
|
||||
|
||||
|
||||
func set_right_text(value):
|
||||
$RightText.text = str(value)
|
||||
$RightText.visible = value.is_empty()
|
||||
|
||||
func set_left_text(value):
|
||||
%LeftText.text = str(value)
|
||||
%LeftText.visible = value.is_empty()
|
||||
|
||||
func _on_AddButton_pressed():
|
||||
var x = load(ArrayValue).instantiate()
|
||||
%Values.add_child(x)
|
||||
x.set_value("")
|
||||
x.value_changed.connect(recalculate_values)
|
||||
recalculate_values()
|
||||
47
Sprout/addons/dialogic/Editor/Events/Fields/Array.tscn
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://btmy7ageqpyq1"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ch4j2lesn1sis" path="res://addons/dialogic/Editor/Events/Fields/ArrayValue.tscn" id="1"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/Array.gd" id="2"]
|
||||
|
||||
[node name="Array" type="VBoxContainer"]
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Editing" type="HBoxContainer" parent="."]
|
||||
offset_right = 157.0
|
||||
offset_bottom = 31.0
|
||||
size_flags_horizontal = 3
|
||||
alignment = 2
|
||||
|
||||
[node name="LeftText" type="Label" parent="Editing"]
|
||||
unique_name_in_owner = true
|
||||
offset_top = 2.0
|
||||
offset_right = 67.0
|
||||
offset_bottom = 28.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Top Text"
|
||||
|
||||
[node name="AddButton" type="Button" parent="Editing"]
|
||||
offset_left = 71.0
|
||||
offset_right = 157.0
|
||||
offset_bottom = 31.0
|
||||
text = "Add Value"
|
||||
|
||||
[node name="Values" type="VBoxContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_top = 35.0
|
||||
offset_right = 157.0
|
||||
offset_bottom = 105.0
|
||||
|
||||
[node name="Value" parent="Values" instance=ExtResource("1")]
|
||||
offset_right = 157.0
|
||||
offset_bottom = 33.0
|
||||
|
||||
[node name="Value2" parent="Values" instance=ExtResource("1")]
|
||||
offset_top = 37.0
|
||||
offset_right = 157.0
|
||||
offset_bottom = 70.0
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
visible = false
|
||||
|
||||
[connection signal="pressed" from="Editing/AddButton" to="." method="_on_AddButton_pressed"]
|
||||
21
Sprout/addons/dialogic/Editor/Events/Fields/ArrayValue.gd
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
@tool
|
||||
extends HBoxContainer
|
||||
|
||||
signal value_changed()
|
||||
|
||||
func _ready():
|
||||
$Delete.icon = get_theme_icon("Remove", "EditorIcons")
|
||||
|
||||
|
||||
func _on_Delete_pressed():
|
||||
queue_free()
|
||||
emit_signal("value_changed")
|
||||
|
||||
func _on_Value_text_changed(new_text):
|
||||
emit_signal('value_changed')
|
||||
|
||||
func set_value(value):
|
||||
$Value.text = str(value)
|
||||
|
||||
func get_value():
|
||||
return $Value.text
|
||||
35
Sprout/addons/dialogic/Editor/Events/Fields/ArrayValue.tscn
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://ch4j2lesn1sis"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/ArrayValue.gd" id="1"]
|
||||
[ext_resource type="Theme" uid="uid://d3g4i4dshtdpu" path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" id="2"]
|
||||
|
||||
[sub_resource type="Image" id="Image_u705h"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_f0jdc"]
|
||||
image = SubResource("Image_u705h")
|
||||
|
||||
[node name="Value" type="HBoxContainer"]
|
||||
theme = ExtResource("2")
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Value" type="LineEdit" parent="."]
|
||||
offset_right = 90.0
|
||||
offset_bottom = 33.0
|
||||
size_flags_horizontal = 3
|
||||
expand_to_text_length = true
|
||||
|
||||
[node name="Delete" type="Button" parent="."]
|
||||
offset_left = 94.0
|
||||
offset_right = 118.0
|
||||
offset_bottom = 33.0
|
||||
icon = SubResource("ImageTexture_f0jdc")
|
||||
|
||||
[connection signal="text_changed" from="Value" to="." method="_on_Value_text_changed"]
|
||||
[connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"]
|
||||
23
Sprout/addons/dialogic/Editor/Events/Fields/Bool.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
@tool
|
||||
extends HBoxContainer
|
||||
|
||||
var property_name : String
|
||||
signal value_changed
|
||||
|
||||
func _ready():
|
||||
$Toggle.toggled.connect(_on_value_changed)
|
||||
|
||||
|
||||
func set_value(value:bool):
|
||||
$Toggle.button_pressed = value
|
||||
|
||||
|
||||
func _on_value_changed(value):
|
||||
emit_signal("value_changed", property_name, value)
|
||||
|
||||
|
||||
func set_right_text(value):
|
||||
$RightText.text = str(value)
|
||||
|
||||
func set_left_text(value):
|
||||
$LeftText.text = str(value)
|
||||
23
Sprout/addons/dialogic/Editor/Events/Fields/Bool.tscn
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Fields/Bool.gd" type="Script" id=1]
|
||||
|
||||
[node name="Bool" type="HBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
margin_top = 13.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="Toggle" type="CheckButton" parent="."]
|
||||
margin_left = 4.0
|
||||
margin_right = 80.0
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
margin_left = 84.0
|
||||
margin_top = 13.0
|
||||
margin_right = 84.0
|
||||
margin_bottom = 27.0
|
||||
259
Sprout/addons/dialogic/Editor/Events/Fields/ComplexPicker.gd
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
@export var placeholder_text : String = "Select Resource"
|
||||
|
||||
### SETTINGS FOR THE RESOURCE PICKER
|
||||
var file_extension : String = ""
|
||||
var get_suggestions_func : Callable = get_default_suggestions
|
||||
var empty_text : String = ""
|
||||
@export var enable_pretty_name : bool = false
|
||||
|
||||
var resource_icon : Texture = null:
|
||||
get:
|
||||
return resource_icon
|
||||
set(new_icon):
|
||||
resource_icon = new_icon
|
||||
%Icon.texture = new_icon
|
||||
|
||||
## STORING VALUE AND REFERENCE TO RESOURCE
|
||||
var event_resource : DialogicEvent = null
|
||||
var property_name : String
|
||||
var current_value # Dynamic
|
||||
var editor_reference
|
||||
|
||||
var current_selected = 0
|
||||
|
||||
# this signal is on all event parts and informs the event that a change happened.
|
||||
signal value_changed(property_name, value)
|
||||
|
||||
################################################################################
|
||||
## BASIC EVENT PART FUNCTIONS
|
||||
################################################################################
|
||||
# These functions have to be implemented by all scenes that are used to display
|
||||
# values on the events.
|
||||
|
||||
func set_left_text(value:String) -> void:
|
||||
$LeftText.text = str(value)
|
||||
$LeftText.visible = !value.is_empty()
|
||||
|
||||
func set_right_text(value:String) -> void:
|
||||
$RightText.text = str(value)
|
||||
$RightText.visible = !value.is_empty()
|
||||
|
||||
func set_value(value, text : String = '') -> void:
|
||||
if value == null:
|
||||
%Search.text = empty_text
|
||||
elif file_extension != "" and file_extension != ".dch" and file_extension != ".dtl":
|
||||
%Search.text = value.resource_path
|
||||
%Search.tooltip_text = value.resource_path
|
||||
elif value:
|
||||
if enable_pretty_name:
|
||||
%Search.text = DialogicUtil.pretty_name(value)
|
||||
else:
|
||||
%Search.text = value
|
||||
else:
|
||||
%Search.text = empty_text
|
||||
if text:
|
||||
%Search.text = text
|
||||
|
||||
current_value = value
|
||||
|
||||
|
||||
func changed_to_empty() -> void:
|
||||
if file_extension != "" && file_extension != ".dch":
|
||||
emit_signal("value_changed", property_name, null)
|
||||
else:
|
||||
emit_signal("value_changed", property_name, "")
|
||||
|
||||
|
||||
################################################################################
|
||||
## BASIC
|
||||
################################################################################
|
||||
func _ready():
|
||||
%BG.add_theme_stylebox_override('panel', get_theme_stylebox('normal', 'LineEdit'))
|
||||
%Focus.add_theme_stylebox_override('panel', get_theme_stylebox('focus', 'LineEdit'))
|
||||
%Search.text_changed.connect(_on_Search_text_changed)
|
||||
%Search.focus_entered.connect(_on_Search_focus_entered)
|
||||
%Search.text_submitted.connect(_on_Search_text_entered)
|
||||
var scale: float = DialogicUtil.get_editor_scale()
|
||||
%SelectButton.icon = get_theme_icon("Collapse", "EditorIcons")
|
||||
%Search.placeholder_text = placeholder_text
|
||||
%Suggestions.add_theme_stylebox_override('bg', load("res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres"))
|
||||
%Suggestions.hide()
|
||||
%Suggestions.item_selected.connect(suggestion_selected)
|
||||
%Suggestions.item_clicked.connect(suggestion_selected)
|
||||
if resource_icon == null:
|
||||
self.resource_icon = null
|
||||
|
||||
%Search.placeholder_text = 'Select Resource'
|
||||
if file_extension == '.dch':
|
||||
%Search.placeholder_text = 'Select Character'
|
||||
if file_extension == '.dtl':
|
||||
%Search.placeholder_text = 'Select Timeline'
|
||||
|
||||
set_left_text('')
|
||||
set_right_text('')
|
||||
editor_reference = find_parent('EditorView')
|
||||
|
||||
func _exit_tree():
|
||||
# Explicitly free any open cache resources on close, so we don't get leaked resource errors on shutdown
|
||||
event_resource = null
|
||||
|
||||
################################################################################
|
||||
## SEARCH & SUGGESTION POPUP
|
||||
################################################################################
|
||||
func _on_Search_text_entered(new_text:String) -> void:
|
||||
if %Suggestions.get_item_count() and not %Search.text.is_empty():
|
||||
if %Suggestions.is_anything_selected():
|
||||
suggestion_selected(%Suggestions.get_selected_items()[0])
|
||||
else:
|
||||
suggestion_selected(0)
|
||||
else:
|
||||
changed_to_empty()
|
||||
|
||||
|
||||
func _on_Search_text_changed(new_text:String, just_update:bool = false) -> void:
|
||||
%Suggestions.clear()
|
||||
|
||||
if new_text == "" and !just_update:
|
||||
changed_to_empty()
|
||||
|
||||
var suggestions :Dictionary = get_suggestions_func.call(new_text)
|
||||
|
||||
var line_length:int = 0
|
||||
var idx:int = 0
|
||||
for element in suggestions:
|
||||
if new_text.is_empty() or new_text.to_lower() in element.to_lower() or new_text.to_lower() in str(suggestions[element].value).to_lower() or new_text.to_lower() in suggestions[element].get('tooltip', '').to_lower():
|
||||
line_length = max(get_theme_font('font', 'Label').get_string_size(element, HORIZONTAL_ALIGNMENT_LEFT, -1, get_theme_font_size("font_size", 'Label')).x+80, line_length)
|
||||
%Suggestions.add_item(element)
|
||||
if suggestions[element].has('icon'):
|
||||
%Suggestions.set_item_icon(idx, suggestions[element].icon)
|
||||
elif suggestions[element].has('editor_icon'):
|
||||
%Suggestions.set_item_icon(idx, get_theme_icon(suggestions[element].editor_icon[0],suggestions[element].editor_icon[1]))
|
||||
|
||||
%Suggestions.set_item_tooltip(idx, suggestions[element].get('tooltip', ''))
|
||||
%Suggestions.set_item_metadata(idx, suggestions[element].value)
|
||||
idx += 1
|
||||
|
||||
if not %Suggestions.visible:
|
||||
%Suggestions.show()
|
||||
%Suggestions.global_position = $PanelContainer.global_position+Vector2(0,1)*$PanelContainer.size.y
|
||||
#%Suggestions.position = Vector2()
|
||||
%Suggestions.size.x = max(%Search.size.x, line_length)
|
||||
%Suggestions.size.y = min(%Suggestions.get_item_count()*35*DialogicUtil.get_editor_scale(), 200*DialogicUtil.get_editor_scale())
|
||||
if %Suggestions.get_item_count():
|
||||
%Suggestions.select(0)
|
||||
current_selected = 0
|
||||
else:
|
||||
current_selected = -1
|
||||
%Search.grab_focus()
|
||||
|
||||
func get_default_suggestions(input:String) -> Dictionary:
|
||||
if file_extension.is_empty(): return {'Nothing found!':{'value':''}}
|
||||
var suggestions: Dictionary = {}
|
||||
if file_extension == ".dch":
|
||||
suggestions['(No one)'] = {'value':'', 'editor_icon':["GuiRadioUnchecked", "EditorIcons"]}
|
||||
|
||||
for resource in editor_reference.character_directory.keys():
|
||||
suggestions[resource] = {'value': resource, 'tooltip': editor_reference.character_directory[resource]['full_path']}
|
||||
else:
|
||||
var resources: Array = DialogicUtil.list_resources_of_type(file_extension)
|
||||
|
||||
for resource in resources:
|
||||
suggestions[resource] = {'value':resource, 'tooltip':resource}
|
||||
|
||||
return suggestions
|
||||
|
||||
|
||||
func suggestion_selected(index : int, position:=Vector2(), button_index:=MOUSE_BUTTON_LEFT) -> void:
|
||||
if %Suggestions.is_item_disabled(index):
|
||||
return
|
||||
|
||||
%Search.text = %Suggestions.get_item_text(index)
|
||||
|
||||
if %Suggestions.get_item_metadata(index) == null:
|
||||
current_value = null
|
||||
|
||||
# if this is a resource, then load it instead of assigning the string:
|
||||
elif file_extension != "" and file_extension != ".dch" and file_extension != ".dtl":
|
||||
var file = load(%Suggestions.get_item_metadata(index))
|
||||
current_value = file
|
||||
else:
|
||||
current_value = %Suggestions.get_item_metadata(index)
|
||||
|
||||
hide_suggestions()
|
||||
|
||||
%Search.grab_focus()
|
||||
emit_signal("value_changed", property_name, current_value)
|
||||
|
||||
func _input(event:InputEvent):
|
||||
if event is InputEventMouseButton and event.pressed:
|
||||
if %Suggestions.visible:
|
||||
if !%Suggestions.get_global_rect().has_point(get_global_mouse_position()):
|
||||
hide_suggestions()
|
||||
|
||||
func hide_suggestions() -> void:
|
||||
%SelectButton.button_pressed = false
|
||||
%Suggestions.hide()
|
||||
|
||||
func _on_Search_focus_entered() -> void:
|
||||
if %Search.text == "" or current_value == null or (typeof(current_value) == TYPE_STRING and current_value.is_empty()):
|
||||
_on_Search_text_changed("")
|
||||
|
||||
func _on_SelectButton_toggled(button_pressed:bool) -> void:
|
||||
if button_pressed:
|
||||
_on_Search_text_changed('', true)
|
||||
|
||||
################################################################################
|
||||
## DRAG AND DROP
|
||||
################################################################################
|
||||
|
||||
func _can_drop_data(position, data) -> bool:
|
||||
if typeof(data) == TYPE_DICTIONARY and data.has('files') and len(data.files) == 1:
|
||||
if file_extension:
|
||||
if data.files[0].ends_with(file_extension):
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
return false
|
||||
|
||||
func _drop_data(position, data) -> void:
|
||||
if data.files[0].ends_with('dch'):
|
||||
for character in editor_reference.character_directory.keys():
|
||||
if editor_reference.character_directory[character]["full_path"] == data.files[0]:
|
||||
set_value(character)
|
||||
break
|
||||
elif data.files[0].ends_with('dtl'):
|
||||
for timeline in editor_reference.timeline_directory.keys():
|
||||
if editor_reference.timeline_directory[timeline] == data.files[0]:
|
||||
set_value(timeline)
|
||||
break
|
||||
else:
|
||||
var file = load(data.files[0])
|
||||
set_value(file)
|
||||
emit_signal("value_changed", property_name, file)
|
||||
|
||||
|
||||
func _on_focus_entered():
|
||||
%Search.grab_focus()
|
||||
|
||||
func _on_search_gui_input(event):
|
||||
if event is InputEventKey and (event.keycode == KEY_DOWN or event.keycode == KEY_UP) and event.pressed:
|
||||
if !%Suggestions.visible:
|
||||
_on_Search_text_changed('', true)
|
||||
current_selected = -1
|
||||
if event.keycode == KEY_DOWN:
|
||||
current_selected = wrapi(current_selected+1, 0, %Suggestions.item_count)
|
||||
if event.keycode == KEY_UP:
|
||||
current_selected = wrapi(current_selected-1, 0, %Suggestions.item_count)
|
||||
%Suggestions.select(current_selected)
|
||||
%Suggestions.ensure_current_is_visible()
|
||||
|
||||
func _on_search_focus_entered():
|
||||
%Focus.show()
|
||||
|
||||
func _on_search_focus_exited():
|
||||
%Focus.hide()
|
||||
if !%Suggestions.get_global_rect().has_point(get_global_mouse_position()):
|
||||
hide_suggestions()
|
||||
197
Sprout/addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://dpwhshre1n4t6"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.gd" id="1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_guyh1"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.1, 0.1, 0.1, 0.6)
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0, 0, 0, 0.6)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vennf"]
|
||||
|
||||
[sub_resource type="Image" id="Image_q6a87"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_xvxyn"]
|
||||
image = SubResource("Image_q6a87")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ma30x"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(1, 1, 1, 0.75)
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_right = 2.0
|
||||
expand_margin_bottom = 2.0
|
||||
|
||||
[node name="ComplexPicker" type="HBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -2.0
|
||||
offset_top = -2.0
|
||||
offset_right = -911.0
|
||||
offset_bottom = -615.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
focus_mode = 2
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
offset_top = 230.0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 253.0
|
||||
|
||||
[node name="PanelContainer" type="MarginContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_right = 243.0
|
||||
offset_bottom = 35.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 0
|
||||
theme_override_constants/margin_top = 0
|
||||
theme_override_constants/margin_right = 0
|
||||
theme_override_constants/margin_bottom = 0
|
||||
|
||||
[node name="BG" type="Panel" parent="PanelContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_right = 243.0
|
||||
offset_bottom = 35.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_guyh1")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
offset_right = 243.0
|
||||
offset_bottom = 35.0
|
||||
theme_override_constants/margin_left = 2
|
||||
theme_override_constants/margin_top = 2
|
||||
theme_override_constants/margin_right = 2
|
||||
theme_override_constants/margin_bottom = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
offset_left = 2.0
|
||||
offset_top = 2.0
|
||||
offset_right = 241.0
|
||||
offset_bottom = 33.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="PanelContainer/MarginContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_top = 15.0
|
||||
offset_bottom = 15.0
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Search" type="LineEdit" parent="PanelContainer/MarginContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 4.0
|
||||
offset_right = 211.0
|
||||
offset_bottom = 31.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
focus_neighbor_bottom = NodePath("Suggestions")
|
||||
focus_mode = 1
|
||||
mouse_filter = 1
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_vennf")
|
||||
placeholder_text = "Select Resource"
|
||||
expand_to_text_length = true
|
||||
flat = true
|
||||
caret_blink = true
|
||||
|
||||
[node name="Suggestions" type="ItemList" parent="PanelContainer/MarginContainer/HBoxContainer/Search"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
top_level = true
|
||||
custom_minimum_size = Vector2(-1086, 0)
|
||||
layout_mode = 0
|
||||
offset_left = -5.0
|
||||
offset_top = 36.0
|
||||
offset_right = 195.0
|
||||
offset_bottom = 71.0
|
||||
size_flags_vertical = 0
|
||||
auto_translate = false
|
||||
focus_neighbor_top = NodePath("..")
|
||||
max_text_lines = 3
|
||||
item_count = 1
|
||||
item_0/text = "Hello"
|
||||
|
||||
[node name="SelectButton" type="Button" parent="PanelContainer/MarginContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 215.0
|
||||
offset_right = 239.0
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 2
|
||||
focus_mode = 0
|
||||
toggle_mode = true
|
||||
shortcut_in_tooltip = false
|
||||
icon = SubResource("ImageTexture_xvxyn")
|
||||
flat = true
|
||||
|
||||
[node name="Focus" type="Panel" parent="PanelContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
offset_right = 243.0
|
||||
offset_bottom = 35.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ma30x")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
offset_left = 855.0
|
||||
offset_top = 230.0
|
||||
offset_right = 856.0
|
||||
offset_bottom = 253.0
|
||||
|
||||
[connection signal="focus_entered" from="." to="." method="_on_focus_entered"]
|
||||
[connection signal="focus_entered" from="PanelContainer/MarginContainer/HBoxContainer/Search" to="." method="_on_search_focus_entered"]
|
||||
[connection signal="focus_exited" from="PanelContainer/MarginContainer/HBoxContainer/Search" to="." method="_on_search_focus_exited"]
|
||||
[connection signal="gui_input" from="PanelContainer/MarginContainer/HBoxContainer/Search" to="." method="_on_search_gui_input"]
|
||||
[connection signal="gui_input" from="PanelContainer/MarginContainer/HBoxContainer/Search/Suggestions" to="." method="_on_suggestions_gui_input"]
|
||||
[connection signal="toggled" from="PanelContainer/MarginContainer/HBoxContainer/SelectButton" to="." method="_on_SelectButton_toggled"]
|
||||
129
Sprout/addons/dialogic/Editor/Events/Fields/ConditionPicker.gd
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
var property_name : String
|
||||
signal value_changed
|
||||
|
||||
func _ready():
|
||||
%ComplexEditor.add_theme_stylebox_override('normal', get_theme_stylebox('normal', 'LineEdit'))
|
||||
%ComplexEditor.add_theme_stylebox_override('focus', get_theme_stylebox('focus', 'LineEdit'))
|
||||
|
||||
%Operator.options = [
|
||||
{
|
||||
'label': '==',
|
||||
'value': '=='
|
||||
},
|
||||
{
|
||||
'label': '>',
|
||||
'value': '>'
|
||||
},
|
||||
{
|
||||
'label': '<',
|
||||
'value': '<'
|
||||
},
|
||||
{
|
||||
'label': '<=',
|
||||
'value': '<='
|
||||
},
|
||||
{
|
||||
'label': '>=',
|
||||
'value': '>='
|
||||
},
|
||||
{
|
||||
'label': '!=',
|
||||
'value': '!='
|
||||
}
|
||||
]
|
||||
%ToggleComplex.icon = get_theme_icon("Enum", "EditorIcons")
|
||||
|
||||
%Value1.resource_icon = get_theme_icon("ClassList", "EditorIcons")
|
||||
%Value1.get_suggestions_func = get_value1_suggestions
|
||||
%Value1.value_changed.connect(something_changed)
|
||||
%Operator.value_changed.connect(something_changed)
|
||||
|
||||
%Value2.resource_icon = get_theme_icon("Variant", "EditorIcons")
|
||||
%Value2.get_suggestions_func = get_value2_suggestions
|
||||
%Value2.value_changed.connect(something_changed)
|
||||
|
||||
func set_right_text(value:String):
|
||||
$RightText.text = str(value)
|
||||
$RightText.visible = !value.is_empty()
|
||||
|
||||
func set_left_text(value:String):
|
||||
$LeftText.text = str(value)
|
||||
$LeftText.visible = !value.is_empty()
|
||||
|
||||
func set_value(value:String):
|
||||
var too_complex = is_too_complex(value)
|
||||
%ToggleComplex.disabled = too_complex
|
||||
%ToggleComplex.button_pressed = too_complex
|
||||
%ComplexEditor.visible = too_complex
|
||||
%SimpleEditor.visible = !too_complex
|
||||
%ComplexEditor.text = value
|
||||
if not too_complex:
|
||||
var data = complex2simple(value)
|
||||
%Value1.set_value(data[0], data[0].trim_prefix("{").trim_suffix('}'))
|
||||
%Operator.set_value(data[1].strip_edges())
|
||||
%Value2.set_value(data[2], data[2].trim_prefix("{").trim_suffix('}'))
|
||||
|
||||
func something_changed(fake_arg1=null, fake_arg2 = null):
|
||||
if %ComplexEditor.visible:
|
||||
value_changed.emit(property_name, %ComplexEditor.text)
|
||||
elif %SimpleEditor.visible:
|
||||
value_changed.emit(property_name, simple2complex(%Value1.current_value, %Operator.get_value(), %Value2.current_value))
|
||||
|
||||
func is_too_complex(condition:String) -> bool:
|
||||
return !condition.is_empty() and len(condition.split(' ', false)) != 3
|
||||
|
||||
func complex2simple(condition:String) -> Array:
|
||||
if is_too_complex(condition) or condition.strip_edges().is_empty():
|
||||
return ['', '==','']
|
||||
var cond_split = Array(condition.split(' ', false))
|
||||
if cond_split[2].begins_with('"'): cond_split[2] = cond_split[2].trim_prefix('"').trim_suffix('"')
|
||||
return cond_split
|
||||
|
||||
func simple2complex(value1, operator, value2) -> String:
|
||||
if value1 == null: value1 = ''
|
||||
if value1.is_empty():
|
||||
return ''
|
||||
if value2 == null: value2 = ''
|
||||
if !value2.is_valid_float() and !value2.begins_with('{'):
|
||||
value2 = '"'+value2+'"'
|
||||
return value1 +" "+ operator +" "+ value2
|
||||
|
||||
func _on_toggle_complex_toggled(button_pressed) -> void:
|
||||
if button_pressed:
|
||||
%ComplexEditor.show()
|
||||
%SimpleEditor.hide()
|
||||
%ComplexEditor.text = simple2complex(%Value1.current_value, %Operator.get_value(), %Value2.current_value)
|
||||
else:
|
||||
if !is_too_complex(%ComplexEditor.text):
|
||||
%ComplexEditor.hide()
|
||||
%SimpleEditor.show()
|
||||
var data = complex2simple(%ComplexEditor.text)
|
||||
%Value1.set_value(data[0], data[0].trim_prefix("{").trim_suffix('}'))
|
||||
%Operator.set_value(data[1].strip_edges())
|
||||
%Value2.set_value(data[2], data[2].trim_prefix("{").trim_suffix('}'))
|
||||
|
||||
func _on_complex_editor_text_changed(new_text):
|
||||
%ToggleComplex.disabled = is_too_complex(%ComplexEditor.text)
|
||||
something_changed()
|
||||
|
||||
func get_value1_suggestions(filter:String) -> Dictionary:
|
||||
var suggestions = {}
|
||||
if filter:
|
||||
suggestions[filter] = {'value':filter, 'editor_icon':["GuiScrollArrowRight", "EditorIcons"]}
|
||||
var vars = DialogicUtil.get_project_setting('dialogic/variables', {})
|
||||
for var_path in DialogicUtil.list_variables(vars):
|
||||
suggestions[var_path] = {'value':'{'+var_path+"}", 'editor_icon':["ClassList", "EditorIcons"]}
|
||||
return suggestions
|
||||
|
||||
|
||||
func get_value2_suggestions(filter:String) -> Dictionary:
|
||||
var suggestions = {}
|
||||
if filter:
|
||||
suggestions[filter] = {'value':filter, 'editor_icon':["GuiScrollArrowRight", "EditorIcons"]}
|
||||
var vars = DialogicUtil.get_project_setting('dialogic/variables', {})
|
||||
for var_path in DialogicUtil.list_variables(vars):
|
||||
suggestions[var_path] = {'value':'{'+var_path+"}", 'editor_icon':["ClassList", "EditorIcons"]}
|
||||
return suggestions
|
||||
152
Sprout/addons/dialogic/Editor/Events/Fields/ConditionPicker.tscn
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://ir6334lqtuwt"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/ConditionPicker.gd" id="1_q5p62"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="1_rr7mq"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3bhehatwoio" path="res://addons/dialogic/Editor/Events/Fields/OptionSelector.tscn" id="4_27ir8"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6mta0"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.1, 0.1, 0.1, 0.6)
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0, 0, 0, 0.6)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_66k5i"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(1, 1, 1, 0.75)
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_right = 2.0
|
||||
expand_margin_bottom = 2.0
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q81pd"]
|
||||
content_margin_left = 3.75
|
||||
content_margin_top = 3.75
|
||||
content_margin_right = 3.75
|
||||
content_margin_bottom = 3.75
|
||||
bg_color = Color(0.113725, 0.121569, 0.145098, 1)
|
||||
border_color = Color(0.0784314, 0.0862745, 0.101961, 1)
|
||||
corner_radius_top_left = 2
|
||||
corner_radius_top_right = 2
|
||||
corner_radius_bottom_right = 2
|
||||
corner_radius_bottom_left = 2
|
||||
|
||||
[sub_resource type="Image" id="Image_vivn8"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_vtsk1"]
|
||||
image = SubResource("Image_vivn8")
|
||||
|
||||
[node name="ConditionPicker" type="HBoxContainer"]
|
||||
offset_right = 77.0
|
||||
offset_bottom = 31.0
|
||||
script = ExtResource("1_q5p62")
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 5.0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 28.0
|
||||
|
||||
[node name="SimpleEditor" type="HBoxContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 5.0
|
||||
offset_right = 542.0
|
||||
offset_bottom = 34.0
|
||||
|
||||
[node name="Value1" parent="SimpleEditor" instance=ExtResource("1_rr7mq")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
anchors_preset = 0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_right = 196.0
|
||||
offset_bottom = 34.0
|
||||
grow_horizontal = 1
|
||||
grow_vertical = 1
|
||||
placeholder_text = "Variable"
|
||||
disable_pretty_name = true
|
||||
|
||||
[node name="Operator" parent="SimpleEditor" instance=ExtResource("4_27ir8")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 200.0
|
||||
offset_right = 337.0
|
||||
offset_bottom = 34.0
|
||||
|
||||
[node name="Value2" parent="SimpleEditor" instance=ExtResource("1_rr7mq")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
anchors_preset = 0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_left = 341.0
|
||||
offset_right = 537.0
|
||||
offset_bottom = 34.0
|
||||
grow_horizontal = 1
|
||||
grow_vertical = 1
|
||||
placeholder_text = "Value"
|
||||
disable_pretty_name = true
|
||||
|
||||
[node name="ComplexEditor" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2i(150, 0)
|
||||
layout_mode = 2
|
||||
offset_left = 569.0
|
||||
offset_right = 1076.0
|
||||
offset_bottom = 34.0
|
||||
mouse_filter = 1
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_6mta0")
|
||||
theme_override_styles/focus = SubResource("StyleBoxFlat_66k5i")
|
||||
theme_override_styles/read_only = SubResource("StyleBoxFlat_q81pd")
|
||||
text = "VAR.Player.Health > 20 and VAR.Counter < 3 and randi()%3 == 2"
|
||||
placeholder_text = "Enter condition"
|
||||
expand_to_text_length = true
|
||||
|
||||
[node name="ToggleComplex" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 546.0
|
||||
offset_right = 570.0
|
||||
offset_bottom = 34.0
|
||||
tooltip_text = "Use complex expression"
|
||||
toggle_mode = true
|
||||
icon = SubResource("ImageTexture_vtsk1")
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 574.0
|
||||
offset_top = 5.0
|
||||
offset_right = 575.0
|
||||
offset_bottom = 28.0
|
||||
|
||||
[connection signal="text_changed" from="ComplexEditor" to="." method="_on_complex_editor_text_changed"]
|
||||
[connection signal="toggled" from="ToggleComplex" to="." method="_on_toggle_complex_toggled"]
|
||||
74
Sprout/addons/dialogic/Editor/Events/Fields/FilePicker.gd
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
@export var file_filter := ""
|
||||
@export var placeholder := ""
|
||||
@export var file_mode : EditorFileDialog.FileMode = EditorFileDialog.FILE_MODE_OPEN_FILE
|
||||
@export var resource_icon:Texture = null:
|
||||
get:
|
||||
return resource_icon
|
||||
set(new_icon):
|
||||
resource_icon = new_icon
|
||||
%Icon.texture = new_icon
|
||||
if new_icon == null:
|
||||
%Field.theme_type_variation = ""
|
||||
else:
|
||||
%Field.theme_type_variation = "LineEditWithIcon"
|
||||
var current_value : String
|
||||
var property_name : String
|
||||
signal value_changed
|
||||
|
||||
func _ready():
|
||||
DCSS.style(%Field, {
|
||||
'border-radius': 3,
|
||||
'border-color': get_theme_color("dark_color_3", "Editor"),
|
||||
'border': 1,
|
||||
'background': get_theme_color("dark_color_1", "Editor"),
|
||||
'padding': [5, 5],
|
||||
})
|
||||
$PanelContainer.add_theme_stylebox_override('panel', get_theme_stylebox("normal", "LineEdit"))
|
||||
%OpenButton.icon = get_theme_icon("Folder", "EditorIcons")
|
||||
%ClearButton.icon = get_theme_icon("Reload", "EditorIcons")
|
||||
%OpenButton.button_down.connect(_on_OpenButton_pressed)
|
||||
%ClearButton.button_up.connect(clear_path)
|
||||
%Field.set_drag_forwarding(self)
|
||||
%Field.placeholder_text = placeholder
|
||||
|
||||
func set_right_text(value:String):
|
||||
$RightText.text = str(value)
|
||||
$RightText.visible = !value.is_empty()
|
||||
|
||||
func set_left_text(value:String):
|
||||
$LeftText.text = str(value)
|
||||
$LeftText.visible = !value.is_empty()
|
||||
|
||||
func set_value(value):
|
||||
current_value = value
|
||||
if file_mode != EditorFileDialog.FILE_MODE_OPEN_DIR:
|
||||
%Field.text = value.get_file()
|
||||
tooltip_text = value
|
||||
%ClearButton.visible = !value.is_empty()
|
||||
else:
|
||||
%Field.text = value
|
||||
|
||||
func _on_OpenButton_pressed() -> void:
|
||||
find_parent('EditorView').godot_file_dialog(_on_file_dialog_selected, file_filter, file_mode, "Open "+ property_name)
|
||||
|
||||
func _on_file_dialog_selected(path:String) -> void:
|
||||
emit_signal("value_changed", property_name, path)
|
||||
set_value(path)
|
||||
|
||||
func clear_path():
|
||||
emit_signal("value_changed", property_name, "")
|
||||
set_value("")
|
||||
|
||||
func _can_drop_data_fw(position, data, from_control):
|
||||
if typeof(data) == TYPE_DICTIONARY and data.has('files') and len(data.files) == 1:
|
||||
if file_filter:
|
||||
if '*.'+data.files[0].get_extension() in file_filter:
|
||||
return true
|
||||
else: return true
|
||||
return false
|
||||
|
||||
func _drop_data_fw(position, data, from_control):
|
||||
_on_file_dialog_selected(data.files[0])
|
||||
118
Sprout/addons/dialogic/Editor/Events/Fields/FilePicker.tscn
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://7mvxuaulctcq"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/FilePicker.gd" id="1_838yp"]
|
||||
[ext_resource type="Theme" uid="uid://d3g4i4dshtdpu" path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" id="2_514jv"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_oahfl"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.1, 0.1, 0.1, 0.6)
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0, 0, 0, 0.6)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qm060"]
|
||||
content_margin_left = 3.75
|
||||
content_margin_top = 3.75
|
||||
content_margin_right = 3.75
|
||||
content_margin_bottom = 3.75
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_color = Color(0, 0, 0, 1)
|
||||
corner_radius_top_left = 2
|
||||
corner_radius_top_right = 2
|
||||
corner_radius_bottom_right = 2
|
||||
corner_radius_bottom_left = 2
|
||||
|
||||
[sub_resource type="Image" id="Image_b3vou"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_bx3tb"]
|
||||
image = SubResource("Image_b3vou")
|
||||
|
||||
[node name="FilePicker" type="HBoxContainer"]
|
||||
offset_right = 340.0
|
||||
offset_bottom = 40.0
|
||||
script = ExtResource("1_838yp")
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
offset_top = 8.0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 31.0
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 340.0
|
||||
offset_bottom = 40.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_oahfl")
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
offset_left = 4.0
|
||||
offset_top = 4.0
|
||||
offset_right = 336.0
|
||||
offset_bottom = 36.0
|
||||
alignment = 2
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="PanelContainer/HBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_top = 16.0
|
||||
offset_bottom = 16.0
|
||||
size_flags_vertical = 4
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Field" type="LineEdit" parent="PanelContainer/HBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 4.0
|
||||
offset_right = 276.0
|
||||
offset_bottom = 32.0
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 1
|
||||
theme = ExtResource("2_514jv")
|
||||
theme_type_variation = &"LineEditWithIcon"
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_qm060")
|
||||
theme_override_styles/focus = SubResource("StyleBoxFlat_qm060")
|
||||
theme_override_styles/read_only = SubResource("StyleBoxFlat_qm060")
|
||||
expand_to_text_length = true
|
||||
|
||||
[node name="OpenButton" type="Button" parent="PanelContainer/HBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 280.0
|
||||
offset_right = 304.0
|
||||
offset_bottom = 32.0
|
||||
icon = SubResource("ImageTexture_bx3tb")
|
||||
flat = true
|
||||
|
||||
[node name="ClearButton" type="Button" parent="PanelContainer/HBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
offset_left = 308.0
|
||||
offset_right = 332.0
|
||||
offset_bottom = 32.0
|
||||
icon = SubResource("ImageTexture_bx3tb")
|
||||
flat = true
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
offset_left = 339.0
|
||||
offset_top = 8.0
|
||||
offset_right = 340.0
|
||||
offset_bottom = 31.0
|
||||
13
Sprout/addons/dialogic/Editor/Events/Fields/Label.gd
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
|
||||
@export var text: String = "Hello World"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$Label.text = text
|
||||
#$Label.text = DTS.translate(text)
|
||||
$Label.set('custom_colors/font_color', Color("#7b7b7b"))
|
||||
|
||||
18
Sprout/addons/dialogic/Editor/Events/Fields/Label.tscn
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Fields/Label.gd" type="Script" id=1]
|
||||
|
||||
[node name="Control" type="CenterContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 1
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
margin_left = 474.0
|
||||
margin_top = 293.0
|
||||
margin_right = 550.0
|
||||
margin_bottom = 307.0
|
||||
size_flags_horizontal = 3
|
||||
custom_colors/font_color = Color( 0.482353, 0.482353, 0.482353, 1 )
|
||||
text = "Hello World"
|
||||
48
Sprout/addons/dialogic/Editor/Events/Fields/MultilineText.gd
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
var property_name : String
|
||||
signal value_changed
|
||||
|
||||
func _ready():
|
||||
find_parent('TimelineArea').resized.connect(change_size)
|
||||
$TextEdit.text_changed.connect(text_changed)
|
||||
change_size()
|
||||
|
||||
func text_changed(value = ""):
|
||||
change_size()
|
||||
emit_signal("value_changed", property_name, $TextEdit.text)
|
||||
|
||||
func set_left_text(value):
|
||||
$LeftText.text = str(value)
|
||||
|
||||
func set_right_text(value):
|
||||
$RightText.text = str(value)
|
||||
|
||||
func set_value(value):
|
||||
$TextEdit.text = str(value)
|
||||
|
||||
|
||||
|
||||
func change_size():
|
||||
# the distance between the sidebar of the timeline editor and the TextEdit box.
|
||||
var max_width = find_parent('View').get_node('ScrollContainer').global_position.x- $TextEdit.global_position.x
|
||||
# adding a margin
|
||||
max_width -= 50 * DialogicUtil.get_editor_scale()
|
||||
|
||||
var font = get_theme_font("normal_font")
|
||||
var line_height = font.get_height()+4
|
||||
|
||||
var longest_line_len = 0
|
||||
var lines = 0
|
||||
for line in $TextEdit.text.split("\n"):
|
||||
longest_line_len = font.get_string_size(line).x if font.get_string_size(line).x > longest_line_len else longest_line_len
|
||||
if font.get_string_size(line).x+50 > max_width:
|
||||
lines += ceil(get_theme_font("normal_font").get_string_size(line).x/(max_width))
|
||||
lines += 1
|
||||
|
||||
# because there is a margin and a number inside the stylebox (especially to the left) this needs to be added
|
||||
longest_line_len += 50 * DialogicUtil.get_editor_scale()
|
||||
$TextEdit.custom_minimum_size.x = min(max_width, longest_line_len)
|
||||
# a margin has to be added vertically as well because of the stylebox
|
||||
$TextEdit.custom_minimum_size.y = line_height*lines + (20 * DialogicUtil.get_editor_scale())
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dyp7m2nvab1aj"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/MultilineText.gd" id="1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bofjx"]
|
||||
content_margin_left = 16.0
|
||||
content_margin_top = 14.0
|
||||
bg_color = Color(0.09, 0.09, 0.09, 0.588235)
|
||||
corner_radius_top_right = 8
|
||||
corner_radius_bottom_right = 8
|
||||
|
||||
[node name="MultilineText" type="HBoxContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
visible = false
|
||||
offset_top = 288.0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 311.0
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="."]
|
||||
offset_right = 1024.0
|
||||
offset_bottom = 600.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_bofjx")
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
visible = false
|
||||
offset_left = 1023.0
|
||||
offset_top = 288.0
|
||||
offset_right = 1024.0
|
||||
offset_bottom = 311.0
|
||||
84
Sprout/addons/dialogic/Editor/Events/Fields/Number.gd
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
var property_name : String
|
||||
@export var allow_string :bool = false
|
||||
@export var step:float = 0.1
|
||||
@export var enforce_step:bool = true
|
||||
@export var min:float = 0
|
||||
@export var max:float= 999
|
||||
@export var value = 0
|
||||
@export var suffix := ""
|
||||
signal value_changed
|
||||
|
||||
func _ready():
|
||||
if $Value.text.is_empty():
|
||||
set_value(value)
|
||||
$Spin.icon = get_theme_icon("updown", "SpinBox")
|
||||
$Value.add_theme_stylebox_override('normal', get_theme_stylebox('normal', 'LineEdit'))
|
||||
$Value.add_theme_stylebox_override('focus', get_theme_stylebox('focus', 'LineEdit'))
|
||||
|
||||
func set_right_text(value):
|
||||
$RightText.text = str(value)
|
||||
$RightText.visible = !value.is_empty()
|
||||
|
||||
func set_left_text(value):
|
||||
$LeftText.text = str(value)
|
||||
$LeftText.visible = !value.is_empty()
|
||||
|
||||
func set_value(new_value) -> void:
|
||||
if new_value:
|
||||
_on_value_text_submitted(str(new_value))
|
||||
else:
|
||||
_on_value_text_submitted(str(value))
|
||||
|
||||
func get_value():
|
||||
return value
|
||||
|
||||
func use_timestamp_mode():
|
||||
step = 0.1
|
||||
suffix = ' sec'
|
||||
max = 9999 #2.7 hours. Enough, or is more needed?
|
||||
|
||||
func use_float_mode():
|
||||
step = 0.1
|
||||
suffix = ""
|
||||
enforce_step = false
|
||||
|
||||
func use_int_mode():
|
||||
step = 1
|
||||
suffix = ""
|
||||
|
||||
func use_decibel_mode():
|
||||
max = 6
|
||||
suffix = "dB"
|
||||
min = -80
|
||||
|
||||
func set_max_value(value):
|
||||
max = value
|
||||
|
||||
func set_min_value(value):
|
||||
min = value
|
||||
|
||||
func _on_spin_gui_input(event):
|
||||
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
||||
if event.position.y < size.y/2.0:
|
||||
_on_value_text_submitted(str(value+step))
|
||||
else:
|
||||
_on_value_text_submitted(str(value-step))
|
||||
|
||||
|
||||
func _on_value_text_submitted(new_text):
|
||||
new_text = new_text.trim_suffix(suffix)
|
||||
if new_text.is_valid_float():
|
||||
var temp:float = min(max(new_text.to_float(), min), max)
|
||||
if !enforce_step or temp/step == round(temp/step):
|
||||
value = temp
|
||||
elif allow_string:
|
||||
value = new_text
|
||||
$Value.text = str(value)+suffix
|
||||
value_changed.emit(property_name, value)
|
||||
|
||||
|
||||
func _on_value_focus_exited():
|
||||
_on_value_text_submitted($Value.text)
|
||||
66
Sprout/addons/dialogic/Editor/Events/Fields/Number.tscn
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://kdpp3mibml33"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/Number.gd" id="1"]
|
||||
[ext_resource type="Theme" uid="uid://d3g4i4dshtdpu" path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" id="2_u2kma"]
|
||||
|
||||
[sub_resource type="Image" id="Image_q6bmg"]
|
||||
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, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 75, 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, 99, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 99, 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, 4, 255, 255, 255, 122, 255, 255, 255, 191, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 191, 255, 255, 255, 121, 255, 255, 255, 4, 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, 12, 255, 255, 255, 142, 255, 255, 255, 191, 255, 255, 255, 181, 255, 255, 255, 53, 255, 255, 255, 54, 255, 255, 255, 181, 255, 255, 255, 191, 255, 255, 255, 142, 255, 255, 255, 12, 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, 71, 255, 255, 255, 191, 255, 255, 255, 171, 255, 255, 255, 36, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 36, 255, 255, 255, 171, 255, 255, 255, 191, 255, 255, 255, 71, 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, 86, 255, 255, 255, 22, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 22, 255, 255, 255, 86, 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, 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, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 86, 255, 255, 255, 22, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 22, 255, 255, 255, 86, 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, 71, 255, 255, 255, 191, 255, 255, 255, 171, 255, 255, 255, 36, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 36, 255, 255, 255, 171, 255, 255, 255, 191, 255, 255, 255, 71, 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, 12, 255, 255, 255, 142, 255, 255, 255, 191, 255, 255, 255, 181, 255, 255, 255, 54, 255, 255, 255, 54, 255, 255, 255, 182, 255, 255, 255, 191, 255, 255, 255, 142, 255, 255, 255, 12, 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, 4, 255, 255, 255, 121, 255, 255, 255, 191, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 191, 255, 255, 255, 121, 255, 255, 255, 4, 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, 98, 255, 255, 255, 191, 255, 255, 255, 191, 255, 255, 255, 98, 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, 75, 255, 255, 255, 75, 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, 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_cbs3g"]
|
||||
image = SubResource("Image_q6bmg")
|
||||
|
||||
[node name="NumberValue" type="HBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -1036.0
|
||||
offset_bottom = -615.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 0
|
||||
script = ExtResource("1")
|
||||
min = 0.0
|
||||
max = 999.0
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 5.0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 28.0
|
||||
|
||||
[node name="Value" type="LineEdit" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 1.0
|
||||
offset_right = 46.0
|
||||
offset_bottom = 33.0
|
||||
theme = ExtResource("2_u2kma")
|
||||
theme_override_constants/minimum_character_width = 0
|
||||
expand_to_text_length = true
|
||||
|
||||
[node name="Spin" type="Button" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 46.0
|
||||
offset_top = 4.0
|
||||
offset_right = 70.0
|
||||
offset_bottom = 28.0
|
||||
size_flags_vertical = 4
|
||||
focus_mode = 0
|
||||
icon = SubResource("ImageTexture_cbs3g")
|
||||
flat = true
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 70.0
|
||||
offset_top = 5.0
|
||||
offset_right = 71.0
|
||||
offset_bottom = 28.0
|
||||
|
||||
[connection signal="focus_exited" from="Value" to="." method="_on_value_focus_exited"]
|
||||
[connection signal="text_submitted" from="Value" to="." method="_on_value_text_submitted"]
|
||||
[connection signal="gui_input" from="Spin" to="." method="_on_spin_gui_input"]
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
var property_name : String
|
||||
signal value_changed
|
||||
|
||||
var options : Array = []
|
||||
var disabled = false:
|
||||
get:
|
||||
return disabled
|
||||
set(_disabled):
|
||||
disabled = _disabled
|
||||
$MenuButton.disabled = disabled
|
||||
$MenuButton.focus_mode = FOCUS_NONE
|
||||
|
||||
func _ready():
|
||||
$MenuButton.add_theme_stylebox_override("normal", get_theme_stylebox("normal", "LineEdit"))
|
||||
$MenuButton.add_theme_stylebox_override("hover", get_theme_stylebox("normal", "LineEdit"))
|
||||
|
||||
$MenuButton.add_theme_stylebox_override("focus", get_theme_stylebox("focus", "LineEdit"))
|
||||
$MenuButton.add_theme_stylebox_override("disabled", get_theme_stylebox("normal", "LineEdit"))
|
||||
$MenuButton.add_theme_color_override("font_disabled_color", get_theme_color("font_color", "MenuButton"))
|
||||
$MenuButton.about_to_popup.connect(insert_options)
|
||||
$MenuButton.get_popup().index_pressed.connect(index_pressed)
|
||||
set_left_text('')
|
||||
set_right_text('')
|
||||
|
||||
func set_right_text(value:String):
|
||||
$RightText.text = str(value)
|
||||
$RightText.visible = !value.is_empty()
|
||||
|
||||
func set_left_text(value:String):
|
||||
$LeftText.text = str(value)
|
||||
$LeftText.visible = !value.is_empty()
|
||||
|
||||
func set_value(value):
|
||||
for option in options:
|
||||
if option['value'] == value:
|
||||
$MenuButton.text = option['label']
|
||||
$MenuButton.icon = option.get('icon', load("res://addons/dialogic/Editor/Images/Dropdown/default.svg"))
|
||||
|
||||
func get_value():
|
||||
return $MenuButton.text
|
||||
|
||||
func insert_options():
|
||||
$MenuButton.get_popup().clear()
|
||||
|
||||
var idx = 0
|
||||
for option in options:
|
||||
$MenuButton.get_popup().add_icon_item(option.get('icon',load("res://addons/dialogic/Editor/Images/Dropdown/default.svg")), option['label'])
|
||||
$MenuButton.get_popup().set_item_metadata(idx, option['value'])
|
||||
idx += 1
|
||||
|
||||
func index_pressed(idx):
|
||||
$MenuButton.text = $MenuButton.get_popup().get_item_text(idx)
|
||||
$MenuButton.icon = $MenuButton.get_popup().get_item_icon(idx)
|
||||
|
||||
emit_signal("value_changed", property_name, $MenuButton.get_popup().get_item_metadata(idx))
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://d3bhehatwoio"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/OptionSelector.gd" id="1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6mta0"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.1, 0.1, 0.1, 0.6)
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0, 0, 0, 0.6)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_66k5i"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(1, 1, 1, 0.75)
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_right = 2.0
|
||||
expand_margin_bottom = 2.0
|
||||
|
||||
[node name="OptionSelector" type="HBoxContainer"]
|
||||
offset_right = 137.0
|
||||
offset_bottom = 43.0
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
offset_top = 288.0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 311.0
|
||||
|
||||
[node name="MenuButton" type="MenuButton" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 137.0
|
||||
offset_bottom = 43.0
|
||||
focus_mode = 2
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_6mta0")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_6mta0")
|
||||
theme_override_styles/disabled = SubResource("StyleBoxFlat_66k5i")
|
||||
theme_override_styles/focus = SubResource("StyleBoxFlat_66k5i")
|
||||
text = "Placeholder Text"
|
||||
flat = false
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
offset_left = 62.0
|
||||
offset_top = 288.0
|
||||
offset_right = 63.0
|
||||
offset_bottom = 311.0
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
var property_name : String
|
||||
var placeholder :String= "":
|
||||
set(value):
|
||||
placeholder = value
|
||||
$TextEdit.placeholder_text = placeholder
|
||||
|
||||
signal value_changed
|
||||
|
||||
func _ready():
|
||||
$TextEdit.text_changed.connect(text_changed)
|
||||
$TextEdit.add_theme_stylebox_override('normal', get_theme_stylebox('normal', 'LineEdit'))
|
||||
$TextEdit.add_theme_stylebox_override('focus', get_theme_stylebox('focus', 'LineEdit'))
|
||||
|
||||
func text_changed(value = ""):
|
||||
emit_signal("value_changed", property_name, $TextEdit.text)
|
||||
|
||||
func set_left_text(value):
|
||||
$LeftText.text = str(value)
|
||||
$LeftText.visible = !value.is_empty()
|
||||
|
||||
func set_right_text(value):
|
||||
$RightText.text = str(value)
|
||||
$RightText.visible = !value.is_empty()
|
||||
|
||||
func set_value(value):
|
||||
$TextEdit.text = str(value)
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://c0vkcehgjsjy"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/SinglelineText.gd" id="1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6mta0"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.1, 0.1, 0.1, 0.6)
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0, 0, 0, 0.6)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_66k5i"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(1, 1, 1, 0.75)
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_right = 2.0
|
||||
expand_margin_bottom = 2.0
|
||||
|
||||
[node name="SinglelineText" type="HBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_bottom = -567.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 0
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 29.0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 52.0
|
||||
|
||||
[node name="TextEdit" type="LineEdit" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 5.0
|
||||
offset_right = 1147.0
|
||||
offset_bottom = 81.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_6mta0")
|
||||
theme_override_styles/focus = SubResource("StyleBoxFlat_66k5i")
|
||||
expand_to_text_length = true
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 1151.0
|
||||
offset_top = 29.0
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 52.0
|
||||
24
Sprout/addons/dialogic/Editor/Events/Fields/Vector2.gd
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
var property_name : String
|
||||
signal value_changed
|
||||
|
||||
func _ready():
|
||||
$X.value_changed.connect(_on_value_changed)
|
||||
$Y.value_changed.connect(_on_value_changed)
|
||||
|
||||
func _on_value_changed(property, value):
|
||||
emit_signal("value_changed", property_name, Vector2($X.value, $Y.value))
|
||||
|
||||
func set_right_text(value):
|
||||
$RightText.text = str(value)
|
||||
$RightText.visible = !value.is_empty()
|
||||
|
||||
func set_left_text(value):
|
||||
$LeftText.text = str(value)
|
||||
$LeftText.visible = !value.is_empty()
|
||||
|
||||
func set_value(value:Vector2):
|
||||
$X.set_value(value.x)
|
||||
$Y.set_value(value.y)
|
||||
53
Sprout/addons/dialogic/Editor/Events/Fields/Vector2.tscn
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dtimnsj014cu"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/Vector2.gd" id="1_288li"]
|
||||
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/Number.tscn" id="3_l3bum"]
|
||||
|
||||
[node name="Vector2" type="HBoxContainer"]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
theme_override_constants/separation = -7
|
||||
script = ExtResource("1_288li")
|
||||
|
||||
[node name="LeftText" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 8.0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 31.0
|
||||
|
||||
[node name="X" parent="." instance=ExtResource("3_l3bum")]
|
||||
layout_mode = 2
|
||||
anchors_preset = 0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_left = -6.0
|
||||
offset_right = 42.0
|
||||
offset_bottom = 40.0
|
||||
grow_horizontal = 1
|
||||
grow_vertical = 1
|
||||
step = 1.0
|
||||
min = -9999.0
|
||||
max = 9999.0
|
||||
suffix = "x"
|
||||
|
||||
[node name="Y" parent="." instance=ExtResource("3_l3bum")]
|
||||
layout_mode = 2
|
||||
anchors_preset = 0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_left = 35.0
|
||||
offset_right = 83.0
|
||||
offset_bottom = 40.0
|
||||
grow_horizontal = 1
|
||||
grow_vertical = 1
|
||||
step = 1.0
|
||||
min = -9999.0
|
||||
max = 9999.0
|
||||
suffix = "y"
|
||||
|
||||
[node name="RightText" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 76.0
|
||||
offset_top = 8.0
|
||||
offset_right = 77.0
|
||||
offset_bottom = 31.0
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
[gd_resource type="Theme" load_steps=3 format=3 uid="uid://d3g4i4dshtdpu"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="1"]
|
||||
content_margin_left = 30.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_right = 20.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color(0.12549, 0.141176, 0.192157, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.0980392, 0.113725, 0.152941, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="2"]
|
||||
content_margin_left = 11.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_right = 20.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color(0.12549, 0.141176, 0.192157, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.0980392, 0.113725, 0.152941, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[resource]
|
||||
LineEdit/colors/clear_button_color = Color(0, 0, 0, 1)
|
||||
LineEdit/colors/clear_button_color_pressed = Color(0, 0, 0, 1)
|
||||
LineEdit/colors/cursor_color = Color(1, 1, 1, 1)
|
||||
LineEdit/colors/font_color = Color(1, 1, 1, 1)
|
||||
LineEdit/colors/font_color_selected = Color(1, 1, 1, 1)
|
||||
LineEdit/colors/font_color_uneditable = Color(1, 1, 1, 1)
|
||||
LineEdit/colors/selection_color = Color(1, 1, 1, 0.235294)
|
||||
LineEdit/constants/minimum_spaces = 10
|
||||
LineEdit/fonts/font = null
|
||||
LineEdit/icons/clear = null
|
||||
LineEdit/styles/focus = SubResource("1")
|
||||
LineEdit/styles/normal = SubResource("2")
|
||||
LineEdit/styles/read_only = SubResource("1")
|
||||
LineEditWithIcon/base_type = &"LineEdit"
|
||||
LineEditWithIcon/styles/normal = SubResource("1")
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 25.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color( 0.466667, 0.466667, 0.466667, 0.141176 )
|
||||
border_width_bottom = 2
|
||||
corner_radius_top_left = 4
|
||||
corner_radius_top_right = 4
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 25.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color( 0.180392, 0.180392, 0.180392, 0.219608 )
|
||||
draw_center = false
|
||||
border_width_bottom = 2
|
||||
border_color = Color( 0.8, 0.8, 0.8, 0.286275 )
|
||||
corner_radius_top_left = 4
|
||||
corner_radius_top_right = 4
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
[gd_resource type="StyleBoxFlat" format=3 uid="uid://c8k6tbipodsg"]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.8, 0.8, 0.8, 0.109804)
|
||||
corner_radius_top_left = 4
|
||||
corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 6.0
|
||||
content_margin_right = 6.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color( 0.6, 0.6, 0.6, 0 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.2, 0.227451, 0.309804, 1 )
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 30.0
|
||||
content_margin_right = 25.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color( 0.12549, 0.141176, 0.192157, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.0980392, 0.113725, 0.152941, 1 )
|
||||
border_blend = true
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 3.0
|
||||
content_margin_right = 3.0
|
||||
content_margin_top = 3.0
|
||||
content_margin_bottom = 3.0
|
||||
bg_color = Color( 0.2, 0.231373, 0.309804, 0.317647 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.8, 0.8, 0.8, 0.109804 )
|
||||
corner_radius_top_left = 4
|
||||
corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 3.0
|
||||
content_margin_right = 3.0
|
||||
content_margin_top = 3.0
|
||||
content_margin_bottom = 3.0
|
||||
bg_color = Color( 0.2, 0.231373, 0.309804, 0.235294 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.8, 0.8, 0.8, 0.109804 )
|
||||
corner_radius_top_left = 4
|
||||
corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 16.0
|
||||
content_margin_top = 14.0
|
||||
bg_color = Color( 0.27451, 0.27451, 0.27451, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.454902, 0.454902, 0.454902, 1 )
|
||||
corner_radius_top_left = 8
|
||||
corner_radius_top_right = 8
|
||||
corner_radius_bottom_right = 8
|
||||
corner_radius_bottom_left = 8
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
[gd_resource type="StyleBoxFlat" format=3 uid="uid://obyrr26pqk2p"]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 16.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 6.0
|
||||
content_margin_bottom = 0.0
|
||||
bg_color = Color(0.509804, 0.509804, 0.509804, 0.207843)
|
||||
border_width_left = 5
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_bottom_left = 5
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_bottom = 2.0
|
||||
54
Sprout/addons/dialogic/Editor/HomePage/home_page.gd
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
@tool
|
||||
extends DialogicEditor
|
||||
|
||||
## A Main page in the dialogic editor.
|
||||
|
||||
func _ready():
|
||||
var edit_scale := DialogicUtil.get_editor_scale()
|
||||
var min_height := 0
|
||||
for box in %BoxHolder.get_children():
|
||||
box.self_modulate = get_theme_color("accent_color", "Editor")
|
||||
box.custom_minimum_size.x = 220 * edit_scale
|
||||
if box.get_index() < ceilf(%BoxHolder.get_child_count()/2.0):
|
||||
min_height += box.size.y
|
||||
|
||||
%VersionLabel.set('theme_override_font_sizes/font_size', 20 * edit_scale)
|
||||
$CenterContainer/ScrollContainer.custom_minimum_size.x = 440 *edit_scale
|
||||
%BoxHolder.custom_minimum_size.y = min_height+100*edit_scale
|
||||
set('theme_override_constants/separation', 30*edit_scale)
|
||||
|
||||
|
||||
func _register():
|
||||
editors_manager.register_simple_editor(self)
|
||||
get_parent().set_tab_icon(get_index(), load("res://addons/dialogic/Editor/Images/plugin-icon.svg"))
|
||||
get_parent().set_tab_title(get_index(), '')
|
||||
|
||||
editors_manager.add_custom_button('Wiki',
|
||||
get_theme_icon("Help", "EditorIcons"),
|
||||
self).pressed.connect(_on_wiki_button_pressed)
|
||||
|
||||
editors_manager.add_custom_button('Discord',
|
||||
get_theme_icon("AnimatedSprite3D", "EditorIcons"),
|
||||
self).pressed.connect(_on_discord_button_pressed)
|
||||
|
||||
|
||||
func _on_discord_button_pressed() -> void:
|
||||
OS.shell_open("https://discord.gg/2hHQzkf2pX")
|
||||
|
||||
|
||||
func _on_wiki_button_pressed() -> void:
|
||||
OS.shell_open("https://github.com/coppolaemilio/dialogic/wiki")
|
||||
|
||||
|
||||
func _on_wiki_box_button_pressed():
|
||||
OS.shell_open("https://github.com/coppolaemilio/dialogic/wiki/Tutorial:-Getting-Started")
|
||||
|
||||
|
||||
func _on_sharing_box_button_pressed():
|
||||
_on_discord_button_pressed()
|
||||
|
||||
func _on_bug_box_button_pressed():
|
||||
OS.shell_open("https://github.com/coppolaemilio/dialogic/issues/new/choose")
|
||||
|
||||
func _on_restart_box_button_pressed():
|
||||
find_parent('EditorView').plugin_reference.get_editor_interface().restart_editor()
|
||||
168
Sprout/addons/dialogic/Editor/HomePage/home_page.tscn
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://cqy73hshqqgga"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/HomePage/home_page.gd" id="1_6g38w"]
|
||||
[ext_resource type="Texture2D" uid="uid://6vklqnh10h2l" path="res://addons/dialogic/Example Assets/backgrounds/green-field.png" id="2_3lw3i"]
|
||||
[ext_resource type="Texture2D" uid="uid://obluub5vopwh" path="res://addons/dialogic/Editor/Images/dialogic-logo.svg" id="3_3leok"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbaphnheyups7" path="res://addons/dialogic/Editor/HomePage/home_page_box.tscn" id="4_hn0gf"]
|
||||
[ext_resource type="Texture2D" uid="uid://bo05fpcssk3on" path="res://addons/dialogic/Example Assets/backgrounds/vn-background-1.png" id="4_jm73p"]
|
||||
[ext_resource type="Texture2D" uid="uid://d27q1suc8riu8" path="res://addons/dialogic/Example Assets/backgrounds/vn-background-3.png" id="5_w572g"]
|
||||
[ext_resource type="Texture2D" uid="uid://dx4yxfw4u8y7r" path="res://addons/dialogic/Example Assets/backgrounds/vn-background-2.png" id="6_p1dg6"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_1gns2"]
|
||||
colors = PackedColorArray(0.00784314, 0.00784314, 0.00784314, 0.203922, 1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_u0aw3"]
|
||||
gradient = SubResource("Gradient_1gns2")
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
fill_to = Vector2(1, 1)
|
||||
|
||||
[node name="HomePage" type="VBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -568.0
|
||||
offset_top = 8.0
|
||||
offset_right = -568.0
|
||||
offset_bottom = -1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 22
|
||||
script = ExtResource("1_6g38w")
|
||||
|
||||
[node name="Header" type="TextureRect" parent="."]
|
||||
self_modulate = Color(0.223529, 0.223529, 0.223529, 1)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 0.4
|
||||
texture = ExtResource("2_3lw3i")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="Vignette" type="TextureRect" parent="Header"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = SubResource("GradientTexture2D_u0aw3")
|
||||
|
||||
[node name="Logo" type="TextureRect" parent="Header"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 21.0
|
||||
offset_top = 25.0
|
||||
offset_right = -21.0
|
||||
offset_bottom = -25.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 0.3
|
||||
texture = ExtResource("3_3leok")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="VersionLabel" type="Label" parent="Header"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -73.0
|
||||
offset_top = -34.0
|
||||
offset_right = 77.0
|
||||
offset_bottom = -8.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
text = "Version 2.0-Alpha-5"
|
||||
|
||||
[node name="CenterContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="CenterContainer"]
|
||||
custom_minimum_size = Vector2(330, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="BoxHolder" type="VFlowContainer" parent="CenterContainer/ScrollContainer/MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 764)
|
||||
layout_mode = 2
|
||||
theme_override_constants/h_separation = 20
|
||||
theme_override_constants/v_separation = 20
|
||||
|
||||
[node name="WelcomeBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
|
||||
custom_minimum_size = Vector2(165, 0)
|
||||
layout_mode = 2
|
||||
title = "Welcome!"
|
||||
content = "Welcome to dialogic! Easily create visual novels or dialogs for your game."
|
||||
image = ExtResource("4_jm73p")
|
||||
|
||||
[node name="WikiBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
|
||||
custom_minimum_size = Vector2(165, 0)
|
||||
layout_mode = 2
|
||||
title = "How to start:"
|
||||
content = "If you are new to dialogic, check out the beginners guide in the wiki."
|
||||
image = ExtResource("6_p1dg6")
|
||||
button = "Beginners guide"
|
||||
|
||||
[node name="RestartBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
|
||||
custom_minimum_size = Vector2(165, 0)
|
||||
layout_mode = 2
|
||||
title = "Just installed?"
|
||||
content = "If you've just installed dialogic you might need to restart godot once, so all scripts load correctly!"
|
||||
image = ExtResource("2_3lw3i")
|
||||
button = "Restart now"
|
||||
|
||||
[node name="BugBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
|
||||
custom_minimum_size = Vector2(165, 0)
|
||||
layout_mode = 2
|
||||
title = "Something broken!?"
|
||||
content = "You found a bug? Or feel like something could be improved? Create a github issue to let us know!"
|
||||
image = ExtResource("2_3lw3i")
|
||||
button = "New issue"
|
||||
|
||||
[node name="SharingBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
|
||||
custom_minimum_size = Vector2(165, 0)
|
||||
layout_mode = 2
|
||||
title = "Making something?"
|
||||
content = "We always like to hear about cool things being made with dialogic. Let us know what you are using it for!"
|
||||
image = ExtResource("5_w572g")
|
||||
button = "Join Discord"
|
||||
|
||||
[node name="HBoxContainer" type="ScrollContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="HBoxContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="AspectRatioContainer" type="AspectRatioContainer" parent="HBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="button_pressed" from="CenterContainer/ScrollContainer/MarginContainer/BoxHolder/WikiBox" to="." method="_on_wiki_box_button_pressed"]
|
||||
[connection signal="button_pressed" from="CenterContainer/ScrollContainer/MarginContainer/BoxHolder/RestartBox" to="." method="_on_restart_box_button_pressed"]
|
||||
[connection signal="button_pressed" from="CenterContainer/ScrollContainer/MarginContainer/BoxHolder/BugBox" to="." method="_on_bug_box_button_pressed"]
|
||||
[connection signal="button_pressed" from="CenterContainer/ScrollContainer/MarginContainer/BoxHolder/SharingBox" to="." method="_on_sharing_box_button_pressed"]
|
||||
32
Sprout/addons/dialogic/Editor/HomePage/home_page_box.gd
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
@tool
|
||||
extends PanelContainer
|
||||
|
||||
signal button_pressed
|
||||
|
||||
@export var title := "Title"
|
||||
@export var content := "Somet text that is interesting."
|
||||
@export var image := Texture.new()
|
||||
@export var button := ""
|
||||
|
||||
func _ready():
|
||||
%Title.text = title
|
||||
%Content.text = content
|
||||
%Header.texture = image
|
||||
%Button.visible = !button.is_empty()
|
||||
%Button.text = button
|
||||
var editor_scale := DialogicUtil.get_editor_scale()
|
||||
get('theme_override_styles/panel').corner_radius_top_left = 10 * editor_scale
|
||||
get('theme_override_styles/panel').corner_radius_top_right = 10 * editor_scale
|
||||
get('theme_override_styles/panel').corner_radius_bottom_left = 20 * editor_scale
|
||||
get('theme_override_styles/panel').corner_radius_bottom_right = 20 * editor_scale
|
||||
get('theme_override_styles/panel').content_margin_top = 10 * editor_scale
|
||||
%Header.custom_minimum_size.y = 50 * editor_scale
|
||||
%Title.set('theme_override_font_sizes/font_size', 20 * editor_scale)
|
||||
$Vbox/Content.set('theme_override_constants/margin_left', 10*editor_scale)
|
||||
$Vbox/Content.set('theme_override_constants/margin_right', 10*editor_scale)
|
||||
$Vbox/Content.set('theme_override_constants/margin_down', 10*editor_scale)
|
||||
$Vbox/Content.set('theme_override_constants/margin_top', 10*editor_scale)
|
||||
|
||||
|
||||
func _on_button_pressed():
|
||||
button_pressed.emit()
|
||||
79
Sprout/addons/dialogic/Editor/HomePage/home_page_box.tscn
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bbaphnheyups7"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/HomePage/home_page_box.gd" id="1_tfhxr"]
|
||||
[ext_resource type="Texture2D" uid="uid://bo05fpcssk3on" path="res://addons/dialogic/Example Assets/backgrounds/vn-background-1.png" id="2_7vfiv"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e3ugl"]
|
||||
content_margin_top = 7.5
|
||||
bg_color = Color(0.0745098, 0.0745098, 0.0745098, 1)
|
||||
border_width_top = 12
|
||||
border_color = Color(0.701961, 0.701961, 0.701961, 0.447059)
|
||||
border_blend = true
|
||||
corner_radius_top_left = 7
|
||||
corner_radius_top_right = 7
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
shadow_color = Color(0.415686, 0.415686, 0.415686, 0.0784314)
|
||||
shadow_size = 10
|
||||
|
||||
[sub_resource type="Texture" id="Texture_gbhvd"]
|
||||
resource_local_to_scene = false
|
||||
resource_name = ""
|
||||
|
||||
[node name="HomePageBox" type="PanelContainer"]
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
custom_minimum_size = Vector2(187.5, 0)
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_e3ugl")
|
||||
script = ExtResource("1_tfhxr")
|
||||
title = "Something"
|
||||
image = SubResource("Texture_gbhvd")
|
||||
|
||||
[node name="Vbox" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Header" type="TextureRect" parent="Vbox"]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(0.152941, 0.152941, 0.152941, 1)
|
||||
custom_minimum_size = Vector2(0, 37.5)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_7vfiv")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="Title" type="Label" parent="Vbox/Header"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_font_sizes/font_size = 15
|
||||
text = "Welcome!"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Content" type="MarginContainer" parent="Vbox"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 7
|
||||
theme_override_constants/margin_top = 7
|
||||
theme_override_constants/margin_right = 7
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="Vbox/Content"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Content" type="Label" parent="Vbox/Content/VBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 7
|
||||
text = "Welcome to dialogic! Easily create visual novels or dialogs for your game. "
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="Button" type="Button" parent="Vbox/Content/VBox"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="pressed" from="Vbox/Content/VBox/Button" to="." method="_on_button_pressed"]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="8" cy="8" r="3" fill="#2F80ED"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 148 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bsx8dtqf3vych"
|
||||
path="res://.godot/imported/default.svg-3f34de5e45bef5de4d9c15ef78c00c6c.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/default.svg"
|
||||
dest_files=["res://.godot/imported/default.svg-3f34de5e45bef5de4d9c15ef78c00c6c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
10
Sprout/addons/dialogic/Editor/Images/Dropdown/divide.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3666_572)">
|
||||
<path d="M11.1812 7.46591V8.57955H4.81756V7.46591H11.1812ZM7.99938 11.483C7.7508 11.483 7.53868 11.3968 7.36301 11.2244C7.19067 11.0488 7.10449 10.8366 7.10449 10.5881C7.10449 10.3494 7.19067 10.1439 7.36301 9.97159C7.53868 9.79924 7.7508 9.71307 7.99938 9.71307C8.23802 9.71307 8.44351 9.79924 8.61586 9.97159C8.7882 10.1439 8.87438 10.3494 8.87438 10.5881C8.87438 10.8366 8.7882 11.0488 8.61586 11.2244C8.44351 11.3968 8.23802 11.483 7.99938 11.483ZM7.99938 6.33239C7.83366 6.33239 7.68285 6.29261 7.54696 6.21307C7.41107 6.13352 7.30336 6.0258 7.22381 5.88991C7.14427 5.75402 7.10449 5.60322 7.10449 5.4375C7.10449 5.19886 7.19067 4.99337 7.36301 4.82102C7.53868 4.64867 7.7508 4.5625 7.99938 4.5625C8.23802 4.5625 8.44351 4.64867 8.61586 4.82102C8.7882 4.99337 8.87438 5.19886 8.87438 5.4375C8.87438 5.68608 8.7882 5.8982 8.61586 6.07386C8.44351 6.24621 8.23802 6.33239 7.99938 6.33239Z" fill="#2F80ED"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3666_572">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c5laykjsxaxtl"
|
||||
path="res://.godot/imported/divide.svg-4928f878a07ba93ebc44d8ae73ad4c1f.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/divide.svg"
|
||||
dest_files=["res://.godot/imported/divide.svg-4928f878a07ba93ebc44d8ae73ad4c1f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
3
Sprout/addons/dialogic/Editor/Images/Dropdown/join.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4 7V9H7.5V12L11.5 8L7.5 4V7H4Z" fill="#A5EFAC"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 162 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b7j220k0ewh35"
|
||||
path="res://.godot/imported/join.svg-2f0d7b9e8e01cf0e62b8c3a85aff6213.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/join.svg"
|
||||
dest_files=["res://.godot/imported/join.svg-2f0d7b9e8e01cf0e62b8c3a85aff6213.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
3
Sprout/addons/dialogic/Editor/Images/Dropdown/leave.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.5 9L11.5 7L8 7L8 4L4 8L8 12L8 9L11.5 9Z" fill="#D14A4A"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 174 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cspjyvye6c0r6"
|
||||
path="res://.godot/imported/leave.svg-c936f6e3d601b8c12c23f205a765084e.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/leave.svg"
|
||||
dest_files=["res://.godot/imported/leave.svg-c936f6e3d601b8c12c23f205a765084e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
10
Sprout/addons/dialogic/Editor/Images/Dropdown/minus.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3666_568)">
|
||||
<path d="M10.2291 7.08807V8.18182H5.77459V7.08807H10.2291Z" fill="#2F80ED"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3666_568">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 324 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dwy14qrkfoeb"
|
||||
path="res://.godot/imported/minus.svg-29f22d1aa24635bae2c03057c07be8bc.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/minus.svg"
|
||||
dest_files=["res://.godot/imported/minus.svg-29f22d1aa24635bae2c03057c07be8bc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
10
Sprout/addons/dialogic/Editor/Images/Dropdown/multiply.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3666_570)">
|
||||
<path d="M10.4255 11.2045L4.81756 5.59659L5.57324 4.84091L11.1812 10.4489L10.4255 11.2045ZM5.57324 11.2045L4.81756 10.4489L10.4255 4.84091L11.1812 5.59659L5.57324 11.2045Z" fill="#2F80ED"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3666_570">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 437 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ddmapfkunbtg7"
|
||||
path="res://.godot/imported/multiply.svg-0e9db99aafb66d43ee14adcca26c5b47.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/multiply.svg"
|
||||
dest_files=["res://.godot/imported/multiply.svg-0e9db99aafb66d43ee14adcca26c5b47.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
10
Sprout/addons/dialogic/Editor/Images/Dropdown/plus.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3666_566)">
|
||||
<path d="M7.44256 11.304V4.74148H8.5562V11.304H7.44256ZM4.71813 8.57955V7.46591H11.2806V8.57955H4.71813Z" fill="#2F80ED"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3666_566">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 370 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cqqtygfbvgtag"
|
||||
path="res://.godot/imported/plus.svg-e094b0b8505b5d910717883d06553532.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/plus.svg"
|
||||
dest_files=["res://.godot/imported/plus.svg-e094b0b8505b5d910717883d06553532.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
10
Sprout/addons/dialogic/Editor/Images/Dropdown/set.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3666_561)">
|
||||
<path d="M4.93688 7.08807V6.0142H11.0619V7.08807H4.93688ZM4.93688 10.0312V8.95739H11.0619V10.0312H4.93688Z" fill="#2F80ED"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3666_561">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 372 B |
40
Sprout/addons/dialogic/Editor/Images/Dropdown/set.svg.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ddcfl67v0r1lw"
|
||||
path="res://.godot/imported/set.svg-f100fad003be2285d5d0da5c58417203.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/set.svg"
|
||||
dest_files=["res://.godot/imported/set.svg-f100fad003be2285d5d0da5c58417203.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
5
Sprout/addons/dialogic/Editor/Images/Dropdown/update.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.45082 5.30639L4.73587 5.26497L4.79109 6.97825L6.50437 6.92302L6.54579 8.20807L3.54747 8.30471L3.45082 5.30639Z" fill="#2F80ED"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3458 12H12.0601L12.0601 10.2858H10.3459L10.3459 9.00012L13.3458 9.00012L13.3458 12Z" fill="#2F80ED"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.35461 11.7143C9.76618 11.7143 10.9724 10.8651 11.4559 9.66667H12.8546C12.3227 11.5864 10.5095 13 8.35461 13C6.1997 13 4.38656 11.5864 3.85461 9.66667H5.25336C5.73678 10.8651 6.94305 11.7143 8.35461 11.7143ZM5.41117 7C5.96903 5.98047 7.07784 5.28571 8.35461 5.28571C9.63139 5.28571 10.7402 5.98047 11.2981 7H12.7476C12.1082 5.25221 10.3828 4 8.35461 4C6.32646 4 4.60105 5.25221 3.96159 7H5.41117Z" fill="#2F80ED"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 905 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://t1roknwygcf3"
|
||||
path="res://.godot/imported/update.svg-cefa0fe6bfa50911bb9a77982288e485.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Dropdown/update.svg"
|
||||
dest_files=["res://.godot/imported/update.svg-cefa0fe6bfa50911bb9a77982288e485.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8 5L14 11L8 17" stroke="white" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 163 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dx3o2ild56i76"
|
||||
path="res://.godot/imported/closed-icon.svg-b4f16653b91d6792313a130565319b2f.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Pieces/closed-icon.svg"
|
||||
dest_files=["res://.godot/imported/closed-icon.svg-b4f16653b91d6792313a130565319b2f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="10.5" cy="3.5" r="1.5" fill="white"/>
|
||||
<circle cx="10.5" cy="11" r="1.5" fill="white"/>
|
||||
<circle cx="10.5" cy="18.5" r="1.5" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 253 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cl03vrbj5wsjk"
|
||||
path="res://.godot/imported/expand-icon.svg-26099b197ab0f314e2253848fcc22962.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Pieces/expand-icon.svg"
|
||||
dest_files=["res://.godot/imported/expand-icon.svg-26099b197ab0f314e2253848fcc22962.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17 8L11 14L5 8" stroke="white" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 163 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://mc7a24bcvjo3"
|
||||
path="res://.godot/imported/open-icon.svg-1a2ae6d0121a79b624c0fb87cc9ceea2.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Pieces/open-icon.svg"
|
||||
dest_files=["res://.godot/imported/open-icon.svg-1a2ae6d0121a79b624c0fb87cc9ceea2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
3
Sprout/addons/dialogic/Editor/Images/Pieces/warning.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.366 4.5C11.9811 3.83333 11.0189 3.83333 10.634 4.5L3.27276 17.25C2.88786 17.9167 3.36898 18.75 4.13878 18.75H18.8612C19.631 18.75 20.1121 17.9167 19.7272 17.25L12.366 4.5ZM10.6668 14.3809H12.073L12.2723 8.46875H10.4676L10.6668 14.3809ZM12.0555 15.5586C11.8836 15.3906 11.6551 15.3066 11.3699 15.3066C11.0887 15.3066 10.8602 15.3926 10.6844 15.5645C10.5125 15.7324 10.4266 15.9453 10.4266 16.2031C10.4266 16.4609 10.5125 16.6738 10.6844 16.8418C10.8602 17.0098 11.0887 17.0937 11.3699 17.0937C11.6551 17.0937 11.8836 17.0098 12.0555 16.8418C12.2312 16.6738 12.3191 16.4609 12.3191 16.2031C12.3191 15.9414 12.2312 15.7266 12.0555 15.5586Z" fill="#FCFF73"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 811 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d4n3j4lvatwxb"
|
||||
path="res://.godot/imported/warning.svg-a48ae93c4663637f2aca88d055604495.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Pieces/warning.svg"
|
||||
dest_files=["res://.godot/imported/warning.svg-a48ae93c4663637f2aca88d055604495.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.6364 4.36363C11.6364 6.37194 10.0083 7.99999 8 7.99999C5.99169 7.99999 4.36363 6.37194 4.36363 4.36363C4.36363 2.35532 5.99169 0.727264 8 0.727264C10.0083 0.727264 11.6364 2.35532 11.6364 4.36363Z" fill="white"/>
|
||||
<path d="M12.3636 13.3904C12.3636 15.2727 10.41 15.2727 8 15.2727C5.59003 15.2727 3.63636 15.2727 3.63636 13.3904C3.63636 10.0117 5.59003 7.27272 8 7.27272C10.41 7.27272 12.3636 10.0117 12.3636 13.3904Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 548 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bbea0efx0ybu7"
|
||||
path="res://.godot/imported/character.svg-48bc1c93fa13733a935ca2c669d933a7.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Resources/character.svg"
|
||||
dest_files=["res://.godot/imported/character.svg-48bc1c93fa13733a935ca2c669d933a7.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 18C14.866 18 18 14.866 18 11C18 7.13401 14.866 4 11 4C7.13401 4 4 7.13401 4 11C4 14.866 7.13401 18 11 18ZM6.64645 10.0607C7.00543 9.70168 7.49232 9.5 8 9.5C8.50768 9.5 8.99457 9.70168 9.35355 10.0607L9.64645 10.3536L10.3536 9.64645L10.0607 9.35355C9.51414 8.80703 8.7729 8.5 8 8.5C7.2271 8.5 6.48586 8.80703 5.93934 9.35355L5.64645 9.64645L6.35355 10.3536L6.64645 10.0607ZM14 9.5C13.4923 9.5 13.0054 9.70168 12.6464 10.0607L12.3536 10.3536L11.6464 9.64645L11.9393 9.35355C12.4859 8.80703 13.2271 8.5 14 8.5C14.7729 8.5 15.5141 8.80703 16.0607 9.35355L16.3536 9.64645L15.6464 10.3536L15.3536 10.0607C14.9946 9.70168 14.5077 9.5 14 9.5ZM11 16C9 16 7.5 14 7 13H15C14.5 14 13 16 11 16Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 854 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dfi7fhfc4dbc3"
|
||||
path="res://.godot/imported/portrait.svg-7d29c7cfe3e086d65dce33c3d66c48cd.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Resources/portrait.svg"
|
||||
dest_files=["res://.godot/imported/portrait.svg-7d29c7cfe3e086d65dce33c3d66c48cd.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.0909 9.45455H15.2727V10.9091H13.0909V13.0909H11.6364V10.9091H9.45454V9.45455H11.6364V7.27274H13.0909V9.45455Z" fill="#A5EFAC"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9094 6.54545C11.3659 5.93769 11.6364 5.18225 11.6364 4.36363C11.6364 2.35532 10.0083 0.727264 8 0.727264C5.99169 0.727264 4.36363 2.35532 4.36363 4.36363C4.36363 5.82377 5.22423 7.08291 6.46587 7.66149C4.81274 8.532 3.63636 10.7686 3.63636 13.3904C3.63636 15.2727 5.59003 15.2727 8 15.2727C10.2115 15.2727 12.0388 15.2727 12.3247 13.8182H10.9091V11.6364H8.72727V8.72726H10.8247C10.445 8.2747 10.0092 7.91168 9.53412 7.66149C10.0795 7.40735 10.5514 7.02191 10.9091 6.5458V6.54545H10.9094Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 801 B |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://my600mb32ydt"
|
||||
path="res://.godot/imported/add-character.svg-a658b65c1225b02657a50d5c965e0d5e.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Toolbar/add-character.svg"
|
||||
dest_files=["res://.godot/imported/add-character.svg-a658b65c1225b02657a50d5c965e0d5e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1.45454 2.18183C1.45454 1.78017 1.78016 1.45456 2.18182 1.45456H13.8182C14.2198 1.45456 14.5455 1.78017 14.5455 2.18183V2.9091C14.5455 3.31077 14.2198 3.63638 13.8182 3.63638H2.18182C1.78016 3.63638 1.45454 3.31077 1.45454 2.9091V2.18183Z" fill="white"/>
|
||||
<path d="M1.45454 5.8182C1.45454 5.41653 1.78016 5.09092 2.18182 5.09092H13.8182C14.2198 5.09092 14.5455 5.41653 14.5455 5.8182V6.54547C14.5455 6.94713 14.2198 7.27274 13.8182 7.27274V6.54547H10.9091V7.27274H2.18182C1.78016 7.27274 1.45454 6.94713 1.45454 6.54547V5.8182Z" fill="white"/>
|
||||
<path d="M1.45454 9.45456C1.45454 9.0529 1.78016 8.72729 2.18182 8.72729H8.72727C8.72727 8.72729 8.72727 9.0529 8.72727 9.45456V10.1818C8.72727 10.5835 8.72727 10.9091 8.72727 10.9091H2.18182C1.78016 10.9091 1.45454 10.5835 1.45454 10.1818V9.45456Z" fill="white"/>
|
||||
<path d="M1.45454 13.0909C1.45454 12.6893 1.78016 12.3637 2.18182 12.3637H10.9091V13.8182H13.8182V12.3637C14.2198 12.3637 14.5455 12.6893 14.5455 13.0909V13.8182C14.5455 14.2199 14.2198 14.5455 13.8182 14.5455H2.18182C1.78016 14.5455 1.45454 14.2199 1.45454 13.8182V13.0909Z" fill="white"/>
|
||||
<path d="M13.0909 9.45455H15.2727V10.9091H13.0909V13.0909H11.6364V10.9091H9.45454V9.45455H11.6364V7.27274H13.0909V9.45455Z" fill="#A5EFAC"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bymlbr4o2m3jc"
|
||||
path="res://.godot/imported/add-timeline.svg-86961b528ebdf01f585931a15fea1755.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/Toolbar/add-timeline.svg"
|
||||
dest_files=["res://.godot/imported/add-timeline.svg-86961b528ebdf01f585931a15fea1755.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
18
Sprout/addons/dialogic/Editor/Images/dialogic-logo.svg
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bt87p6qlso0ya"
|
||||
path="res://.godot/imported/dialogic-logo.svg-e43201cabc9573eeb3f78fd91ea9d909.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/dialogic-logo.svg"
|
||||
dest_files=["res://.godot/imported/dialogic-logo.svg-e43201cabc9573eeb3f78fd91ea9d909.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
3
Sprout/addons/dialogic/Editor/Images/plugin-icon.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 2H13C14.1046 2 15 2.89543 15 4V11.8483C15 12.4946 14.6877 13.101 14.1617 13.4763L12.1391 14.9196C11.5051 15.372 10.9076 14.5797 11.1562 13.8416C11.3705 13.2052 10.7792 12.8782 10.1076 12.8782H3.00005C1.89549 12.8782 1.00006 11.9827 1.00005 10.8782L1 4.00002C0.999992 2.89544 1.89542 2 3 2ZM9.73033 6.07391V6.06934C9.53136 5.64508 9.25694 5.27728 8.90709 4.966H8.90233C8.55565 4.66077 8.12401 4.42273 7.60728 4.25177V4.25635C7.10338 4.08545 6.52403 4 5.86937 4H3.14928C3.10753 4 3.07225 4.01373 3.04332 4.0412C3.01439 4.06866 2.99998 4.10223 2.99998 4.14191V10.8535C2.99998 10.8962 3.01439 10.9313 3.04332 10.9588C3.07225 10.9863 3.10753 11 3.14928 11H5.82603C6.4807 11 7.0648 10.9115 7.57835 10.7345C8.10155 10.5574 8.54124 10.3133 8.89757 10.002C9.25694 9.68762 9.52977 9.31525 9.71593 8.88489C9.90526 8.45758 9.99998 7.98907 9.99998 7.47937V7.45648C9.99998 6.95593 9.91014 6.49512 9.73033 6.07391ZM7.68907 7.48859V7.51147C7.68907 8.00287 7.52696 8.38593 7.20287 8.66058C6.87547 8.92615 6.43895 9.0589 5.8933 9.0589H5.25304V5.94116H5.8933C6.43895 5.94116 6.87547 6.07391 7.20287 6.33948C7.52696 6.61414 7.68907 6.99719 7.68907 7.48859ZM12 11C12.5523 11 13 10.5523 13 10C13 9.44772 12.5523 9 12 9C11.4477 9 11 9.44772 11 10C11 10.5523 11.4477 11 12 11Z" fill="#E0E0E0"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
40
Sprout/addons/dialogic/Editor/Images/plugin-icon.svg.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dybg3l5pwetne"
|
||||
path="res://.godot/imported/plugin-icon.svg-aa6701e8ed73f5fe5d177dfddce3a0e3.ctex"
|
||||
metadata={
|
||||
"editor_dark_theme": true,
|
||||
"editor_scale": 2.0,
|
||||
"has_editor_variant": true,
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Editor/Images/plugin-icon.svg"
|
||||
dest_files=["res://.godot/imported/plugin-icon.svg-aa6701e8ed73f5fe5d177dfddce3a0e3.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=true
|
||||
editor/convert_colors_with_editor_theme=true
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
@tool
|
||||
extends Label
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
label_settings = LabelSettings.new()
|
||||
label_settings.font = get_theme_font("doc_italic", "EditorFonts")
|
||||
label_settings.font_size = get_theme_font_size('font_size', 'Label')
|
||||
label_settings.font_color = get_theme_color("accent_color", "Editor")
|
||||
32
Sprout/addons/dialogic/Editor/Settings/SettingsEditor.gd
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
@tool
|
||||
extends DialogicEditor
|
||||
|
||||
## Editor that contains all settings
|
||||
|
||||
func _register():
|
||||
editors_manager.register_simple_editor(self)
|
||||
|
||||
|
||||
func _ready():
|
||||
for indexer in DialogicUtil.get_indexers():
|
||||
for settings_page in indexer._get_settings_pages():
|
||||
$Tabs.add_child(load(settings_page).instantiate())
|
||||
|
||||
|
||||
func _open(extra_information:Variant = null) -> void:
|
||||
refresh()
|
||||
if typeof(extra_information) == TYPE_STRING and has_node('Tabs/'+extra_information):
|
||||
$Tabs.current_tab = get_node('Tabs/'+extra_information).get_index()
|
||||
|
||||
|
||||
func _close():
|
||||
for child in $Tabs.get_children():
|
||||
if child.has_method('_about_to_close'):
|
||||
child._about_to_close()
|
||||
|
||||
|
||||
func refresh():
|
||||
for child in $Tabs.get_children():
|
||||
if child.has_method('refresh'):
|
||||
child.refresh()
|
||||
|
||||
30
Sprout/addons/dialogic/Editor/Settings/SettingsEditor.tscn
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cl7g6q68aqt4f"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Editor/Settings/SettingsEditor.gd" id="1"]
|
||||
[ext_resource type="PackedScene" uid="uid://dm4kxvcn7d7ug" path="res://addons/dialogic/Editor/Settings/Settings_General.tscn" id="3"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4fay73phesum" path="res://addons/dialogic/Editor/Settings/Settings_Translations.tscn" id="3_q3qwt"]
|
||||
|
||||
[node name="SettingsEditor" type="MarginContainer"]
|
||||
visible = false
|
||||
offset_right = 1020.0
|
||||
offset_bottom = 600.0
|
||||
theme_override_constants/margin_left = 0
|
||||
theme_override_constants/margin_top = 0
|
||||
theme_override_constants/margin_right = 0
|
||||
theme_override_constants/margin_bottom = 0
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Tabs" type="TabContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1020.0
|
||||
offset_bottom = 600.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="General" parent="Tabs" instance=ExtResource("3")]
|
||||
layout_mode = 2
|
||||
offset_top = 31.0
|
||||
|
||||
[node name="Translations" parent="Tabs" instance=ExtResource("3_q3qwt")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
99
Sprout/addons/dialogic/Editor/Settings/Settings_General.gd
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
@tool
|
||||
extends HBoxContainer
|
||||
|
||||
signal colors_changed
|
||||
|
||||
var color_palette = null
|
||||
|
||||
func _ready():
|
||||
var s = DCSS.inline({
|
||||
'padding': 5,
|
||||
'background': Color(0.545098, 0.545098, 0.545098, 0.211765)
|
||||
})
|
||||
$General/TitleLabel.add_theme_stylebox_override("normal", s)
|
||||
$General/TitleLabel2.add_theme_stylebox_override("normal", s)
|
||||
|
||||
# Signals
|
||||
%TestingSceneButton.pressed.connect(_on_TestingSceneButton_pressed)
|
||||
%DefaultSceneButton.pressed.connect(_on_DefaultSceneButton_pressed)
|
||||
%CustomEventsFolderButton.pressed.connect(_on_CustomEventsFolderButton_pressed)
|
||||
%PhysicsTimerButton.pressed.connect(_on_physics_timer_button_toggled)
|
||||
|
||||
# Colors
|
||||
%ResetColorsButton.button_up.connect(_on_reset_colors_button)
|
||||
|
||||
for n in $"%Colors".get_children():
|
||||
n.color_changed.connect(_on_color_change.bind(n))
|
||||
|
||||
func refresh():
|
||||
%CustomEventsFolderLabel.text = DialogicUtil.get_project_setting('dialogic/custom_events_folder', 'res://addons/dialogic_additions/Events')
|
||||
%CustomEventsFolderButton.icon = get_theme_icon("Folder", "EditorIcons")
|
||||
%TestingSceneButton.icon = get_theme_icon("Folder", "EditorIcons")
|
||||
%TestingSceneLabel.text = DialogicUtil.get_project_setting('dialogic/editor/test_dialog_scene', "res://addons/dialogic/Example Assets/example-scenes/DialogicDefaultScene.tscn")
|
||||
|
||||
%PhysicsTimerButton.button_pressed = DialogicUtil.is_physics_timer()
|
||||
|
||||
%DefaultSceneButton.icon = get_theme_icon("Folder", "EditorIcons")
|
||||
%DefaultSceneLabel.text = DialogicUtil.get_project_setting('dialogic/editor/default_dialog_scene', "res://addons/dialogic/Example Assets/example-scenes/DialogicDefaultScene.tscn")
|
||||
|
||||
|
||||
# Color Palett
|
||||
color_palette = DialogicUtil.get_color_palette()
|
||||
var _scale = DialogicUtil.get_editor_scale()
|
||||
for n in %Colors.get_children():
|
||||
n.custom_minimum_size = Vector2(50 ,50)*scale
|
||||
n.color = color_palette[n.name]
|
||||
|
||||
|
||||
func _on_CustomEventsFolderButton_pressed() -> void:
|
||||
find_parent('EditorView').godot_file_dialog(custom_events_folder_selected, '', EditorFileDialog.FILE_MODE_OPEN_DIR, 'Select custom events folder')
|
||||
|
||||
|
||||
func custom_events_folder_selected(folder_path:String) -> void:
|
||||
%CustomEventsFolderLabel.text = folder_path
|
||||
ProjectSettings.set_setting('dialogic/custom_events_folder', folder_path)
|
||||
ProjectSettings.save()
|
||||
|
||||
|
||||
func _on_color_change(color: Color, who) -> void:
|
||||
ProjectSettings.set_setting('dialogic/editor/' + str(who.name), color)
|
||||
ProjectSettings.save()
|
||||
emit_signal('colors_changed')
|
||||
|
||||
|
||||
func _on_reset_colors_button() -> void:
|
||||
color_palette = DialogicUtil.get_color_palette(true)
|
||||
for n in %Colors.get_children():
|
||||
n.color = color_palette[n.name]
|
||||
# There is a bug when trying to remove existing values, so we have to
|
||||
# set/create new entries for all the colors used.
|
||||
# If you manage to make it work using the ProjectSettings.clear()
|
||||
# feel free to open a PR!
|
||||
ProjectSettings.set_setting('dialogic/editor/' + str(n.name), color_palette[n.name])
|
||||
ProjectSettings.save()
|
||||
emit_signal('colors_changed')
|
||||
|
||||
|
||||
func _on_TestingSceneButton_pressed() -> void:
|
||||
find_parent('EditorView').godot_file_dialog(custom_testing_scene_selected, '*.tscn, *.scn', EditorFileDialog.FILE_MODE_OPEN_FILE, 'Select testing scene')
|
||||
|
||||
|
||||
func custom_testing_scene_selected(path:String) -> void:
|
||||
%TestingSceneLabel.text = path
|
||||
ProjectSettings.set_setting('dialogic/editor/test_dialog_scene', path)
|
||||
ProjectSettings.save()
|
||||
|
||||
|
||||
func _on_DefaultSceneButton_pressed() -> void:
|
||||
find_parent('EditorView').godot_file_dialog(custom_default_scene_selected, '*.tscn, *.scn', EditorFileDialog.FILE_MODE_OPEN_FILE, 'Select default scene')
|
||||
|
||||
|
||||
func custom_default_scene_selected(path:String) -> void:
|
||||
%DefaultSceneLabel.text = path
|
||||
ProjectSettings.set_setting('dialogic/editor/default_dialog_scene', path)
|
||||
ProjectSettings.save()
|
||||
|
||||
|
||||
func _on_physics_timer_button_toggled(button_pressed:bool) -> void:
|
||||
ProjectSettings.set_setting('dialogic/timer/process_in_physics', button_pressed)
|
||||
ProjectSettings.save()
|
||||