Skip to content

Commit

Permalink
Finish cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jowan-Spooner committed Jan 9, 2024
1 parent 4df7604 commit ff75d02
Show file tree
Hide file tree
Showing 67 changed files with 516 additions and 580 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://crke8suvv52c6"]

[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd" id="1_76vf2"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/Vector2.tscn" id="2_c8kyi"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.tscn" id="2_c8kyi"]

[node name="Layout" type="HFlowContainer"]
offset_right = 428.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://djq4aasoihexj"]

[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd" id="1_ht8lu"]
[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/FilePicker.tscn" id="2_k8xs0"]
[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/field_file.tscn" id="2_k8xs0"]

[sub_resource type="Image" id="Image_sbh6e"]
data = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://cmrgbo8qi145o"]

[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd" id="1_6sxsl"]
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="2_birla"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/Vector2.tscn" id="3_vcvin"]
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.tscn" id="2_birla"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.tscn" id="3_vcvin"]

[node name="Portraits" type="GridContainer"]
offset_right = 453.0
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Common/reference_manager.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ext_resource type="Script" path="res://addons/dialogic/Editor/Common/reference_manager.gd" id="1_3t531"]
[ext_resource type="Script" path="res://addons/dialogic/Editor/Common/broken_reference_manager.gd" id="1_agmg4"]
[ext_resource type="Script" path="res://addons/dialogic/Editor/Common/ReferenceManager_AddReplacementPanel.gd" id="2_tt4jd"]
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="3_yomsc"]
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.tscn" id="3_yomsc"]
[ext_resource type="Script" path="res://addons/dialogic/Editor/Common/unique_identifiers_manager.gd" id="5_wnvbq"]

[sub_resource type="ButtonGroup" id="ButtonGroup_l6uiy"]
Expand Down
111 changes: 26 additions & 85 deletions addons/dialogic/Editor/Events/EventBlock/event_block.gd
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,22 @@ func set_indent(indent: int) -> void:
################################################################################

var FIELD_SCENES := {
DialogicEvent.ValueType.MULTILINE_TEXT: "res://addons/dialogic/Editor/Events/Fields/field_multiline_text.tscn",
DialogicEvent.ValueType.SINGLELINE_TEXT: "res://addons/dialogic/Editor/Events/Fields/field_singleline_text.tscn",
DialogicEvent.ValueType.BOOL: "res://addons/dialogic/Editor/Events/Fields/Bool.tscn",
DialogicEvent.ValueType.BOOL_BUTTON: "res://addons/dialogic/Editor/Events/Fields/BoolButton.tscn",
DialogicEvent.ValueType.FILE: "res://addons/dialogic/Editor/Events/Fields/FilePicker.tscn",
DialogicEvent.ValueType.ARRAY: "res://addons/dialogic/Editor/Events/Fields/Array.tscn",
DialogicEvent.ValueType.COMPLEX_PICKER: "res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn",
DialogicEvent.ValueType.INTEGER: "res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn",
DialogicEvent.ValueType.FLOAT: "res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn",
DialogicEvent.ValueType.VECTOR2: "res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn",
DialogicEvent.ValueType.FIXED_OPTIONS : "res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn",
DialogicEvent.ValueType.CONDITION: "res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn",
DialogicEvent.ValueType.DECIBEL: "res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn",
DialogicEvent.ValueType.KEY_VALUE_PAIRS: "res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn",
DialogicEvent.ValueType.MULTILINE_TEXT: "res://addons/dialogic/Editor/Events/Fields/field_text_multiline.tscn",
DialogicEvent.ValueType.SINGLELINE_TEXT: "res://addons/dialogic/Editor/Events/Fields/field_text_singleline.tscn",
DialogicEvent.ValueType.FILE: "res://addons/dialogic/Editor/Events/Fields/field_file.tscn",
DialogicEvent.ValueType.BOOL: "res://addons/dialogic/Editor/Events/Fields/field_bool_check.tscn",
DialogicEvent.ValueType.BOOL_BUTTON: "res://addons/dialogic/Editor/Events/Fields/field_bool_button.tscn",
DialogicEvent.ValueType.CONDITION: "res://addons/dialogic/Editor/Events/Fields/field_condition.tscn",
DialogicEvent.ValueType.ARRAY: "res://addons/dialogic/Editor/Events/Fields/field_array.tscn",
DialogicEvent.ValueType.DICTIONARY: "res://addons/dialogic/Editor/Events/Fields/field_dictionary.tscn",
DialogicEvent.ValueType.DYNAMIC_OPTIONS: "res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.tscn",
DialogicEvent.ValueType.FIXED_OPTIONS : "res://addons/dialogic/Editor/Events/Fields/field_options_fixed.tscn",
DialogicEvent.ValueType.NUMBER: "res://addons/dialogic/Editor/Events/Fields/field_number.tscn",
DialogicEvent.ValueType.VECTOR2: "res://addons/dialogic/Editor/Events/Fields/field_vector2.tscn",
}

func build_editor(build_header:bool = true, build_body:bool = false) -> void:
var current_body_container: HFlowContainer = null

if build_body and body_was_build:
build_body = false

Expand Down Expand Up @@ -201,72 +198,14 @@ func build_editor(build_header:bool = true, build_body:bool = false) -> void:
elif p.field_type in FIELD_SCENES:
editor_node = load(FIELD_SCENES[p.field_type]).instantiate()


#elif p.dialogic_type == resource.ValueType.MULTILINE_TEXT:
#editor_node = load("res://addons/dialogic/Editor/Events/Fields/MultilineText.tscn").instantiate()
#elif p.dialogic_type == resource.ValueType.SINGLELINE_TEXT:
#editor_node = load("res://addons/dialogic/Editor/Events/Fields/SinglelineText.tscn").instantiate()

elif p.dialogic_type == resource.ValueType.BOOL:

#else:
#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()

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.COMPLEX_PICKER:
editor_node = load("res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn").instantiate()

editor_node.file_extension = p.display_info.get('file_extension', '')
editor_node.collapse_when_empty = p.display_info.get('collapse_when_empty', false)
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.FIXED_OPTIONS:
editor_node = load("res://addons/dialogic/Editor/Events/Fields/OptionSelector.tscn").instantiate()
editor_node.options = p.display_info.get('selector_options', [])
editor_node.disabled = p.display_info.get('disabled', false)
editor_node.symbol_only = p.display_info.get('symbol_only', false)

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.ARRAY:
editor_node = load("res://addons/dialogic/Editor/Events/Fields/Array.tscn").instantiate()

elif p.dialogic_type == resource.ValueType.KEY_VALUE_PAIRS:
editor_node = load("res://addons/dialogic/Editor/Events/Fields/KeyValuePairs.tscn").instantiate()

elif p.dialogic_type == resource.ValueType.LABEL:
elif p.field_type == resource.ValueType.LABEL:
editor_node = Label.new()
editor_node.text = p.display_info.text
editor_node.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
editor_node.set('custom_colors/font_color', Color("#7b7b7b"))
editor_node.add_theme_color_override('font_color', resource.event_color.lerp(get_theme_color("font_color", "Editor"), 0.8))
elif p.dialogic_type == resource.ValueType.BUTTON:

elif p.field_type == resource.ValueType.BUTTON:
editor_node = Button.new()
editor_node.text = p.display_info.text
if typeof(p.display_info.icon) == TYPE_ARRAY:
Expand All @@ -276,8 +215,9 @@ func build_editor(build_header:bool = true, build_body:bool = false) -> void:
editor_node.flat = true
editor_node.custom_minimum_size.x = 30*DialogicUtil.get_editor_scale()
editor_node.pressed.connect(p.display_info.callable)

## CUSTOM
elif p.dialogic_type == resource.ValueType.CUSTOM:
elif p.field_type == resource.ValueType.CUSTOM:
if p.display_info.has('path'):
editor_node = load(p.display_info.path).instantiate()

Expand All @@ -287,16 +227,10 @@ func build_editor(build_header:bool = true, build_body:bool = false) -> void:
editor_node.text = p.name
editor_node.add_theme_color_override('font_color', resource.event_color.lerp(get_theme_color("font_color", "Editor"), 0.8))

### --------------------------------------------------------------------
### 2. ADD IT TO THE RIGHT PLACE (HEADER/BODY)
var location: Control = %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
field_list[-1]['node'] = editor_node
### --------------------------------------------------------------------
# Some things need to be called BEFORE the field is added to the tree
if editor_node is DialogicVisualEditorField:
editor_node.event_resource = resource

Expand All @@ -305,6 +239,13 @@ func build_editor(build_header:bool = true, build_body:bool = false) -> void:

editor_node._load_display_info(p.display_info)

var location: Control = %HeaderContent
if p.location == 1:
location = current_body_container
location.add_child(editor_node)

# Some things need to be called AFTER the field is added to the tree
if editor_node is DialogicVisualEditorField:
editor_node._set_value(resource.get(p.name))

editor_node.value_changed.connect(set_property)
Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Editor/Events/EventBlock/event_block.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5

[sub_resource type="Image" id="Image_6a6lq"]
[sub_resource type="Image" id="Image_ng2y4"]
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",
Expand All @@ -21,7 +21,7 @@ data = {
}

[sub_resource type="ImageTexture" id="ImageTexture_rc1wh"]
image = SubResource("Image_6a6lq")
image = SubResource("Image_ng2y4")

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ee4ub"]

Expand Down
12 changes: 0 additions & 12 deletions addons/dialogic/Editor/Events/Fields/Array.tscn

This file was deleted.

Loading

0 comments on commit ff75d02

Please sign in to comment.