Skip to content

Commit e94ff82

Browse files
Improving Event Buttons (#554)
* Fixed Dependecies I moved some scenes in the last minute. Stupid me. I hope it is fixed now. * Revert "Fixed Dependecies" This reverts commit 9e7bcd8. * Auto stash before merge of "main" and "upstream/main" * Update Changelog To contain the changes I made during the last week. * Revert "Auto stash before merge of "main" and "upstream/main"" This reverts commit 8e1699d. * Add the new styles to the remaining pickers TimelinePicker, ThemePicker, OperationPicker, GlossaryPicker. It also removes the [] around the items, except for the operation picker. I wasn't sure if it wouldn't make readability harder having three similar buttons next to each other, so I kept the [] there. And it adds a "Bus:" label to the AudioPicker, because I thought it would make it cleaner. * Cleanup and Simplification of the MasterTree.gd * Auto stash before merge of "main" and "upstream/main" * Remove more Engine.get_singleton()'s :( * Make the DocsTreeHelper ignore the mouse It was blocking a small part of the MasterTree. This should fix #414 * VoiceSupport Feature Fix: Make sure no default bus is needed There was a little annyoing warning popping up a lot. * Small Documentation fix * Add event documentation Adds a basic documentation of - Leave Event - Question Event - Choice Event - End Event - Condition Event - Set Value Event * Add the new documentations to the events You now have these little buttons on the right of the events that instantly lead to the documentation. * Check for complete dialogic_state information in start_from_save Apparently you can manage to save dialog_data that is empty. Maybe it has to do with the Autosave on timeline end? Need to investigate this. But this thing adds a check if the data is valid. * Changing the start_from_save function once again You now need to have "/" if you want to use the currently loaded state (mostly after importing). Lot's of more checks added. * Try to improve the Event Buttons * Fixing stupid merge mistake * Making the icon resize as well * Updating the icons style Co-authored-by: Emilio Coppola <[email protected]>
1 parent 70e32fb commit e94ff82

File tree

6 files changed

+166
-164
lines changed

6 files changed

+166
-164
lines changed
Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,51 @@
1-
[gd_scene load_steps=9 format=2]
1+
[gd_scene load_steps=6 format=2]
22

3-
[ext_resource path="res://addons/dialogic/Images/Event Icons/Main Icons/set-theme.svg" type="Texture" id=1]
43
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SetGlossary.tres" type="StyleBox" id=2]
54
[ext_resource path="res://addons/dialogic/Editor/Events/Templates/EventTemplate.tscn" type="PackedScene" id=3]
65
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/SetGlossary.tscn" type="PackedScene" id=4]
76
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/GlossaryPicker.tscn" type="PackedScene" id=5]
87
[ext_resource path="res://addons/dialogic/Images/Event Icons/Main Icons/set-glossary.svg" type="Texture" id=6]
98

10-
[sub_resource type="Image" id=3]
11-
data = {
12-
"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 ),
13-
"format": "LumAlpha8",
14-
"height": 16,
15-
"mipmaps": false,
16-
"width": 16
17-
}
18-
19-
[sub_resource type="ImageTexture" id=2]
20-
flags = 4
21-
flags = 4
22-
image = SubResource( 3 )
23-
size = Vector2( 16, 16 )
24-
259
[node name="SetGlossary" instance=ExtResource( 3 )]
10+
event_name = "Set Glossary"
2611
event_data = {
2712
"event_id": "dialogic_025",
2813
"extra": "",
2914
"glossary_id": "",
3015
"text": "",
3116
"title": ""
3217
}
33-
event_style = ExtResource( 2 )
3418
event_icon = ExtResource( 6 )
35-
event_name = "Set Glossary"
19+
event_style = ExtResource( 2 )
3620
header_scene = ExtResource( 5 )
3721
body_scene = ExtResource( 4 )
3822
expand_on_default = false
3923

4024
[node name="PanelContainer" parent="." index="1"]
4125
custom_styles/panel = ExtResource( 2 )
4226

43-
[node name="Warning" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="0"]
44-
icon = SubResource( 2 )
27+
[node name="SelectedStyle" parent="PanelContainer" index="0"]
28+
modulate = Color( 0, 0, 0, 1 )
4529

46-
[node name="IconTexture" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="0"]
30+
[node name="IconTexture" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="1"]
4731
margin_right = 32.0
48-
texture = ExtResource( 1 )
32+
texture = ExtResource( 6 )
4933

50-
[node name="TitleLabel" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="0"]
51-
margin_right = 84.0
34+
[node name="TitleLabel" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="2"]
35+
margin_left = 42.0
36+
margin_right = 121.0
5237
text = "Set Glossary"
5338

5439
[node name="Content" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="3"]
55-
margin_left = 150.0
56-
margin_right = 160.0
40+
margin_left = 131.0
41+
margin_right = 294.0
5742

5843
[node name="ExpandControl" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="4"]
59-
visible = true
6044
margin_left = 164.0
6145
margin_right = 216.0
6246

6347
[node name="Spacer" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="5"]
64-
margin_left = 220.0
48+
margin_left = 304.0
6549

6650
[node name="OptionsControl" parent="PanelContainer/MarginContainer/VBoxContainer/Header" index="7"]
6751
items = [ "Move Up", null, 0, false, false, 0, 0, null, "", false, "Move Down", null, 0, false, false, 1, 0, null, "", false, "", null, 0, false, false, 2, 0, null, "", false, "Remove", null, 0, false, false, 3, 0, null, "", false ]

addons/dialogic/Editor/Events/styles/SetGlossary.tres

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ content_margin_left = 0.0
55
content_margin_right = 0.0
66
content_margin_top = 0.0
77
content_margin_bottom = 0.0
8-
bg_color = Color( 0.101961, 0.360784, 0.431373, 0.403922 )
8+
bg_color = Color( 0.270588, 0.243137, 0.572549, 0.407843 )
99
border_width_left = 2
1010
border_width_top = 2
1111
border_width_right = 2

addons/dialogic/Editor/TimelineEditor/SmallEventButton.gd

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
tool
22
extends Button
33

4+
export(String) var visible_name = ""
45
export (String) var event_id = 'dialogic_099'
6+
export (Color) var event_color = Color('#48a2a2a2')
57
export(Texture) var event_icon = null setget set_icon
68

79

810
func _ready():
11+
$Panel.self_modulate = event_color
12+
self_modulate = Color(1,1,1)
13+
if visible_name != '':
14+
text = ' ' + visible_name
915
hint_tooltip = DTS.translate(hint_tooltip)
16+
var _scale = get_constant("inspector_margin", "Editor")
17+
_scale = _scale * 0.125
18+
rect_min_size = Vector2(30,30)
19+
rect_min_size = rect_min_size * _scale
1020

1121

1222
func set_icon(texture):
13-
$TextureRect.texture = texture
23+
icon = texture
1424
event_icon = texture
1525

1626

addons/dialogic/Editor/TimelineEditor/SmallEventButton.tscn

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,53 @@
22

33
[ext_resource path="res://addons/dialogic/Editor/TimelineEditor/SmallEventButton.gd" type="Script" id=1]
44

5-
[sub_resource type="StyleBoxFlat" id=2]
6-
bg_color = Color( 0.941176, 0.941176, 0.941176, 1 )
7-
border_width_left = 1
8-
border_width_top = 1
9-
border_width_right = 1
10-
border_width_bottom = 1
11-
border_color = Color( 0.0901961, 0.0901961, 0.0901961, 1 )
5+
[sub_resource type="StyleBoxFlat" id=1]
6+
bg_color = Color( 1, 1, 1, 1 )
7+
border_color = Color( 0.14902, 0.14902, 0.14902, 1 )
128
corner_radius_top_left = 4
139
corner_radius_top_right = 4
1410
corner_radius_bottom_right = 4
1511
corner_radius_bottom_left = 4
16-
expand_margin_left = 2.0
17-
expand_margin_right = 2.0
18-
expand_margin_top = 2.0
19-
expand_margin_bottom = 2.0
2012

21-
[sub_resource type="StyleBoxFlat" id=1]
22-
bg_color = Color( 1, 1, 1, 1 )
13+
[sub_resource type="StyleBoxFlat" id=2]
14+
draw_center = false
2315
border_width_left = 1
2416
border_width_top = 1
2517
border_width_right = 1
2618
border_width_bottom = 1
27-
border_color = Color( 0.121569, 0.121569, 0.121569, 1 )
19+
border_color = Color( 0.0980392, 0.0980392, 0.0980392, 0.784314 )
2820
corner_radius_top_left = 4
2921
corner_radius_top_right = 4
3022
corner_radius_bottom_right = 4
3123
corner_radius_bottom_left = 4
32-
expand_margin_left = 2.0
33-
expand_margin_right = 2.0
34-
expand_margin_top = 2.0
35-
expand_margin_bottom = 2.0
3624

3725
[node name="SmallEventButton" type="Button"]
38-
margin_right = 12.0
39-
margin_bottom = 20.0
40-
rect_min_size = Vector2( 30, 30 )
41-
custom_styles/hover = SubResource( 2 )
42-
custom_styles/pressed = SubResource( 1 )
43-
custom_styles/normal = SubResource( 1 )
26+
margin_right = 30.0
27+
margin_bottom = 30.0
28+
flat = true
29+
align = 0
30+
expand_icon = true
4431
script = ExtResource( 1 )
4532
__meta__ = {
4633
"_edit_use_anchors_": false
4734
}
4835

49-
[node name="TextureRect" type="TextureRect" parent="."]
36+
[node name="Panel" type="Panel" parent="."]
37+
self_modulate = Color( 0.635294, 0.635294, 0.635294, 0.282353 )
38+
show_behind_parent = true
39+
anchor_right = 1.0
40+
anchor_bottom = 1.0
41+
mouse_filter = 2
42+
custom_styles/panel = SubResource( 1 )
43+
__meta__ = {
44+
"_edit_use_anchors_": false
45+
}
46+
47+
[node name="Border" type="Panel" parent="."]
5048
anchor_right = 1.0
5149
anchor_bottom = 1.0
52-
margin_left = 2.0
53-
margin_top = 2.0
54-
margin_right = -2.0
55-
margin_bottom = -2.0
56-
stretch_mode = 6
50+
mouse_filter = 2
51+
custom_styles/panel = SubResource( 2 )
5752
__meta__ = {
5853
"_edit_use_anchors_": false
5954
}

addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ func update_custom_events() -> void:
728728
var button = load('res://addons/dialogic/Editor/TimelineEditor/SmallEventButton.tscn').instance()
729729
#button.set_script(preload("EventButton.gd"))
730730
button.event_id = custom_event_id
731+
button.visible_name = custom_events[custom_event_id]['event_name']
731732
button.self_modulate = Color('#494d58')
732733
button.hint_tooltip = custom_events[custom_event_id]['event_name']
733734
if custom_events[custom_event_id]['event_icon']:

0 commit comments

Comments
 (0)