Add dialogic

This commit is contained in:
snider committed 2022-08-13 19:33:12 -07:00
1 parent 89d4d3a29c
commit 2c47b309ae
603 files changed
+34501

No files matched your search

@@ -0,0 +1,39 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/PortraitPicker.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/CharacterPicker.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/EventPart_CharacterAndPortraitPicker.gd" type="Script" id=3]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/DefinitionPicker.tscn" type="PackedScene" id=4]
[node name="CharacterAndPortraitPicker" type="VBoxContainer"]
margin_right = 305.0
margin_bottom = 48.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBox" type="HBoxContainer" parent="."]
margin_right = 305.0
margin_bottom = 48.0
size_flags_vertical = 3
custom_constants/separation = 5
[node name="CharacterPicker" parent="HBox" instance=ExtResource( 2 )]
margin_top = 9.0
margin_right = 95.0
margin_bottom = 39.0
[node name="PortraitPicker" parent="HBox" instance=ExtResource( 1 )]
visible = false
margin_left = 100.0
margin_top = 13.0
margin_right = 264.0
margin_bottom = 35.0
[node name="DefinitionPicker" parent="HBox" instance=ExtResource( 4 )]
visible = false
margin_left = 100.0
margin_top = 13.0
margin_right = 198.0
margin_bottom = 35.0
@@ -0,0 +1,53 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/EventPart_CharacterPicker.gd" type="Script" id=2]
[ext_resource path="res://addons/dialogic/Editor/Theme/PickerTheme.tres" type="Theme" id=3]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=4]
[node name="CharacterPicker" type="VBoxContainer"]
margin_right = 161.0
margin_bottom = 30.0
rect_min_size = Vector2( 0, 30 )
size_flags_vertical = 4
theme = ExtResource( 3 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBox" type="HBoxContainer" parent="."]
margin_right = 161.0
margin_bottom = 30.0
size_flags_vertical = 3
custom_constants/separation = 5
[node name="MenuButton" parent="HBox" instance=ExtResource( 4 )]
margin_top = 4.0
margin_right = 95.0
margin_bottom = 26.0
text = "Character"
[node name="NoCharacterContainer" type="HBoxContainer" parent="."]
visible = false
margin_top = 26.0
margin_right = 399.0
margin_bottom = 46.0
[node name="NoCharacterLabel1" type="Label" parent="NoCharacterContainer"]
margin_top = 3.0
margin_right = 261.0
margin_bottom = 17.0
text = "You haven't created a character yet. Click"
[node name="NoCharacterButton" type="Button" parent="NoCharacterContainer"]
margin_left = 265.0
margin_right = 306.0
margin_bottom = 20.0
text = "here"
[node name="NoCharacterLabel2" type="Label" parent="NoCharacterContainer"]
margin_left = 310.0
margin_top = 3.0
margin_right = 399.0
margin_bottom = 17.0
text = "to create one."
@@ -0,0 +1,78 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
## node references
onready var character_picker = $HBox/CharacterPicker
onready var portrait_picker = $HBox/PortraitPicker
onready var definition_picker = $HBox/DefinitionPicker
# used to connect the signals
func _ready():
if DialogicUtil.get_character_list().size() == 0:
hide()
character_picker.connect("data_changed", self, "_on_CharacterPicker_data_changed")
portrait_picker.connect("data_changed", self, "_on_PortraitPicker_data_changed")
definition_picker.connect("data_changed", self, "_on_DefinitionPicker_data_changed")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
# Now update the ui nodes to display the data.
portrait_picker.load_data(data)
character_picker.load_data(data)
portrait_picker.visible = get_character_data() and len(get_character_data()['portraits']) > 1
if data['event_id'] == 'dialogic_002':
if data.get('type', 0) != 1: # FOR JOIN AND UPDATE:
var has_port_defn = data['portrait'] == '[Definition]'
if portrait_picker.visible and has_port_defn and data.has('port_defn'):
definition_picker.load_data({ 'definition': data['port_defn'] })
definition_picker.visible = has_port_defn
else:
portrait_picker.hide()
definition_picker.hide()
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func get_character_data():
for ch in DialogicUtil.get_character_list():
if ch['file'] == event_data['character']:
return ch
func _on_CharacterPicker_data_changed(data):
event_data = data
# update the portrait picker data
portrait_picker.load_data(data)
portrait_picker.visible = get_character_data() and len(get_character_data()['portraits']) > 1
if !portrait_picker.visible:
definition_picker.hide()
# informs the parent about the changes!
data_changed()
func _on_PortraitPicker_data_changed(data):
event_data = data
# update the portrait picker data
character_picker.load_data(data)
definition_picker.visible = event_data['portrait'] == '[Definition]'
# informs the parent about the changes!
data_changed()
func _on_DefinitionPicker_data_changed(data):
event_data['port_defn'] = data['definition']
# informs the parent about the changes!
data_changed()
@@ -0,0 +1,156 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
export (bool) var allow_no_character := false
## node references
onready var picker_menu = $HBox/MenuButton
onready var no_character_button = $NoCharacterContainer/NoCharacterButton
onready var no_character_container = $NoCharacterContainer
# theme
var no_character_icon
var all_characters_icon
var single_character_icon
func _ready():
if DialogicUtil.get_character_list().size() > 0:
picker_menu.show()
no_character_container.hide()
else:
picker_menu.hide()
no_character_container.show()
var editor_reference = find_parent('EditorView')
no_character_button.connect('pressed', editor_reference.get_node('MainPanel/MasterTreeContainer/MasterTree'), 'new_character')
# So... not having real events makes me do this kind of hacks
# I hope to improve how events work, but in the mean time
# this is what I have to do to get by :')
var event_node = get_node('../../../../../../../..')
if event_node.get_node_or_null('AllowNoCharacter'):
allow_no_character = true
no_character_container.hide()#We dont want the button on text events
# Connections
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
# Themeing
no_character_icon = get_icon("GuiRadioUnchecked", "EditorIcons")
all_characters_icon = get_icon("GuiEllipsis", "EditorIcons")
single_character_icon = load("res://addons/dialogic/Images/Resources/character.svg")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
allow_no_character = data['event_id'] != 'dialogic_002'
# Now update the ui nodes to display the data.
update_to_character()
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
# helper to not have the same code everywhere
func update_to_character():
if event_data['character'] != '':
if event_data['character'] == '[All]':
picker_menu.text = "All characters"
picker_menu.reset_modulation()
picker_menu.custom_icon = all_characters_icon
else:
for ch in DialogicUtil.get_character_list():
if ch['file'] == event_data['character']:
picker_menu.text = ch['name']
picker_menu.custom_icon_modulation = ch['color']
picker_menu.custom_icon = single_character_icon
else:
if allow_no_character:
picker_menu.text = 'No Character'
picker_menu.custom_icon = no_character_icon
else:
picker_menu.text = 'Select Character'
picker_menu.custom_icon = single_character_icon
picker_menu.reset_modulation()
# when an index is selected on one of the menus.
func _on_PickerMenu_selected(index, menu):
var metadata = menu.get_item_metadata(index)
if event_data['character'] != metadata.get('file',''):
if event_data.get('event_id') == 'dialogic_002':
if event_data.get('type') == 0:
event_data['portrait'] = 'Default'
elif event_data.get('type') == 2:
event_data['portrait'] = "(Don't change)"
event_data['character'] = metadata.get('file','')
update_to_character()
# informs the parent about the changes!
data_changed()
func _on_PickerMenu_about_to_show():
build_PickerMenu()
func build_PickerMenu():
picker_menu.get_popup().clear()
var folder_structure = DialogicUtil.get_characters_folder_structure()
## building the root level
build_PickerMenuFolder(picker_menu.get_popup(), folder_structure, "MenuButton")
# is called recursively to build all levels of the folder structure
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
var index = 0
## THIS IS JUST FOR THE ROOT FOLDER
if menu == picker_menu.get_popup():
if event_data.get('event_id', 'dialogic_001') != 'dialogic_002':
menu.add_item('No character')
menu.set_item_metadata(index, {'file':''})
menu.set_item_icon(index, no_character_icon)
index += 1
# in case this is a leave event
if event_data.get('type', 0) == 1:
menu.add_item('All characters')
menu.set_item_metadata(index, {'file': '[All]'})
menu.set_item_icon(index, all_characters_icon)
index += 1
for folder_name in folder_structure['folders'].keys():
var submenu = PopupMenu.new()
var submenu_name = build_PickerMenuFolder(submenu, folder_structure['folders'][folder_name], folder_name)
submenu.name = submenu_name
menu.add_submenu_item(folder_name, submenu_name)
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
menu.add_child(submenu)
index += 1
# give it the right style
picker_menu.update_submenu_style(submenu)
var files_info = DialogicUtil.get_characters_dict()
for file in folder_structure['files']:
menu.add_item(files_info[file]['name'])
# this doesn't work right now, because it doesn't have the editor_reference. Would be nice though
#menu.set_item_icon(index, editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree").character_icon)
menu.set_item_icon(index, single_character_icon)
menu.set_item_metadata(index, {'file':file})
index += 1
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
menu.connect("index_pressed", self, '_on_PickerMenu_selected', [menu])
return current_folder_name
@@ -0,0 +1,170 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
export (bool) var allow_dont_change := true
export (bool) var allow_definition := true
## node references
onready var picker_menu = $HBox/MenuButton
onready var preview = $Preview/PreviewContainer
onready var preview_title = preview.get_node("VBox/Title")
onready var preview_texture = preview.get_node("VBox/TextureRect")
var current_hovered = null
var character_data = null
# theme
var no_change_icon
var definition_icon
var portrait_icon
# used to connect the signals
func _ready():
picker_menu.get_popup().connect("index_pressed", self, '_on_PickerMenu_selected')
picker_menu.get_popup().connect("gui_input", self, "popup_gui_input")
picker_menu.get_popup().connect("mouse_exited", self, "mouse_exited_popup")
picker_menu.get_popup().connect("popup_hide", self, "mouse_exited_popup")
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
preview_title.set('custom_fonts/font', get_font("title", "EditorFonts"))
preview.set('custom_styles/panel', get_stylebox("panel", "PopupMenu"))
# Themeing
no_change_icon = get_icon("GuiRadioUnchecked", "EditorIcons")
definition_icon = load("res://addons/dialogic/Images/Resources/definition.svg")
portrait_icon = load("res://addons/dialogic/Images/Event Icons/Portrait.svg")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
allow_dont_change = event_data['event_id'] != 'dialogic_002' or (event_data['event_id'] == 'dialogic_002' and int(event_data.get('type', 0)) == 2)
if event_data['event_id'] == 'dialogic_002' and event_data['type'] == 2:
$HBox/Label.text = "to portrait"
else:
$HBox/Label.text = "with portrait"
# Now update the ui nodes to display the data.
if event_data.get('portrait', '').empty():
# if this is a text/question event or character event in update mode
if allow_dont_change:
picker_menu.text = "(Don't change)"
picker_menu.custom_icon = no_change_icon
else:
picker_menu.text = "Default"
picker_menu.custom_icon = portrait_icon
else:
if event_data['portrait'] == "[Definition]":
picker_menu.text = "[Value]"
picker_menu.custom_icon = definition_icon
else:
picker_menu.text = event_data['portrait']
picker_menu.custom_icon = portrait_icon
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func _on_PickerMenu_selected(index):
if index == 0 and allow_dont_change:
event_data['portrait'] = "(Don't change)"
picker_menu.custom_icon = no_change_icon
elif allow_definition and ((allow_dont_change and index == 1) or index == 0):
event_data['portrait'] = "[Definition]"
picker_menu.custom_icon = definition_icon
else:
event_data['portrait'] = picker_menu.get_popup().get_item_text(index)
picker_menu.custom_icon = portrait_icon
# TODO in 2.0
if event_data['portrait'] == "[Definition]":
picker_menu.text = "[Value]"
else:
picker_menu.text = event_data['portrait']
# informs the parent about the changes!
data_changed()
func get_character_data():
for ch in DialogicUtil.get_character_list():
if ch['file'] == event_data['character']:
return ch
func _on_PickerMenu_about_to_show():
character_data = get_character_data()
picker_menu.get_popup().clear()
var index = 0
if allow_dont_change:
picker_menu.get_popup().add_item("(Don't change)")
picker_menu.get_popup().set_item_icon(index, no_change_icon)
index += 1
if allow_definition:
picker_menu.get_popup().add_item("[Value]")
picker_menu.get_popup().set_item_icon(index, definition_icon)
index += 1
if event_data['character']:
if character_data.has('portraits'):
for p in character_data['portraits']:
picker_menu.get_popup().add_item(p['name'])
picker_menu.get_popup().set_item_icon(index, portrait_icon)
index += 1
func popup_gui_input(event):
if event is InputEventMouseMotion:
if current_hovered != picker_menu.get_popup().get_current_index():
current_hovered = picker_menu.get_popup().get_current_index()
# hide if this is not a previewable portrait
# this isn't even an item
if current_hovered == -1:
preview.hide()
return
var idx_add = 0
if allow_dont_change:
idx_add -= 1
if current_hovered == 0:
preview.hide()
return
if allow_definition and current_hovered == 1:
preview.hide()
return
if allow_definition:
idx_add -= 1
if not allow_dont_change and current_hovered == 0:
preview.hide()
return
## show the preview
preview.rect_position.x = picker_menu.get_popup().rect_size.x + 130
var current = character_data['portraits'][current_hovered + idx_add]
preview_title.text = ' ' + current['name']
preview_title.icon = null
if current['path']:
if current['path'].ends_with('.tscn'):
preview_texture.expand = false
var editor_reference = find_parent('EditorView')
if editor_reference and editor_reference.editor_interface:
editor_reference.editor_interface.get_resource_previewer().queue_resource_preview(current['path'], self, "show_scene_preview", null)
preview_title.icon = get_icon("PackedScene", "EditorIcons")
return
else:
preview_title.icon = get_icon("Sprite", "EditorIcons")
preview_texture.expand = true
preview_texture.texture = load(current['path'])
else:
preview_texture.texture = null
preview.show()
func mouse_exited_popup():
preview.hide()
current_hovered = null
func show_scene_preview(path:String, preview:Texture, user_data):
if preview:
preview_texture.texture = preview
@@ -0,0 +1,115 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/EventPart_PortraitPicker.gd" type="Script" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=4]
[sub_resource type="Image" id=7]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 10, 0, 0, 0, 8, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 10, 0, 0, 0, 19, 0, 0, 0, 25, 0, 0, 0, 31, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0, 31, 0, 0, 0, 25, 0, 0, 0, 19, 0, 0, 0, 10, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, 22, 0, 0, 0, 39, 0, 0, 0, 53, 0, 0, 0, 63, 0, 0, 0, 69, 0, 0, 0, 70, 0, 0, 0, 70, 0, 0, 0, 69, 0, 0, 0, 63, 0, 0, 0, 53, 0, 0, 0, 39, 0, 0, 0, 22, 0, 0, 0, 10, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 19, 0, 0, 0, 39, 59, 59, 67, 148, 66, 66, 75, 245, 62, 62, 71, 250, 62, 62, 70, 251, 62, 62, 70, 251, 62, 62, 70, 251, 62, 62, 70, 251, 62, 62, 71, 250, 66, 66, 75, 245, 59, 59, 67, 148, 0, 0, 0, 39, 0, 0, 0, 19, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 25, 0, 0, 0, 53, 65, 65, 74, 245, 47, 47, 54, 255, 45, 45, 51, 255, 45, 45, 51, 255, 45, 45, 51, 255, 45, 45, 51, 255, 45, 45, 51, 255, 45, 45, 51, 255, 47, 47, 54, 255, 65, 65, 74, 245, 0, 0, 0, 53, 0, 0, 0, 25, 0, 0, 0, 8, 0, 0, 0, 10, 0, 0, 0, 31, 0, 0, 0, 64, 61, 61, 69, 252, 45, 45, 51, 255, 44, 44, 50, 255, 44, 44, 50, 255, 44, 44, 50, 255, 44, 44, 50, 255, 44, 44, 50, 255, 44, 44, 50, 255, 45, 45, 51, 255, 61, 61, 69, 252, 0, 0, 0, 64, 0, 0, 0, 31, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 34, 0, 0, 0, 69, 59, 59, 67, 251, 44, 44, 50, 255, 43, 43, 49, 255, 43, 43, 49, 255, 43, 43, 49, 255, 43, 43, 49, 255, 43, 43, 49, 255, 43, 43, 49, 255, 44, 44, 50, 255, 59, 59, 67, 251, 0, 0, 0, 69, 0, 0, 0, 34, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 35, 0, 0, 0, 70, 58, 58, 66, 251, 42, 42, 49, 255, 42, 42, 48, 255, 42, 42, 48, 255, 42, 42, 48, 255, 42, 42, 48, 255, 42, 42, 48, 255, 42, 42, 48, 255, 42, 42, 49, 255, 58, 58, 66, 251, 0, 0, 0, 70, 0, 0, 0, 35, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 35, 0, 0, 0, 70, 56, 56, 65, 251, 41, 41, 48, 255, 41, 41, 47, 255, 41, 41, 47, 255, 41, 41, 47, 255, 41, 41, 47, 255, 41, 41, 47, 255, 41, 41, 47, 255, 41, 41, 48, 255, 56, 56, 65, 251, 0, 0, 0, 70, 0, 0, 0, 35, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 34, 0, 0, 0, 69, 55, 55, 62, 251, 40, 40, 46, 255, 40, 40, 45, 255, 40, 40, 45, 255, 40, 40, 45, 255, 40, 40, 45, 255, 40, 40, 45, 255, 40, 40, 45, 255, 40, 40, 46, 255, 55, 55, 62, 251, 0, 0, 0, 69, 0, 0, 0, 34, 0, 0, 0, 11, 0, 0, 0, 10, 0, 0, 0, 31, 0, 0, 0, 64, 54, 54, 61, 252, 39, 39, 45, 255, 39, 39, 44, 255, 39, 39, 44, 255, 39, 39, 44, 255, 39, 39, 44, 255, 39, 39, 44, 255, 39, 39, 44, 255, 39, 39, 45, 255, 53, 53, 60, 252, 0, 0, 0, 64, 0, 0, 0, 31, 0, 0, 0, 10, 0, 0, 0, 8, 0, 0, 0, 26, 0, 0, 0, 53, 56, 56, 64, 245, 41, 41, 46, 255, 39, 39, 44, 255, 38, 38, 44, 255, 38, 38, 44, 255, 38, 38, 44, 255, 38, 38, 44, 255, 39, 39, 44, 255, 41, 41, 46, 255, 56, 56, 64, 246, 0, 0, 0, 53, 0, 0, 0, 26, 0, 0, 0, 8, 0, 0, 0, 5, 0, 0, 0, 19, 0, 0, 0, 39, 49, 49, 56, 149, 56, 56, 64, 245, 52, 52, 59, 250, 52, 52, 59, 251, 52, 52, 59, 251, 52, 52, 59, 251, 52, 52, 59, 251, 52, 52, 59, 250, 57, 57, 63, 244, 49, 49, 56, 148, 0, 0, 0, 39, 0, 0, 0, 19, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, 22, 0, 0, 0, 39, 0, 0, 0, 53, 0, 0, 0, 64, 0, 0, 0, 69, 0, 0, 0, 70, 0, 0, 0, 70, 0, 0, 0, 69, 0, 0, 0, 63, 0, 0, 0, 53, 0, 0, 0, 39, 0, 0, 0, 22, 0, 0, 0, 10, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 10, 0, 0, 0, 19, 0, 0, 0, 25, 0, 0, 0, 31, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0, 31, 0, 0, 0, 25, 0, 0, 0, 19, 0, 0, 0, 10, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 10, 0, 0, 0, 8, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 4
flags = 4
image = SubResource( 7 )
size = Vector2( 16, 16 )
[sub_resource type="StyleBoxTexture" id=3]
content_margin_left = 10.0
content_margin_right = 10.0
content_margin_top = 10.0
content_margin_bottom = 10.0
texture = SubResource( 2 )
region_rect = Rect2( 0, 0, 16, 16 )
margin_left = 4.0
margin_right = 4.0
margin_top = 4.0
margin_bottom = 4.0
[sub_resource type="Image" id=8]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 26, 255, 255, 255, 254, 255, 255, 255, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 80, 255, 255, 255, 255, 255, 255, 255, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 65, 255, 255, 255, 254, 255, 255, 255, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 5, 255, 255, 255, 228, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 30, 255, 255, 255, 255, 255, 255, 255, 40, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 167, 255, 255, 255, 188, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 34, 255, 255, 255, 255, 255, 255, 255, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 72, 255, 255, 255, 205, 255, 255, 255, 249, 255, 255, 255, 218, 255, 255, 255, 73, 255, 255, 255, 92, 255, 255, 255, 218, 255, 255, 255, 246, 255, 255, 255, 199, 255, 255, 255, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 144, 255, 255, 255, 194, 255, 255, 255, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 214, 255, 255, 255, 48, 255, 255, 255, 50, 255, 255, 255, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 147, 255, 255, 255, 255, 255, 255, 255, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Line truncated
"format": "RGBA8",
"height": 256,
"mipmaps": false,
"width": 128
}
[sub_resource type="ImageTexture" id=5]
image = SubResource( 8 )
size = Vector2( 128, 256 )
[sub_resource type="BitmapFont" id=6]
textures = [ SubResource( 5 ) ]
chars = PoolIntArray( 32, 0, 0, 0, 0, 0, 0, 11, 4, 160, 0, 1734439808, 0, 0, 0, 0, 11, 4, 96, 0, 2, 216, 3, 2, 3, 0, 8, 192, 0, 32, 16, 11, 13, -1, -2, 9, 224, 0, 85, 180, 5, 11, 1, 0, 7, 64, 0, 72, 34, 10, 11, 1, 1, 12, 97, 0, 76, 188, 5, 8, 1, 3, 7, 65, 0, 2, 16, 11, 10, -1, 1, 9, 161, 0, 2, 222, 2, 11, 1, 3, 4, 193, 0, 17, 16, 11, 13, -1, -2, 9, 225, 0, 112, 169, 5, 11, 1, 0, 7, 33, 0, 65, 234, 2, 10, 1, 1, 4, 34, 0, 49, 187, 5, 4, 1, 1, 6, 162, 0, 12, 136, 6, 10, 1, 1, 8, 66, 0, 46, 109, 7, 10, 1, 1, 9, 194, 0, 113, 2, 11, 13, -1, -2, 9, 226, 0, 72, 143, 6, 11, 1, 0, 7, 98, 0, 102, 165, 6, 11, 1, 0, 8, 99, 0, 40, 179, 5, 8, 1, 3, 7, 67, 0, 68, 115, 7, 10, 1, 1, 8, 227, 0, 2, 155, 6, 12, 1, -1, 7, 195, 0, 53, 2, 11, 14, -1, -3, 9, 163, 0, 22, 167, 6, 10, 1, 1, 8, 35, 0, 78, 66, 8, 10, 0, 1, 9, 164, 0, 14, 79, 8, 7, 0, 3, 8, 68, 0, 90, 66, 8, 10, 1, 1, 10, 100, 0, 82, 150, 6, 11, 1, 0, 8, 36, 0, 102, 137, 6, 12, 1, 0, 8, 196, 0, 98, 2, 11, 13, -1, -2, 9, 228, 0, 121, 169, 5, 11, 1, 0, 7, 101, 0, 32, 124, 6, 8, 1, 3, 8, 197, 0, 83, 2, 11, 12, -1, -1, 9, 229, 0, 20, 196, 5, 12, 1, -1, 7, 165, 0, 79, 98, 7, 10, 0, 1, 8, 69, 0, 29, 191, 5, 10, 1, 1, 7, 37, 0, 2, 30, 10, 10, 1, 1, 12, 230, 0, 58, 34, 10, 8, 1, 3, 12, 102, 0, 2, 201, 5, 11, 0, 0, 4, 166, 0, 95, 228, 2, 14, 3, 0, 7, 198, 0, 21, 2, 12, 10, -1, 1, 12, 70, 0, 101, 105, 6, 10, 1, 1, 7, 38, 0, 67, 49, 9, 10, 1, 1, 10, 39, 0, 119, 219, 2, 4, 1, 1, 3, 167, 0, 112, 131, 6, 11, 0, 0, 7, 103, 0, 13, 107, 7, 11, 1, 3, 7, 199, 0, 57, 97, 7, 13, 1, 1, 8, 231, 0, 2, 186, 5, 11, 1, 3, 7, 71, 0, 66, 65, 8, 10, 1, 1, 10, 168, 0, 77, 217, 4, 2, 2, 0, 8, 104, 0, 72, 158, 6, 11, 1, 0, 8, 40, 0, 93, 212, 4, 12, 1, 1, 4, 200, 0, 47, 195, 5, 13, 1, -2, 7, 232, 0, 62, 143, 6, 11, 1, 0, 8, 72, 0, 54, 65, 8, 10, 1, 1, 10, 105, 0, 109, 213, 3, 11, 0, 0, 4, 41, 0, 51, 226, 3, 12, 0, 1, 4, 201, 0, 56, 197, 5, 13, 1, -2, 7, 233, 0, 52, 142, 6, 11, 1, 0, 8, 169, 0, 44, 34, 10, 10, 1, 1, 12, 73, 0, 38, 191, 5, 10, 0, 1, 5, 170, 0, 29, 205, 4, 5, 0, 1, 5, 42, 0, 108, 80, 7, 6, 0, 0, 8, 202, 0, 65, 202, 5, 13, 1, -2, 7, 74, 0, 92, 195, 5, 13, -2, 1, 3, 106, 0, 101, 213, 4, 14, -1, 0, 4, 234, 0, 12, 181, 6, 11, 1, 0, 8, 171, 0, 22, 181, 5, 6, 1, 4, 7, 43, 0, 101, 94, 7, 7, 0, 3, 8, 107, 0, 112, 92, 7, 11, 1, 0, 7, 203, 0, 83, 200, 5, 13, 1, -2, 7, 235, 0, 2, 171, 6, 11, 1, 0, 8, 75, 0, 102, 66, 8, 10, 1, 1, 8, 44, 0, 107, 231, 2, 3, 1, 9, 4, 172, 0, 2, 104, 7, 4, 0, 6, 8, 108, 0, 113, 228, 2, 11, 1, 0, 4, 204, 0, 101, 196, 5, 13, 0, -2, 5, 236, 0, 30, 214, 3, 11, 0, 0, 4, 76, 0, 22, 124, 6, 10, 1, 1, 7, 173, 0, 16, 229, 3, 2, 1, 7, 5, 45, 0, 123, 201, 3, 2, 1, 7, 5, 109, 0, 68, 2, 11, 8, 1, 3, 13, 205, 0, 11, 211, 5, 13, 0, -2, 5, 237, 0, 37, 214, 3, 11, 1, 0, 4, 77, 0, 62, 20, 10, 10, 1, 1, 12, 46, 0, 101, 231, 2, 2, 1, 9, 4, 110, 0, 111, 107, 6, 8, 1, 3, 8, 206, 0, 20, 212, 5, 13, 0, -2, 5, 238, 0, 11, 196, 5, 11, -1, 0, 4, 174, 0, 30, 33, 10, 10, 1, 1, 12, 78, 0, 2, 79, 8, 10, 1, 1, 10, 175, 0, 35, 111, 7, 1, 0, -1, 7, 111, 0, 102, 153, 6, 8, 1, 3, 8, 207, 0, 119, 184, 5, 13, 0, -2, 5, 239, 0, 69, 219, 4, 11, 0, 0, 4, 79, 0, 41, 66, 9, 10, 1, 1, 11, 47, 0, 90, 105, 7, 10, -1, 1, 5, 176, 0, 61, 219, 4, 4, 1, 1, 6, 112, 0, 32, 150, 6, 11, 1, 3, 8, 240, 0, 82, 165, 6, 11, 1, 0, 8, 208, 0, 86, 33, 9, 10, 0, 1, 10, 80, 0, 52, 128, 6, 10, 1, 1, 8, 48, 0, 42, 135, 6, 10, 1, 1, 8, 177, 0, 46, 97, 7, 8, 0, 3, 8, 113, 0, 22, 152, 6, 11, 1, 3, 8, 241, 0, 2, 112, 6, 12, 1, -1, 8, 81, 0, 15, 59, 9, 13, 1, 1, 11, 209, 0, 74, 80, 8, 14, 1, -3, 10, 49, 0, 45, 212, 4, 10, 2, 1, 8, 178, 0, 58, 187, 5, 6, 0, 1, 5, 114, 0, 85, 217, 4, 8, 1, 3, 5, 210, 0, 2, 62, 9, 13, 1, -2, 11, 242, 0, 62, 165, 6, 11, 1, 0, 8, 82, 0, 35, 97, 7, 10, 1, 1, 8, 50, 0, 57, 114, 7, 10, 1, 1, 8, 179, 0, 53, 214, 4, 6, 0, 1, 5, 115, 0, 112, 146, 6, 8, 0, 3, 7, 211, 0, 106, 49, 9, 13, 1, -2, 11, 243, 0, 52, 172, 6, 11, 1, 0, 8, 83, 0, 24, 96, 7, 10, 0, 1, 7, 51, 0, 22, 138, 6, 10, 1, 1, 8, 180, 0, 9, 228, 3, 2, 3, 0, 8, 116, 0, 67, 188, 5, 10, 0, 1, 5, 212, 0, 93, 49, 9, 13, 1, -2, 11, 244, 0, 42, 164, 6, 11, 1, 0, 8, 84, 0, 13, 93, 7, 10, 0, 1, 7, 52, 0, 24, 110, 7, 10, 1, 1, 8, 245, 0, 12, 165, 6, 12, 1, -1, 8, 181, 0, 2, 140, 6, 11, 1, 3, 8, 117, 0, 42, 123, 6, 8, 1, 3, 8, 53, 0, 92, 119, 6, 10, 1, 1, 8, 85, 0, 114, 66, 8, 10, 1, 1, 10, 213, 0, 2, 44, 9, 14, 1, -3, 11, 118, 0, 15, 47, 9, 8, -1, 3, 7, 182, 0, 68, 98, 7, 13, 1, 0, 9, 214, 0, 80, 49, 9, 13, 1, -2, 11, 246, 0, 72, 173, 6, 11, 1, 0, 8, 86, 0, 76, 18, 10, 10, -1, 1, 8, 54, 0, 82, 121, 6, 10, 1, 1, 8, 183, 0, 77, 223, 2, 2, 1, 5, 4, 215, 0, 2, 93, 7, 7, 0, 3, 8, 247, 0, 90, 94, 7, 7, 0, 3, 8, 119, 0, 37, 2, 12, 8, -1, 3, 10, 87, 0, 2, 2, 15, 10, -1, 1, 13, 55, 0, 72, 129, 6, 10, 1, 1, 8, 184, 0, 116, 212, 3, 3, 0, 11, 3, 120, 0, 119, 80, 7, 8, 0, 3, 7, 248, 0, 2, 128, 6, 8, 1, 3, 8, 216, 0, 99, 33, 9, 12, 1, 0, 11, 88, 0, 90, 19, 10, 10, -1, 1, 8, 56, 0, 62, 129, 6, 10, 1, 1, 8, 185, 0, 23, 229, 3, 6, 0, 1, 5, 57, 0, 12, 122, 6, 10, 1, 1, 8, 121, 0, 112, 33Line truncated
height = 14.0
ascent = 11.0
[node name="PortraitPicker" type="VBoxContainer"]
margin_right = 100.0
margin_bottom = 30.0
size_flags_vertical = 4
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Preview" type="Node2D" parent="."]
z_index = 1
[node name="PreviewContainer" type="PanelContainer" parent="Preview"]
visible = false
margin_left = 3.0
margin_top = 3.0
margin_right = 254.0
margin_bottom = 334.0
grow_horizontal = 0
custom_styles/panel = SubResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBox" type="VBoxContainer" parent="Preview/PreviewContainer"]
margin_left = 10.0
margin_top = 10.0
margin_right = 241.0
margin_bottom = 321.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Title" type="Button" parent="Preview/PreviewContainer/VBox"]
margin_right = 231.0
margin_bottom = 14.0
custom_fonts/font = SubResource( 6 )
text = "Preview"
flat = true
align = 0
[node name="TextureRect" type="TextureRect" parent="Preview/PreviewContainer/VBox"]
margin_top = 18.0
margin_right = 231.0
margin_bottom = 311.0
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
stretch_mode = 6
[node name="HBox" type="HBoxContainer" parent="."]
margin_right = 164.0
margin_bottom = 22.0
size_flags_horizontal = 3
size_flags_vertical = 4
[node name="Label" parent="HBox" instance=ExtResource( 4 )]
custom_colors/font_color = Color( 0, 0, 0, 1 )
[node name="MenuButton" parent="HBox" instance=ExtResource( 3 )]
margin_left = 82.0
margin_right = 164.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Portrait"
@@ -0,0 +1,22 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/EventPart_DefinitionPicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
[node name="DefinitionPicker" type="VBoxContainer"]
margin_right = 83.0
margin_bottom = 22.0
size_flags_vertical = 4
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
default_text = "Value"
[node name="HBox" type="HBoxContainer" parent="."]
margin_right = 98.0
margin_bottom = 22.0
[node name="MenuButton" parent="HBox" instance=ExtResource( 2 )]
margin_right = 98.0
text = "Definition"
@@ -0,0 +1,79 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
export (String) var default_text = "Select Definition"
## node references
onready var picker_menu = $HBox/MenuButton
# used to connect the signals
func _ready():
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
# themeing
picker_menu.custom_icon_modulation = get_color("font_color", "Editor")
picker_menu.custom_icon = load("res://addons/dialogic/Images/Resources/definition.svg")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
# Now update the ui nodes to display the data.
select_definition_by_id(data['definition'])
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func select_definition_by_id(id):
if id != '':
for d in DialogicResources.get_default_definitions()['variables']:
if d['id'] == id:
picker_menu.text = d['name']
else:
picker_menu.text = default_text
# when an index is selected on one of the menus.
func _on_PickerMenu_selected(index, menu):
var text = menu.get_item_text(index)
var metadata = menu.get_item_metadata(index)
picker_menu.text = text
event_data['definition'] = metadata['file']
# informs the parent about the changes!
data_changed()
func _on_PickerMenu_about_to_show():
# Building the picker menu()
picker_menu.get_popup().clear()
## building the root level
build_PickerMenuFolder(picker_menu.get_popup(), DialogicUtil.get_definitions_folder_structure(), "MenuButton")
# is called recursively to build all levels of the folder structure
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
var index = 0
for folder_name in folder_structure['folders'].keys():
var submenu = PopupMenu.new()
var submenu_name = build_PickerMenuFolder(submenu, folder_structure['folders'][folder_name], folder_name)
submenu.name = submenu_name
menu.add_submenu_item(folder_name, submenu_name)
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
menu.add_child(submenu)
picker_menu.update_submenu_style(submenu)
index += 1
var files_info = DialogicUtil.get_default_definitions_dict()
for file in folder_structure['files']:
if files_info[file]["type"] == 0:
menu.add_item(files_info[file]['name'])
menu.set_item_icon(index, load("res://addons/dialogic/Images/Resources/definition.svg"))
menu.set_item_metadata(index, {'file':file})
index += 1
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
menu.connect("index_pressed", self, '_on_PickerMenu_selected', [menu])
return current_folder_name
@@ -0,0 +1,79 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
export (String) var default_text = "Select Glossary Item"
## node references
onready var picker_menu = $MenuButton
# used to connect the signals
func _ready():
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
picker_menu.custom_icon = get_icon("ListSelect", "EditorIcons")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
# Now update the ui nodes to display the data.
select_glossary_by_id(data['glossary_id'])
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func select_glossary_by_id(id):
if id != '':
for d in DialogicResources.get_default_definitions()['glossary']:
if d['id'] == id:
picker_menu.text = d['name']
else:
picker_menu.text = default_text
# when an index is selected on one of the menus.
func _on_PickerMenu_selected(index, menu):
event_data['glossary_id'] = menu.get_item_metadata(index).get('file', '')
select_glossary_by_id(event_data['glossary_id'])
# informs the parent about the changes!
data_changed()
func _on_PickerMenu_about_to_show():
build_PickerMenu()
func build_PickerMenu():
picker_menu.get_popup().clear()
var folder_structure = DialogicUtil.get_definitions_folder_structure()
## building the root level
build_PickerMenuFolder(picker_menu.get_popup(), folder_structure, "MenuButton")
# is called recursively to build all levels of the folder structure
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
var index = 0
#menu.name = current_folder_name
for folder_name in folder_structure['folders'].keys():
var submenu = PopupMenu.new()
var submenu_name = build_PickerMenuFolder(submenu, folder_structure['folders'][folder_name], folder_name)
submenu.name = submenu_name
menu.add_submenu_item(folder_name, submenu_name)
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
menu.add_child(submenu)
picker_menu.update_submenu_style(submenu)
index += 1
var files_info = DialogicUtil.get_default_definitions_dict()
for file in folder_structure['files']:
if files_info[file]["type"] == 1:
menu.add_item(files_info[file]['name'])
menu.set_item_icon(index, editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree").glossary_icon)
menu.set_item_metadata(index, {'file':file})
index += 1
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
menu.connect("index_pressed", self, '_on_PickerMenu_selected', [menu])
return current_folder_name
@@ -0,0 +1,133 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
## node references
onready var title_input = $Title/Input
onready var title_check = $Title/Check
onready var text_input = $Text/Input
onready var text_check = $Text/Check
onready var extra_input = $Extra/Input
onready var extra_check = $Extra/Check
# used to connect the signals
func _ready():
title_input.connect("text_changed", self, "_on_TitleField_text_changed")
text_input.connect("text_changed", self, "_on_TextField_text_changed")
extra_input.connect("text_changed", self, "_on_ExtraField_text_changed")
title_check.connect("toggled", self, "_on_TitleCheck_toggled")
text_check.connect("toggled", self, "_on_TextCheck_toggled")
extra_check.connect("toggled", self, "_on_ExtraCheck_toggled")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
emit_signal("request_set_body_enabled", event_data['glossary_id'] != '')
$Title.visible = event_data['glossary_id'] != ''
$Text.visible = event_data['glossary_id'] != ''
$Extra.visible = event_data['glossary_id'] != ''
if event_data['glossary_id']:
var glossary_default
for d in DialogicResources.get_default_definitions()['glossary']:
if d['id'] == event_data['glossary_id']:
glossary_default = d
if glossary_default == null:
print('[D] The glossary item with id ', event_data['glossary_id'], ' cannot be found anymore. The event will be reset.')
event_data['glossary_id'] = ''
load_data(event_data)
return
title_input.placeholder_text = glossary_default['title']
text_input.placeholder_text = glossary_default['text']
extra_input.placeholder_text = glossary_default['extra']
# Now update the ui nodes to display the data.
if event_data['title'] == "[No Change]":
title_check.pressed = true
title_input.text = ""
else:
title_check.pressed = false
title_input.text = event_data['title']
if event_data['text'] == "[No Change]":
text_check.pressed = true
text_input.text = ""
else:
text_check.pressed = false
text_input.text = event_data['text']
if event_data['extra'] == "[No Change]":
extra_check.pressed = true
extra_input.text = ""
else:
extra_check.pressed = false
extra_input.text = event_data['extra']
# has to return the wanted preview, only useful for body parts
func get_preview():
if event_data['glossary_id']:
var text := ""
if event_data['title'] != "[No Change]":
text += "Changes title to '"+event_data['title']+"'. "
if event_data['extra'] != "[No Change]":
text += "Changes extra to '"+event_data['extra']+"'. "
if event_data['text'] != "[No Change]":
text += "Changes text to '"+event_data['text']+"'. "
return text
return ''
func _on_TitleField_text_changed(text):
event_data['title'] = text
# informs the parent about the changes!
data_changed()
func _on_TextField_text_changed(text):
event_data['text'] = text
# informs the parent about the changes!
data_changed()
func _on_ExtraField_text_changed(text):
event_data['extra'] = text
# informs the parent about the changes!
data_changed()
func _on_TitleCheck_toggled(toggle):
if toggle:
event_data['title'] = "[No Change]"
title_input.editable = false
else:
event_data['title'] = title_input.text
title_input.editable = true
# informs the parent about the changes!
data_changed()
func _on_TextCheck_toggled(toggle):
if toggle:
event_data['text'] = "[No Change]"
text_input.editable = false
else:
event_data['text'] = text_input.text
text_input.editable = true
# informs the parent about the changes!
data_changed()
func _on_ExtraCheck_toggled(toggle):
if toggle:
event_data['extra'] = "[No Change]"
extra_input.editable = false
else:
event_data['extra'] = extra_input.text
extra_input.editable = true
# informs the parent about the changes!
data_changed()
@@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/EventPart_GlossaryPicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
[node name="GlossaryPicker" type="HBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
size_flags_vertical = 4
script = ExtResource( 1 )
default_text = "Glossary item"
[node name="Label" parent="." instance=ExtResource( 3 )]
margin_top = 13.0
margin_right = 93.0
margin_bottom = 27.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Set content of "
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
margin_left = 97.0
margin_top = 8.0
margin_right = 285.0
margin_bottom = 32.0
custom_colors/font_color = Color( 0.8, 0.807843, 0.827451, 1 )
text = "Select Glossary Item"
@@ -0,0 +1,87 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/EventPart_SetGlossary.gd" type="Script" id=3]
[node name="SetGlossary" type="VBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
size_flags_horizontal = 0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Title" type="HBoxContainer" parent="."]
margin_right = 331.0
margin_bottom = 27.0
custom_constants/separation = 20
[node name="Label" type="Label" parent="Title"]
margin_top = 6.0
margin_right = 50.0
margin_bottom = 20.0
rect_min_size = Vector2( 50, 0 )
text = "Title:"
[node name="Input" parent="Title" instance=ExtResource( 1 )]
margin_left = 70.0
margin_right = 200.0
margin_bottom = 27.0
size_flags_horizontal = 3
[node name="Check" type="CheckBox" parent="Title"]
margin_left = 220.0
margin_right = 331.0
margin_bottom = 27.0
text = "Don't change"
[node name="Text" type="HBoxContainer" parent="."]
margin_top = 31.0
margin_right = 331.0
margin_bottom = 58.0
custom_constants/separation = 20
[node name="Label" type="Label" parent="Text"]
margin_top = 6.0
margin_right = 50.0
margin_bottom = 20.0
rect_min_size = Vector2( 50, 0 )
text = "Text:"
[node name="Input" parent="Text" instance=ExtResource( 1 )]
margin_left = 70.0
margin_right = 200.0
margin_bottom = 27.0
size_flags_horizontal = 3
[node name="Check" type="CheckBox" parent="Text"]
margin_left = 220.0
margin_right = 331.0
margin_bottom = 27.0
text = "Don't change"
[node name="Extra" type="HBoxContainer" parent="."]
margin_top = 62.0
margin_right = 331.0
margin_bottom = 89.0
custom_constants/separation = 20
[node name="Label" type="Label" parent="Extra"]
margin_top = 6.0
margin_right = 50.0
margin_bottom = 20.0
rect_min_size = Vector2( 50, 0 )
text = "Extra:"
[node name="Input" parent="Extra" instance=ExtResource( 1 )]
margin_left = 70.0
margin_right = 200.0
margin_bottom = 27.0
size_flags_horizontal = 3
[node name="Check" type="CheckBox" parent="Extra"]
margin_left = 220.0
margin_right = 331.0
margin_bottom = 27.0
text = "Don't change"
@@ -0,0 +1,117 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
export(String, "Audio", "Background", "Scene", "Resource") var Mode = "Background"
## node references
onready var file_button = $FileButton
onready var clear_button = $ClearButton
# until we change the background color of the pickers, the color should ignore the theme
var default_color = Color('ccced3')
# used to connect the signals
func _ready():
editor_reference = find_parent("EditorView")
file_button.connect("pressed", self, "_on_FileButton_pressed")
clear_button.connect('pressed', self, "_on_ClearButton_pressed")
file_button.add_color_override("font_color", default_color) #get_color("mono_color", "Editor"))
clear_button.icon = get_icon("Reload", "EditorIcons")
$FileButton/icon2.texture = get_icon("GuiSliderGrabber", "EditorIcons")
match Mode:
"Audio":
$Label.text = "Play"
$FileButton/icon.texture = get_icon("AudioStreamPlayer", "EditorIcons")
"Background":
$Label.text = "to"
$FileButton/icon.texture = get_icon("Image", "EditorIcons")
"Scene":
$Label.text = "to"
$FileButton/icon.texture = get_icon("PackedScene", "EditorIcons")
"Resource":
$Label.text = "to"
$FileButton/icon.texture = get_icon("PackedScene", "EditorIcons")
# called by the parent event part
func load_data(event_data:Dictionary):
# first update the event_data
.load_data(event_data)
# then the ui
var path
file_button.text = ""
match Mode:
"Audio":
path = event_data['file']
if path.empty():
file_button.text = 'nothing (will stop previous)'
"Background":
path = event_data['background']
if path.empty():
file_button.text = 'nothing (will hide previous)'
"Scene":
path = event_data['change_scene']
if path.empty():
file_button.text = 'a yet to be selected scene'
"Resource":
path = event_data['resource_file']
if path.empty():
file_button.text = 'a yet to be selected resource'
if file_button.text.empty():
file_button.text = path.get_file()
file_button.hint_tooltip = path
clear_button.visible = !path.empty()
func _on_FileButton_pressed():
match Mode:
"Audio":
editor_reference.godot_dialog("*.wav, *.ogg, *.mp3")
"Background":
editor_reference.godot_dialog("*.png, *.jpg, *.jpeg, *.tga, *.svg, *.svgz, *.bmp, *.webp, *.tscn")
"Scene":
editor_reference.godot_dialog("*.tscn")
"Resource":
editor_reference.godot_dialog("*.tres, *.res")
editor_reference.godot_dialog_connect(self, "_on_file_selected")
func _on_file_selected(path, target):
match Mode:
"Audio":
event_data['file'] = path
"Background":
event_data['background'] = path
"Scene":
event_data['change_scene'] = path
"Resource":
event_data['resource_file'] = path
clear_button.visible = true
file_button.text = path.get_file()
file_button.hint_tooltip = path
# informs the parent about the changes!
data_changed()
func _on_ClearButton_pressed():
match Mode:
"Audio":
event_data['file'] = ""
file_button.text = 'nothing (will stop previous)'
"Background":
event_data['background'] = ""
file_button.text = 'nothing (will hide previous)'
"Scene":
event_data['change_scene'] = ""
file_button.text = 'a yet to be selected scene'
"Resource":
event_data['resource_file'] = ""
file_button.text = 'a yet to be selected resource'
clear_button.visible = false
# informs the parent about the changes!
data_changed()
@@ -0,0 +1,87 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SimpleButtonHover.tres" type="StyleBox" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SettingsFieldBackground.tres" type="StyleBox" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Files/EventPart_FilePicker.gd" type="Script" id=3]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SimpleButtonNormal.tres" type="StyleBox" id=7]
[sub_resource type="Image" id=3]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "LumAlpha8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 4
flags = 4
image = SubResource( 3 )
size = Vector2( 16, 16 )
[node name="FilePicker" type="HBoxContainer"]
margin_top = 1.0
margin_right = 331.0
margin_bottom = 23.0
size_flags_vertical = 4
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" parent="." instance=ExtResource( 4 )]
margin_top = 5.0
margin_right = 13.0
margin_bottom = 19.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "to"
[node name="FileButton" type="Button" parent="."]
margin_left = 17.0
margin_right = 143.0
margin_bottom = 24.0
custom_styles/hover = ExtResource( 2 )
custom_styles/pressed = ExtResource( 2 )
custom_styles/focus = ExtResource( 2 )
custom_styles/normal = ExtResource( 2 )
text = "none so far"
[node name="icon" type="TextureRect" parent="FileButton"]
margin_left = 4.0
margin_top = 5.0
margin_right = 23.0
margin_bottom = 24.0
texture = SubResource( 2 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="icon2" type="TextureRect" parent="FileButton"]
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
margin_left = -20.9581
margin_top = -6.63555
margin_right = -5.95807
margin_bottom = 8.36445
texture = SubResource( 2 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ClearButton" type="Button" parent="."]
margin_left = 147.0
margin_right = 169.0
margin_bottom = 24.0
rect_min_size = Vector2( 22, 22 )
custom_styles/hover = ExtResource( 1 )
custom_styles/pressed = ExtResource( 1 )
custom_styles/normal = ExtResource( 7 )
icon = SubResource( 2 )
@@ -0,0 +1,32 @@
tool
extends MenuButton
export (Texture) var custom_icon setget set_custom_icon
var custom_icon_modulation setget set_custom_icon_modulation
var menu_background
# until we change the background color of the pickers, the color should ignore the theme
var default_color = Color('ccced3')
func _ready():
menu_background = load("res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres")
menu_background.bg_color = get_color("base_color", "Editor")
add_color_override("font_color", default_color) #get_color("mono_color", "Editor"))
update_submenu_style(get_popup())
reset_modulation()
$Icon2.texture = get_icon("Collapse", "EditorIcons")
func update_submenu_style(submenu):
submenu.add_stylebox_override('panel', menu_background)
submenu.add_stylebox_override('hover', StyleBoxEmpty.new())
submenu.add_color_override('font_color_hover', get_color("accent_color", "Editor"))
func set_custom_icon(texture:Texture):
$Icon.texture = texture
func set_custom_icon_modulation(color:Color):
$Icon.modulate = color
func reset_modulation():
$Icon.modulate = default_color#get_color("font_color", "Editor")
$Icon2.modulate = default_color#get_color("font_color", "Editor")
@@ -0,0 +1,66 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SettingsFieldBackground.tres" type="StyleBox" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.gd" type="Script" id=3]
[sub_resource type="Image" id=3]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "LumAlpha8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 4
flags = 4
image = SubResource( 3 )
size = Vector2( 16, 16 )
[node name="MenuButton" type="MenuButton"]
margin_right = 98.0
margin_bottom = 24.0
focus_mode = 2
size_flags_vertical = 4
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_styles/hover = ExtResource( 1 )
custom_styles/pressed = ExtResource( 1 )
custom_styles/normal = ExtResource( 1 )
text = "Resource"
flat = false
align = 0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Icon" type="TextureRect" parent="."]
modulate = Color( 0, 0, 0, 1 )
anchor_bottom = 1.0
margin_left = 8.0
margin_top = 4.0
margin_right = 23.0
margin_bottom = -4.0
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Icon2" type="TextureRect" parent="."]
modulate = Color( 0, 0, 0, 1 )
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
margin_left = -20.7581
margin_top = -8.78745
margin_right = -5.75813
margin_bottom = 7.21255
texture = SubResource( 2 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
@@ -0,0 +1,28 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
## node references
onready var file_picker = $FilePicker
# used to connect the signals
func _ready():
file_picker.connect("data_changed", self, "_on_ScenePicker_data_changed")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
# Now update the ui nodes to display the data.
file_picker.load_data(data)
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func _on_ScenePicker_data_changed(data):
event_data = data
data_changed()
@@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Scenes/EventPart_ScenePicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Files/FilePicker.tscn" type="PackedScene" id=2]
[node name="ScenePicker" type="VBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
size_flags_vertical = 4
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="FilePicker" parent="." instance=ExtResource( 2 )]
margin_top = 0.0
margin_right = 199.0
margin_bottom = 22.0
Mode = "Scene"
@@ -0,0 +1,78 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
export (String) var default_text = "Select Theme"
## node references
onready var picker_menu = $MenuButton
# used to connect the signals
func _ready():
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
picker_menu.custom_icon = load("res://addons/dialogic/Images/Resources/theme.svg")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
# Now update the ui nodes to display the data.
select_theme()
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func select_theme():
if event_data['set_theme'] != '':
for theme in DialogicUtil.get_theme_list():
if theme['file'] == event_data['set_theme']:
picker_menu.text = theme['name']
else:
picker_menu.text = default_text
# when an index is selected on one of the menus.
func _on_PickerMenu_selected(index, menu):
event_data['set_theme'] = menu.get_item_metadata(index).get('file', '')
select_theme()
# informs the parent about the changes!
data_changed()
func _on_PickerMenu_about_to_show():
build_PickerMenu()
func build_PickerMenu():
picker_menu.get_popup().clear()
var folder_structure = DialogicUtil.get_theme_folder_structure()
## building the root level
build_PickerMenuFolder(picker_menu.get_popup(), folder_structure, "MenuButton")
# is called recursively to build all levels of the folder structure
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
var index = 0
for folder_name in folder_structure['folders'].keys():
var submenu = PopupMenu.new()
var submenu_name = build_PickerMenuFolder(submenu, folder_structure['folders'][folder_name], folder_name)
submenu.name = submenu_name
menu.add_submenu_item(folder_name, submenu_name)
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
menu.add_child(submenu)
picker_menu.update_submenu_style(submenu)
index += 1
var files_info = DialogicUtil.get_theme_dict()
for file in folder_structure['files']:
menu.add_item(files_info[file]['name'])
menu.set_item_icon(index, editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree").theme_icon)
menu.set_item_metadata(index, {'file':file})
index += 1
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
menu.connect("index_pressed", self, '_on_PickerMenu_selected', [menu])
return current_folder_name
@@ -0,0 +1,29 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Themes/EventPart_ThemePicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
[node name="ThemePicker" type="HBoxContainer"]
margin_right = 157.0
margin_bottom = 27.0
size_flags_vertical = 4
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
show_text = true
[node name="Label" parent="." instance=ExtResource( 3 )]
margin_top = 6.0
margin_right = 59.0
margin_bottom = 20.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "to theme"
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
margin_left = 63.0
margin_top = 1.0
margin_right = 177.0
margin_bottom = 25.0
custom_colors/font_color = Color( 0.8, 0.807843, 0.827451, 1 )
@@ -0,0 +1,79 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
## node references
onready var picker_menu = $MenuButton
# used to connect the signals
func _ready():
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
picker_menu.custom_icon = load("res://addons/dialogic/Images/Resources/timeline.svg")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
# Now update the ui nodes to display the data.
if event_data['change_timeline'] != '':
for c in DialogicUtil.get_timeline_list():
if c['file'] == event_data['change_timeline']:
picker_menu.text = c['name']
else:
picker_menu.text = 'Select Timeline'
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
# when an index is selected on one of the menus.
func _on_PickerMenu_selected(index, menu):
var text = menu.get_item_text(index)
var metadata = menu.get_item_metadata(index)
picker_menu.text = text
event_data['change_timeline'] = metadata['file']
# informs the parent about the changes!
data_changed()
func _on_PickerMenu_about_to_show():
build_PickerMenu()
func build_PickerMenu():
picker_menu.get_popup().clear()
var folder_structure = DialogicUtil.get_timelines_folder_structure()
## building the root level
build_PickerMenuFolder(picker_menu.get_popup(), folder_structure, "MenuButton")
# is called recursively to build all levels of the folder structure
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
var index = 0
for folder_name in folder_structure['folders'].keys():
var submenu = PopupMenu.new()
var submenu_name = build_PickerMenuFolder(submenu, folder_structure['folders'][folder_name], folder_name)
submenu.name = submenu_name
menu.add_submenu_item(folder_name, submenu_name)
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
menu.add_child(submenu)
picker_menu.update_submenu_style(submenu)
index += 1
var files_info = DialogicUtil.get_timeline_dict()
for file in folder_structure['files']:
menu.add_item(files_info[file]['name'])
menu.set_item_icon(index, editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree").timeline_icon)
menu.set_item_metadata(index, {'file':file})
index += 1
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
menu.connect("index_pressed", self, '_on_PickerMenu_selected', [menu])
return current_folder_name
@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Timelines/EventPart_TimelinePicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
[node name="TimelinePicker" type="HBoxContainer"]
margin_right = 119.0
margin_bottom = 20.0
size_flags_vertical = 6
script = ExtResource( 1 )
[node name="Label" parent="." instance=ExtResource( 3 )]
margin_right = 87.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Start timeline"
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
margin_left = 91.0
margin_right = 185.0