Uploaded game files

This commit is contained in:
JamnedZ 2022-11-18 00:52:05 +07:00
parent 459da513f6
commit f71e7e39a0
1543 changed files with 50503 additions and 0 deletions

View file

@ -0,0 +1,29 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/EventPart_CharacterAction.gd" type="Script" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/CharacterAndPortraitPicker.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/PositionPicker.tscn" type="PackedScene" id=4]
[node name="CharacterAction" type="HBoxContainer"]
margin_right = 454.0
margin_bottom = 30.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ActionTypePicker" parent="." instance=ExtResource( 1 )]
margin_top = 4.0
margin_bottom = 26.0
[node name="CharacterAndPortraitPicker" parent="." instance=ExtResource( 3 )]
margin_left = 98.0
margin_right = 193.0
margin_bottom = 30.0
size_flags_vertical = 4
[node name="PositionPicker" parent="." instance=ExtResource( 4 )]
margin_left = 197.0
margin_right = 471.0
size_flags_vertical = 4

View file

@ -0,0 +1,143 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/EventPart_CharacterActionSettings.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" 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/styles/InputFieldsStyle.tres" type="Theme" id=4]
[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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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="CharacterActionSettings" type="VBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
theme = ExtResource( 4 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Animation" type="HBoxContainer" parent="."]
margin_right = 589.0
margin_bottom = 24.0
[node name="Label" parent="Animation" instance=ExtResource( 2 )]
margin_top = 5.0
margin_right = 70.0
margin_bottom = 19.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Animation:"
[node name="AnimationPicker" parent="Animation" instance=ExtResource( 3 )]
margin_left = 74.0
margin_right = 172.0
margin_bottom = 24.0
[node name="Label2" parent="Animation" instance=ExtResource( 2 )]
margin_left = 176.0
margin_top = 5.0
margin_right = 223.0
margin_bottom = 19.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Length:"
[node name="AnimationLength" type="SpinBox" parent="Animation"]
margin_left = 227.0
margin_right = 303.0
margin_bottom = 24.0
step = 0.001
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label3" parent="Animation" instance=ExtResource( 2 )]
margin_left = 307.0
margin_top = 5.0
margin_right = 355.0
margin_bottom = 19.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Repeat:"
[node name="Repeat" type="SpinBox" parent="Animation"]
margin_left = 359.0
margin_right = 435.0
margin_bottom = 24.0
min_value = 1.0
value = 1.0
rounded = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label4" parent="Animation" instance=ExtResource( 2 )]
margin_left = 439.0
margin_top = 5.0
margin_right = 561.0
margin_bottom = 19.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Wait for animation:"
[node name="WaitForAnimation" type="CheckBox" parent="Animation"]
margin_left = 565.0
margin_right = 589.0
margin_bottom = 24.0
[node name="Positioning" type="HBoxContainer" parent="."]
margin_top = 28.0
margin_right = 589.0
margin_bottom = 52.0
[node name="Label" parent="Positioning" instance=ExtResource( 2 )]
margin_top = 5.0
margin_right = 52.0
margin_bottom = 19.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Z-index:"
[node name="EnableZIndex" type="ToolButton" parent="Positioning"]
margin_left = 56.0
margin_right = 84.0
margin_bottom = 24.0
toggle_mode = true
icon = SubResource( 2 )
[node name="Z_Index" type="SpinBox" parent="Positioning"]
margin_left = 88.0
margin_right = 164.0
margin_bottom = 24.0
min_value = -100.0
rounded = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label2" parent="Positioning" instance=ExtResource( 2 )]
margin_left = 168.0
margin_top = 5.0
margin_right = 227.0
margin_bottom = 19.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Mirrored:"
[node name="EnableMirrored" type="ToolButton" parent="Positioning"]
margin_left = 231.0
margin_right = 243.0
margin_bottom = 24.0
toggle_mode = true
[node name="Mirrored" type="CheckBox" parent="Positioning"]
margin_left = 247.0
margin_right = 271.0
margin_bottom = 24.0

View file

@ -0,0 +1,75 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/EventPart_CharacterJoining.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/PositionPicker.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/CharacterAndPortraitPicker.tscn" type="PackedScene" 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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="CharacterJoining" type="VBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
size_flags_vertical = 4
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBox" type="HBoxContainer" parent="."]
margin_right = 389.0
margin_bottom = 30.0
[node name="CharacterAndPortraitPicker" parent="HBox" instance=ExtResource( 3 )]
margin_right = 95.0
margin_bottom = 30.0
[node name="PositionPicker" parent="HBox" instance=ExtResource( 2 )]
margin_left = 99.0
margin_right = 357.0
size_flags_vertical = 4
[node name="MirrorButton" type="ToolButton" parent="HBox"]
margin_left = 361.0
margin_right = 389.0
margin_bottom = 30.0
hint_tooltip = "Mirrors the character"
toggle_mode = true
icon = SubResource( 2 )
[node name="NoCharacterContainer" type="HBoxContainer" parent="."]
visible = false
margin_top = 4.0
margin_right = 399.0
margin_bottom = 24.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."

View file

@ -0,0 +1,84 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
## has an event_data variable that stores the current data!!!
var join_icon = load("res://addons/dialogic/Images/Event Icons/character-join.svg")
var leave_icon = load("res://addons/dialogic/Images/Event Icons/character-leave.svg")
var update_icon = load("res://addons/dialogic/Images/Event Icons/character.svg")
## node references
onready var action_picker = $ActionTypePicker
onready var character_portrait_picker = $CharacterAndPortraitPicker
onready var position_picker = $PositionPicker
# used to connect the signals
func _ready():
action_picker.connect("about_to_show", self, "_on_ActionTypePicker_about_to_show")
action_picker.get_popup().connect('index_pressed', self, "_on_ActionTypePicker_index_pressed")
character_portrait_picker.connect('data_changed', self, "_on_CharacterAndPortraitPicker_data_changed")
position_picker.connect('data_changed', self, "_on_PositionPicker_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.
match int(data.get('type', 0)):
0:
action_picker.text = 'Join'
action_picker.custom_icon = join_icon
1:
action_picker.text = 'Leave'
action_picker.custom_icon = leave_icon
2:
action_picker.text = 'Update'
action_picker.custom_icon = update_icon
position_picker.visible = data.get('type',0) != 1 and data.get('character', '') != ''
position_picker.load_data(data)
character_portrait_picker.load_data(data)
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func _on_ActionTypePicker_about_to_show():
action_picker.get_popup().clear()
action_picker.get_popup().add_icon_item(join_icon, "Join")
action_picker.get_popup().add_icon_item(leave_icon, "Leave")
action_picker.get_popup().add_icon_item(update_icon, "Update")
func _on_ActionTypePicker_index_pressed(index):
if index != event_data['type']:
if index == 0:
event_data['portrait'] = 'Default'
event_data['animation'] = '[Default]'
elif index == 1:
event_data['animation'] = '[Default]'
elif index == 2:
event_data['portrait'] = "(Don't change)"
event_data['type'] = index
load_data(event_data)
# informs the parent about the changes!
data_changed()
func _on_CharacterAndPortraitPicker_data_changed(data):
event_data = data
load_data(event_data)
data_changed()
func _on_PositionPicker_data_changed(data):
event_data = data
data_changed()

View file

@ -0,0 +1,163 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
var enable_icon = null
var disable_icon = null
## node references
onready var animation_picker = $Animation/AnimationPicker
onready var animation_length = $Animation/AnimationLength
onready var z_index_enable = $Positioning/EnableZIndex
onready var z_index = $Positioning/Z_Index
onready var mirrored_checkbox = $Positioning/Mirrored
onready var mirrored_checkbox_enable = $Positioning/EnableMirrored
onready var animation_repeat = $Animation/Repeat
onready var animation_wait_checkbox = $Animation/WaitForAnimation
# used to connect the signals
func _ready():
animation_picker.connect("about_to_show", self, "_on_AnimationPicker_about_to_show")
animation_picker.get_popup().connect("index_pressed", self, "_on_AnimationPicker_index_pressed")
animation_length.connect("value_changed", self, "_on_AnimationLength_value_changed")
z_index.connect("value_changed", self, "_on_ZIndex_value_changed")
z_index_enable.connect("toggled", self, "_on_ZIndexEnable_toggled")
mirrored_checkbox.connect('toggled', self, "_on_Mirrored_toggled")
mirrored_checkbox_enable.connect('toggled', self, "_on_MirroredEnabled_toggled")
animation_repeat.connect("value_changed", self, '_on_Repeat_value_changed')
animation_wait_checkbox.connect('toggled', self, 'on_WaitForAnimation_toggled')
enable_icon = get_icon("Edit", "EditorIcons")
disable_icon = get_icon("Reload", "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.
$Positioning.visible = event_data.get('type',0) != 1
if data['type'] == 0:
animation_picker.text = DialogicUtil.beautify_filename(event_data.get('animation', '[Default]'))
elif data['type'] == 1:
animation_picker.text = DialogicUtil.beautify_filename(event_data.get('animation', '[Default]'))
else:
animation_picker.text = DialogicUtil.beautify_filename(event_data.get('animation', '[No Animation]'))
animation_picker.custom_icon = get_icon("Animation", "EditorIcons") if event_data['animation'] != "[No Animation]" else get_icon("GuiRadioUnchecked", "EditorIcons")
if event_data['animation'] == "[Default]": animation_picker.custom_icon = get_icon("Favorites", "EditorIcons")
animation_length.value = event_data.get('animation_length', 1)
animation_length.visible = event_data.get('animation', '') != "[Default]"
$Animation/Label2.visible = event_data.get('animation', '') != "[Default]"
animation_repeat.value = event_data.get('animation_repeat', 1)
animation_repeat.visible = int(data.get('type', 0)) == 2
$Animation/Label3.visible = int(data.get('type', 0)) == 2
animation_wait_checkbox.pressed = event_data.get('animation_wait', false)
z_index.value = int(event_data.get('z_index', 0))
mirrored_checkbox.pressed = event_data.get('mirror_portrait', false)
# if the event is in UPDATE mode show the enablers
z_index_enable.visible = int(data.get('type', 0)) == 2
mirrored_checkbox_enable.visible = int(data.get('type', 0)) == 2
z_index_enable.pressed = data.get('change_z_index', false) or int(data.get('type', 0)) != 2
mirrored_checkbox_enable.pressed = data.get('change_mirror_portrait', false) or int(data.get('type', 0)) != 2
z_index.visible = z_index_enable.pressed
mirrored_checkbox.visible = mirrored_checkbox_enable.pressed
z_index_enable.icon = enable_icon if not z_index_enable.pressed else disable_icon
mirrored_checkbox_enable.icon = enable_icon if not mirrored_checkbox_enable.pressed else disable_icon
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func _on_AnimationPicker_about_to_show():
animation_picker.get_popup().clear()
var animations = DialogicAnimaResources.get_available_animations()
var idx = 0
if event_data['type'] == 2:
animation_picker.get_popup().add_icon_item(get_icon("GuiRadioUnchecked", "EditorIcons"), "[No Animation]")
animation_picker.get_popup().set_item_metadata(idx, {'file': "[No Animation]"})
idx += 1
else:
animation_picker.get_popup().add_icon_item(get_icon("Favorites", "EditorIcons"), "[Default]")
animation_picker.get_popup().set_item_metadata(idx, {'file': "[Default]"})
idx += 1
for animation_name in animations:
if (event_data['type'] == 0 and '_in' in animation_name) \
or (event_data['type'] == 1 and '_out' in animation_name) \
or (event_data['type'] == 2 and not '_in' in animation_name and not '_out' in animation_name):
animation_picker.get_popup().add_icon_item(get_icon("Animation", "EditorIcons"), DialogicUtil.beautify_filename(animation_name))
animation_picker.get_popup().set_item_metadata(idx, {'file': animation_name.get_file()})
idx +=1
func _on_AnimationPicker_index_pressed(index):
event_data['animation'] = animation_picker.get_popup().get_item_metadata(index)['file']
animation_picker.custom_icon = get_icon("Animation", "EditorIcons") if event_data['animation'] != "[No Animation]" else get_icon("GuiRadioUnchecked", "EditorIcons")
if event_data['animation'] == "[Default]": animation_picker.custom_icon = get_icon("Favorites", "EditorIcons")
animation_picker.text = animation_picker.get_popup().get_item_text(index)
animation_length.visible = event_data.get('animation', '') != "[Default]"
$Animation/Label2.visible = event_data.get('animation', '') != "[Default]"
# informs the parent about the changes!
data_changed()
func _on_AnimationLength_value_changed(value):
event_data['animation_length'] = value
# informs the parent about the changes!
data_changed()
func _on_Repeat_value_changed(value):
event_data['animation_repeat'] = value
# informs the parent about the changes!
data_changed()
func on_WaitForAnimation_toggled(toggled):
event_data['animation_wait'] = toggled
# informs the parent about the changes!
data_changed()
func _on_ZIndexEnable_toggled(toggled):
if event_data['type'] != 2: return
event_data['change_z_index'] = toggled
z_index.visible = z_index_enable.pressed
z_index_enable.icon = enable_icon if not z_index_enable.pressed else disable_icon
# informs the parent about the changes!
data_changed()
func _on_ZIndex_value_changed(value):
event_data['z_index'] = value
# informs the parent about the changes!
data_changed()
func _on_MirroredEnabled_toggled(toggled):
if event_data['type'] != 2: return
event_data['change_mirror_portrait'] = toggled
mirrored_checkbox.visible = mirrored_checkbox_enable.pressed
mirrored_checkbox_enable.icon = enable_icon if not mirrored_checkbox_enable.pressed else disable_icon
# informs the parent about the changes!
data_changed()
func _on_Mirrored_toggled(toggled):
event_data['mirror_portrait'] = toggled
# informs the parent about the changes!
data_changed()

View file

@ -0,0 +1,71 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
## node references
onready var character_portrait_picker = $HBox/CharacterAndPortraitPicker
onready var position_picker = $HBox/PositionPicker
onready var mirror_button = $HBox/MirrorButton
onready var no_character_button = $NoCharacterContainer/NoCharacterButton
onready var no_character_container = $NoCharacterContainer
# used to connect the signals
func _ready():
if DialogicUtil.get_character_list().size() > 0:
character_portrait_picker.show()
position_picker.show()
mirror_button.show()
no_character_container.hide()
else:
character_portrait_picker.hide()
position_picker.hide()
mirror_button.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')
mirror_button.connect("toggled", self, "_on_MirrorButton_toggled")
character_portrait_picker.connect('data_changed', self, '_on_CharacterPortraitPicker_data_changed')
position_picker.connect('data_changed', self, '_on_PositionPicker_data_changed')
# icons
mirror_button.icon = get_icon("MirrorX", "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.
character_portrait_picker.load_data(data)
position_picker.load_data(data)
mirror_button.pressed = data['mirror']
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func _on_MirrorButton_toggled(toggle):
event_data['mirror'] = toggle
character_portrait_picker.load_data(event_data)
position_picker.load_data(event_data)
# informs the parent about the changes!
data_changed()
func _on_PositionPicker_data_changed(data):
event_data = data
character_portrait_picker.load_data(event_data)
# informs the parent about the changes!
data_changed()
func _on_CharacterPortraitPicker_data_changed(data):
event_data = data
# informs the parent about the changes!
data_changed()

View file

@ -0,0 +1,94 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
var default_icon_color = Color("#65989898")
var enable_icon
var disable_icon
## node references
onready var positions_container = $HBox/PositionsContainer
onready var enable_position = $HBox/EnablePosition
# used to connect the signals
func _ready():
for p in positions_container.get_children():
p.connect('pressed', self, "position_button_pressed", [p.name])
enable_position.connect('toggled', self, 'on_EnablePosition_toggled')
enable_icon = get_icon("Edit", "EditorIcons")
disable_icon = get_icon("Reload", "EditorIcons")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
if data.get('type', 0) == 0:
$HBox/Label.text = 'at position'
elif data.get('type', 0) == 2:
if not data.get('change_position', false):
$HBox/Label.text = '(same position)'
else:
$HBox/Label.text = 'to position'
enable_position.pressed = data.get('change_position', false) or data.get('type', 0) != 2
enable_position.visible = data.get('type', 0) == 2
enable_position.icon = enable_icon if not enable_position.pressed else disable_icon
positions_container.visible = enable_position.pressed
# Now update the ui nodes to display the data.
check_active_position()
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func get_character_color():
for ch in DialogicUtil.get_character_list():
if ch['file'] == event_data['character']:
return ch['color']
return default_icon_color
func position_button_pressed(name):
clear_all_positions()
var selected_index = name.split('-')[1]
var button = positions_container.get_node('position-' + selected_index)
button.set('self_modulate', get_character_color())
button.pressed = true
event_data['position'][selected_index] = true
data_changed()
func clear_all_positions():
if not event_data.get('position', false):
event_data['position'] = {}
for i in range(5):
event_data['position'][str(i)] = false
for p in positions_container.get_children():
p.set('self_modulate', default_icon_color)
p.pressed = false
func check_active_position(active_color = Color("#ffffff")):
if not event_data.get('position', false): return
var index = 0
for p in positions_container.get_children():
if event_data['position'][str(index)]:
p.pressed = true
p.set('self_modulate', get_character_color())
index += 1
func on_EnablePosition_toggled(toggled):
if event_data['type'] != 2: return
event_data['change_position'] = toggled
positions_container.visible = enable_position.pressed
enable_position.icon = enable_icon if not enable_position.pressed else disable_icon
if !toggled:
$HBox/Label.text = '(same position)'
else:
$HBox/Label.text = 'to position'
# informs the parent about the changes!
data_changed()

View file

@ -0,0 +1,72 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/EventPart_PositionPicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Images/Event Icons/character.svg" type="Texture" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
[node name="PositionPicker" type="VBoxContainer"]
margin_right = 186.0
margin_bottom = 30.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBox" type="HBoxContainer" parent="."]
margin_right = 274.0
margin_bottom = 30.0
[node name="Label" parent="HBox" instance=ExtResource( 3 )]
margin_top = 8.0
margin_right = 68.0
margin_bottom = 22.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "at position"
[node name="PositionsContainer" type="HBoxContainer" parent="HBox"]
margin_left = 72.0
margin_right = 258.0
margin_bottom = 30.0
[node name="position-0" type="ToolButton" parent="HBox/PositionsContainer"]
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
margin_right = 34.0
margin_bottom = 30.0
icon = ExtResource( 2 )
[node name="position-1" type="ToolButton" parent="HBox/PositionsContainer"]
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
margin_left = 38.0
margin_right = 72.0
margin_bottom = 30.0
icon = ExtResource( 2 )
[node name="position-2" type="ToolButton" parent="HBox/PositionsContainer"]
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
margin_left = 76.0
margin_right = 110.0
margin_bottom = 30.0
icon = ExtResource( 2 )
[node name="position-3" type="ToolButton" parent="HBox/PositionsContainer"]
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
margin_left = 114.0
margin_right = 148.0
margin_bottom = 30.0
icon = ExtResource( 2 )
[node name="position-4" type="ToolButton" parent="HBox/PositionsContainer"]
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
margin_left = 152.0
margin_right = 186.0
margin_bottom = 30.0
icon = ExtResource( 2 )
[node name="EnablePosition" type="ToolButton" parent="HBox"]
margin_left = 262.0
margin_right = 274.0
margin_bottom = 30.0
toggle_mode = true
__meta__ = {
"_edit_use_anchors_": false
}