First work on dialogic, resized guild, and started implementing portraits.
This commit is contained in:
@@ -0,0 +1,352 @@
|
||||
@tool
|
||||
extends Tree
|
||||
|
||||
enum TreeButtons {ADD_FOLDER, ADD_VARIABLE, DUPLICATE_FOLDER, DELETE, CHANGE_TYPE}
|
||||
|
||||
@onready var editor: DialogicEditor = find_parent("VariablesEditor")
|
||||
|
||||
|
||||
#region INITIAL SETUP
|
||||
|
||||
func _ready() -> void:
|
||||
set_column_title(0, "Name")
|
||||
set_column_title(1, "")
|
||||
set_column_title(2, "Default Value")
|
||||
set_column_expand(1, false)
|
||||
set_column_expand_ratio(2, 2)
|
||||
set_column_title_alignment(0, 0)
|
||||
set_column_title_alignment(2, 0)
|
||||
|
||||
%ChangeTypePopup.self_modulate = get_theme_color("dark_color_3", "Editor")
|
||||
%ChangeTypePopup.theme.set_stylebox('pressed', 'Button', get_theme_stylebox("LaunchPadMovieMode", "EditorStyles"))
|
||||
%ChangeTypePopup.theme.set_stylebox('hover', 'Button', get_theme_stylebox("LaunchPadMovieMode", "EditorStyles"))
|
||||
for child in %ChangeTypePopup/HBox.get_children():
|
||||
child.toggled.connect(_on_type_pressed.bind(child.get_index()+1))
|
||||
child.icon = get_theme_icon(["String", "float", "int", "bool"][child.get_index()], "EditorIcons")
|
||||
|
||||
%RightClickMenu.set_item_icon(0, get_theme_icon("ActionCopy", "EditorIcons"))
|
||||
#endregion
|
||||
|
||||
|
||||
#region POPULATING THE TREE
|
||||
|
||||
func load_info(dict:Dictionary, parent:TreeItem = null, is_new:=false) -> void:
|
||||
if parent == null:
|
||||
clear()
|
||||
parent = add_folder_item("VAR", null)
|
||||
|
||||
var sorted_keys := dict.keys()
|
||||
sorted_keys.sort()
|
||||
for key in sorted_keys:
|
||||
if typeof(dict[key]) != TYPE_DICTIONARY:
|
||||
var item := add_variable_item(key, dict[key], parent)
|
||||
if is_new:
|
||||
item.set_meta("new", true)
|
||||
|
||||
for key in sorted_keys:
|
||||
if typeof(dict[key]) == TYPE_DICTIONARY:
|
||||
var folder := add_folder_item(key, parent)
|
||||
if is_new:
|
||||
folder.set_meta("new", true)
|
||||
load_info(dict[key], folder, is_new)
|
||||
|
||||
|
||||
|
||||
func add_variable_item(name:String, value:Variant, parent:TreeItem) -> TreeItem:
|
||||
var item := create_item(parent)
|
||||
item.set_meta("type", "VARIABLE")
|
||||
|
||||
item.set_text(0, name)
|
||||
item.set_editable(0, true)
|
||||
item.set_metadata(0, name)
|
||||
item.set_icon(0, load(DialogicUtil.get_module_path('Variable').path_join("variable.svg")))
|
||||
var folder_color: Color = parent.get_meta('color', Color.DARK_GOLDENROD)
|
||||
item.set_custom_bg_color(0, folder_color.lerp(get_theme_color("background", "Editor"), 0.8))
|
||||
|
||||
item.add_button(1, get_theme_icon("String", "EditorIcons"), TreeButtons.CHANGE_TYPE)
|
||||
adjust_variable_type(item, DialogicUtil.get_variable_value_type(value), value)
|
||||
item.set_editable(2, true)
|
||||
item.add_button(2, get_theme_icon("Remove", "EditorIcons"), TreeButtons.DELETE)
|
||||
|
||||
item.set_meta('prev_path', get_item_path(item))
|
||||
return item
|
||||
|
||||
|
||||
func add_folder_item(name:String, parent:TreeItem) -> TreeItem:
|
||||
var item := create_item(parent)
|
||||
item.set_icon(0, get_theme_icon("Folder", "EditorIcons"))
|
||||
item.set_text(0, name)
|
||||
item.set_editable(0, item != get_root())
|
||||
|
||||
var folder_color: Color
|
||||
if parent == null:
|
||||
folder_color = Color(0.33000001311302, 0.15179999172688, 0.15179999172688)
|
||||
else:
|
||||
folder_color = parent.get_meta('color')
|
||||
folder_color.h = wrap(folder_color.h+0.15*(item.get_index()+1), 0, 1)
|
||||
item.set_custom_bg_color(0, folder_color)
|
||||
item.set_custom_bg_color(1, folder_color)
|
||||
item.set_custom_bg_color(2, folder_color)
|
||||
item.set_meta('color', folder_color)
|
||||
item.add_button(2, load(self.get_script().get_path().get_base_dir().get_base_dir() + "/add-variable.svg"), TreeButtons.ADD_VARIABLE)
|
||||
item.add_button(2, load("res://addons/dialogic/Editor/Images/Pieces/add-folder.svg"), TreeButtons.ADD_FOLDER)
|
||||
item.add_button(2, get_theme_icon("Duplicate", "EditorIcons"), TreeButtons.DUPLICATE_FOLDER, item == get_root())
|
||||
item.add_button(2, get_theme_icon("Remove", "EditorIcons"), TreeButtons.DELETE, item == get_root())
|
||||
item.set_meta("type", "FOLDER")
|
||||
return item
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region EDITING THE TREE
|
||||
|
||||
func set_variable_item_type(item:TreeItem, type:int) -> void:
|
||||
item.set_meta('value_type', type)
|
||||
item.set_button(1, 0, get_theme_icon(["Variant", "String", "float", "int", "bool"][type], "EditorIcons"))
|
||||
|
||||
|
||||
func get_variable_item_default(item:TreeItem) -> Variant:
|
||||
match int(item.get_meta('value_type', DialogicUtil.VarTypes.STRING)):
|
||||
DialogicUtil.VarTypes.STRING:
|
||||
return item.get_text(2)
|
||||
DialogicUtil.VarTypes.FLOAT:
|
||||
return item.get_range(2)
|
||||
DialogicUtil.VarTypes.INT:
|
||||
return int(item.get_range(2))
|
||||
DialogicUtil.VarTypes.BOOL:
|
||||
return item.is_checked(2)
|
||||
return ""
|
||||
|
||||
|
||||
func _on_button_clicked(item: TreeItem, column: int, id: int, mouse_button_index: int) -> void:
|
||||
match id:
|
||||
TreeButtons.ADD_FOLDER:
|
||||
var new_item := add_folder_item("Folder", item)
|
||||
new_item.select(0)
|
||||
new_item.set_meta("new", true)
|
||||
await get_tree().process_frame
|
||||
edit_selected()
|
||||
TreeButtons.ADD_VARIABLE:
|
||||
var new_item := add_variable_item("Var", "", item)
|
||||
new_item.select(0)
|
||||
new_item.set_meta("new", true)
|
||||
await get_tree().process_frame
|
||||
edit_selected()
|
||||
TreeButtons.DELETE:
|
||||
item.free()
|
||||
TreeButtons.DUPLICATE_FOLDER:
|
||||
load_info({item.get_text(0)+"(copy)":get_info(item)}, item.get_parent(), true)
|
||||
TreeButtons.CHANGE_TYPE:
|
||||
%ChangeTypePopup.show()
|
||||
%ChangeTypePopup.set_meta('item', item)
|
||||
%ChangeTypePopup.position = get_local_mouse_position()+Vector2(-%ChangeTypePopup.size.x/2, 10)
|
||||
for child in %ChangeTypePopup/HBox.get_children():
|
||||
child.set_pressed_no_signal(false)
|
||||
%ChangeTypePopup/HBox.get_child(int(item.get_meta('value_type', DialogicUtil.VarTypes.STRING)-1)).set_pressed_no_signal(true)
|
||||
|
||||
|
||||
func _on_type_pressed(pressed:bool, type:int) -> void:
|
||||
%ChangeTypePopup.hide()
|
||||
var item: Variant = %ChangeTypePopup.get_meta('item')
|
||||
adjust_variable_type(item, type, item.get_metadata(2))
|
||||
|
||||
|
||||
func _on_item_edited() -> void:
|
||||
var item := get_edited()
|
||||
match item.get_meta('type'):
|
||||
"VARIABLE":
|
||||
match get_edited_column():
|
||||
0:
|
||||
if item.get_text(0).is_empty():
|
||||
item.set_text(0, item.get_metadata(0))
|
||||
|
||||
else:
|
||||
if item.get_text(0) != item.get_metadata(0):
|
||||
item.set_metadata(0, item.get_text(0))
|
||||
report_name_changes(item)
|
||||
|
||||
2:
|
||||
item.set_metadata(2, get_variable_item_default(item))
|
||||
"FOLDER":
|
||||
report_name_changes(item)
|
||||
|
||||
|
||||
func adjust_variable_type(item:TreeItem, type:int, prev_value:Variant) -> void:
|
||||
set_variable_item_type(item, type)
|
||||
match type:
|
||||
DialogicUtil.VarTypes.STRING:
|
||||
item.set_metadata(2, str(prev_value))
|
||||
item.set_cell_mode(2, TreeItem.CELL_MODE_STRING)
|
||||
item.set_text(2, str(prev_value))
|
||||
DialogicUtil.VarTypes.FLOAT:
|
||||
item.set_metadata(2, float(prev_value))
|
||||
item.set_cell_mode(2, TreeItem.CELL_MODE_RANGE)
|
||||
item.set_range_config(2, -9999, 9999, 0.001, false)
|
||||
item.set_range(2, float(prev_value))
|
||||
DialogicUtil.VarTypes.INT:
|
||||
item.set_metadata(2, int(prev_value))
|
||||
item.set_cell_mode(2, TreeItem.CELL_MODE_RANGE)
|
||||
item.set_range_config(2, -9999, 9999, 1, false)
|
||||
item.set_range(2, int(prev_value))
|
||||
DialogicUtil.VarTypes.BOOL:
|
||||
item.set_metadata(2, prev_value and true)
|
||||
item.set_cell_mode(2, TreeItem.CELL_MODE_CHECK)
|
||||
item.set_checked(2, prev_value and true)
|
||||
|
||||
|
||||
func _input(event):
|
||||
if !%ChangeTypePopup.visible:
|
||||
return
|
||||
if event is InputEventMouseButton and event.pressed:
|
||||
if not %ChangeTypePopup.get_global_rect().has_point(get_global_mouse_position()):
|
||||
%ChangeTypePopup.hide()
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
func filter(filter_term:String, item:TreeItem = null) -> bool:
|
||||
if item == null:
|
||||
item = get_root()
|
||||
|
||||
var any := false
|
||||
for child in item.get_children():
|
||||
match child.get_meta('type'):
|
||||
"VARIABLE":
|
||||
child.visible = filter_term.is_empty() or filter_term.to_lower() in child.get_text(0).to_lower()
|
||||
|
||||
"FOLDER":
|
||||
child.visible = filter(filter_term, child)
|
||||
if child.visible:
|
||||
any = true
|
||||
return any
|
||||
|
||||
|
||||
## Parses the tree and returns a dictionary representing it.
|
||||
func get_info(item:TreeItem = null) -> Dictionary:
|
||||
if item == null:
|
||||
item = get_root()
|
||||
if item == null:
|
||||
return {}
|
||||
|
||||
var dict := {}
|
||||
|
||||
for child in item.get_children():
|
||||
match child.get_meta('type'):
|
||||
"VARIABLE":
|
||||
dict[child.get_text(0)] = child.get_metadata(2)
|
||||
"FOLDER":
|
||||
dict[child.get_text(0)] = get_info(child)
|
||||
|
||||
return dict
|
||||
|
||||
|
||||
#region DRAG AND DROP
|
||||
################################################################################
|
||||
|
||||
func _get_drag_data(position:Vector2) -> Variant:
|
||||
drop_mode_flags = DROP_MODE_INBETWEEN
|
||||
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:
|
||||
return
|
||||
|
||||
var drop_section := get_drop_section_at_position(position)
|
||||
var parent: TreeItem = null
|
||||
if (drop_section == 1 and to_item.get_meta('type') == "FOLDER") or to_item == get_root():
|
||||
parent = to_item
|
||||
else:
|
||||
parent = to_item.get_parent()
|
||||
|
||||
## Test for inheritance-recursion
|
||||
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 new_item: TreeItem = null
|
||||
match item.get_meta('type'):
|
||||
"VARIABLE":
|
||||
new_item = add_variable_item(item.get_text(0), item.get_metadata(2), parent)
|
||||
new_item.set_meta('prev_path', get_item_path(item))
|
||||
if item.get_meta("new", false):
|
||||
new_item.set_meta("new", true)
|
||||
"FOLDER":
|
||||
new_item = add_folder_item(item.get_text(0), parent)
|
||||
load_info(get_info(item), new_item)
|
||||
if item.get_meta("new", false):
|
||||
new_item.set_meta("new", true)
|
||||
|
||||
# If this was dropped on a variable (or the root node)
|
||||
if to_item != parent:
|
||||
if drop_section == -1:
|
||||
new_item.move_before(to_item)
|
||||
else:
|
||||
new_item.move_after(to_item)
|
||||
|
||||
report_name_changes(new_item)
|
||||
|
||||
item.free()
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region NAME CHANGES
|
||||
################################################################################
|
||||
|
||||
func report_name_changes(item:TreeItem) -> void:
|
||||
|
||||
match item.get_meta('type'):
|
||||
"VARIABLE":
|
||||
if item.get_meta("new", false):
|
||||
return
|
||||
var new_path := get_item_path(item)
|
||||
editor.variable_renamed(item.get_meta('prev_path'), new_path)
|
||||
item.set_meta('prev_path', new_path)
|
||||
"FOLDER":
|
||||
for child in item.get_children():
|
||||
report_name_changes(child)
|
||||
|
||||
|
||||
func get_item_path(item:TreeItem) -> String:
|
||||
var path := item.get_text(0)
|
||||
while item.get_parent() != get_root():
|
||||
item = item.get_parent()
|
||||
path = item.get_text(0)+"."+path
|
||||
return path
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
func _on_gui_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_MASK_RIGHT and event.pressed:
|
||||
var item := get_item_at_position(get_local_mouse_position())
|
||||
if item and item != get_root():
|
||||
%RightClickMenu.popup_on_parent(Rect2(get_global_mouse_position(), Vector2()))
|
||||
%RightClickMenu.set_item_text(0, 'Copy "' + get_item_path(item) + '"')
|
||||
%RightClickMenu.set_meta("item", item)
|
||||
%RightClickMenu.size = Vector2()
|
||||
|
||||
|
||||
func _on_right_click_menu_id_pressed(id: int) -> void:
|
||||
if %RightClickMenu.get_meta("item", null) == null:
|
||||
return
|
||||
match id:
|
||||
0:
|
||||
DisplayServer.clipboard_set(get_item_path(%RightClickMenu.get_meta("item")))
|
||||
@@ -0,0 +1 @@
|
||||
uid://c88wa435f7ak0
|
||||
@@ -0,0 +1,58 @@
|
||||
@tool
|
||||
extends DialogicEditor
|
||||
|
||||
## Editor that allows
|
||||
|
||||
#region EDITOR STUFF
|
||||
|
||||
func _get_title() -> String:
|
||||
return "Variables"
|
||||
|
||||
|
||||
func _get_icon() -> Texture:
|
||||
return load(self.get_script().get_path().get_base_dir().get_base_dir() + "/variable.svg")
|
||||
|
||||
|
||||
func _register() -> void:
|
||||
editors_manager.register_simple_editor(self)
|
||||
alternative_text = "Create and edit dialogic variables and their default values"
|
||||
|
||||
|
||||
func _open(argument:Variant = null):
|
||||
%ReferenceInfo.hide()
|
||||
%Tree.load_info(ProjectSettings.get_setting('dialogic/variables', {}))
|
||||
|
||||
|
||||
func _save() -> void:
|
||||
ProjectSettings.set_setting('dialogic/variables', %Tree.get_info())
|
||||
ProjectSettings.save()
|
||||
|
||||
|
||||
func _close() -> void:
|
||||
_save()
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
func _ready() -> void:
|
||||
%ReferenceInfo.get_node('Label').add_theme_color_override('font_color', get_theme_color("warning_color", "Editor"))
|
||||
%Search.right_icon = get_theme_icon("Search", "EditorIcons")
|
||||
|
||||
#region RENAMING
|
||||
|
||||
func variable_renamed(old_name:String, new_name:String):
|
||||
if old_name == new_name:
|
||||
return
|
||||
editors_manager.reference_manager.add_variable_ref_change(old_name, new_name)
|
||||
%ReferenceInfo.show()
|
||||
|
||||
|
||||
func _on_reference_manager_pressed() -> void:
|
||||
editors_manager.reference_manager.open()
|
||||
%ReferenceInfo.hide()
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
func _on_search_text_changed(new_text: String) -> void:
|
||||
%Tree.filter(new_text)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dtucy3td5s643
|
||||
@@ -0,0 +1,197 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://6tdle4y5o03o"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Modules/Variable/variables_editor/variables_editor.gd" id="2"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Modules/Variable/variables_editor/variable_tree.gd" id="2_1i17i"]
|
||||
|
||||
[sub_resource type="Image" id="Image_e1dkh"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
|
||||
"format": "RGBA8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_sr7s6"]
|
||||
image = SubResource("Image_e1dkh")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7aodm"]
|
||||
content_margin_left = 2.0
|
||||
content_margin_top = 0.0
|
||||
content_margin_right = 2.0
|
||||
content_margin_bottom = 0.0
|
||||
bg_color = Color(0.44, 0.73, 0.98, 0.1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.44, 0.73, 0.98, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 3
|
||||
anti_aliasing = false
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vn21i"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ffuxp"]
|
||||
content_margin_bottom = 0.0
|
||||
bg_color = Color(0.44, 0.73, 0.98, 0.1)
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.44, 0.73, 0.98, 1)
|
||||
expand_margin_left = 4.0
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_right = 4.0
|
||||
expand_margin_bottom = 4.0
|
||||
anti_aliasing = false
|
||||
|
||||
[sub_resource type="Theme" id="Theme_17j6i"]
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_7aodm")
|
||||
Button/styles/normal = SubResource("StyleBoxEmpty_vn21i")
|
||||
Button/styles/pressed = SubResource("StyleBoxFlat_7aodm")
|
||||
pressed/styles/Button = SubResource("StyleBoxFlat_ffuxp")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ncgqs"]
|
||||
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
|
||||
|
||||
[node name="VariablesEditor" type="HSplitContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Editor" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="Editor"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" type="Label" parent="Editor/HBox"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"DialogicSubTitle"
|
||||
text = "Variables"
|
||||
|
||||
[node name="Search" type="LineEdit" parent="Editor/HBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Search"
|
||||
right_icon = SubResource("ImageTexture_sr7s6")
|
||||
|
||||
[node name="Tree" type="Tree" parent="Editor"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_type_variation = &"DialogicPanelB"
|
||||
theme_override_constants/button_margin = 4
|
||||
theme_override_constants/draw_guides = 1
|
||||
columns = 3
|
||||
column_titles_visible = true
|
||||
script = ExtResource("2_1i17i")
|
||||
|
||||
[node name="ChangeTypePopup" type="PanelContainer" parent="Editor/Tree"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 140.0
|
||||
offset_top = 160.0
|
||||
offset_right = 272.0
|
||||
offset_bottom = 190.0
|
||||
theme = SubResource("Theme_17j6i")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ncgqs")
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="Editor/Tree/ChangeTypePopup"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="String" type="Button" parent="Editor/Tree/ChangeTypePopup/HBox"]
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
tooltip_text = "String (Any text)"
|
||||
toggle_mode = true
|
||||
icon = SubResource("ImageTexture_sr7s6")
|
||||
icon_alignment = 1
|
||||
|
||||
[node name="Float" type="Button" parent="Editor/Tree/ChangeTypePopup/HBox"]
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
tooltip_text = "Float (Number with Decimals)"
|
||||
toggle_mode = true
|
||||
icon = SubResource("ImageTexture_sr7s6")
|
||||
icon_alignment = 1
|
||||
|
||||
[node name="Int" type="Button" parent="Editor/Tree/ChangeTypePopup/HBox"]
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
tooltip_text = "Int (Integer)"
|
||||
toggle_mode = true
|
||||
icon = SubResource("ImageTexture_sr7s6")
|
||||
icon_alignment = 1
|
||||
|
||||
[node name="Bool" type="Button" parent="Editor/Tree/ChangeTypePopup/HBox"]
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
tooltip_text = "Bool (True/False flag)"
|
||||
toggle_mode = true
|
||||
icon = SubResource("ImageTexture_sr7s6")
|
||||
icon_alignment = 1
|
||||
|
||||
[node name="RightClickMenu" type="PopupMenu" parent="Editor/Tree"]
|
||||
unique_name_in_owner = true
|
||||
size = Vector2i(67, 35)
|
||||
item_count = 1
|
||||
item_0/text = "Copy"
|
||||
item_0/id = 0
|
||||
|
||||
[node name="ReferenceInfo" type="HBoxContainer" parent="Editor"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Editor/ReferenceInfo"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "You've made some changes to existing variables! Use the reference manager to check if something broke."
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="ReferenceManager" type="Button" parent="Editor/ReferenceInfo"]
|
||||
layout_mode = 2
|
||||
text = "Reference Manager"
|
||||
|
||||
[node name="Info" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="Info"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" type="Label" parent="Info/HBox"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_type_variation = &"DialogicSection"
|
||||
text = "How to use variables"
|
||||
|
||||
[node name="Documentation" type="LinkButton" parent="Info/HBox"]
|
||||
layout_mode = 2
|
||||
text = "Read the Docs"
|
||||
uri = "https://docs.dialogic.pro/variables.html"
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="Info"]
|
||||
layout_mode = 2
|
||||
text = "Variables are good way to keep track of all kinds of things during your game. Dialogic has an easy-to-use and beginner friendly variable system built in. However Dialogic allows to use outside variables (of Autoload Singletons) just as easily. You can also access the Dialogic variables from outside scripts."
|
||||
fit_content = true
|
||||
|
||||
[connection signal="text_changed" from="Editor/HBox/Search" to="." method="_on_search_text_changed"]
|
||||
[connection signal="button_clicked" from="Editor/Tree" to="Editor/Tree" method="_on_button_clicked"]
|
||||
[connection signal="gui_input" from="Editor/Tree" to="Editor/Tree" method="_on_gui_input"]
|
||||
[connection signal="item_edited" from="Editor/Tree" to="Editor/Tree" method="_on_item_edited"]
|
||||
[connection signal="id_pressed" from="Editor/Tree/RightClickMenu" to="Editor/Tree" method="_on_right_click_menu_id_pressed"]
|
||||
[connection signal="pressed" from="Editor/ReferenceInfo/ReferenceManager" to="." method="_on_reference_manager_pressed"]
|
||||
Reference in New Issue
Block a user