Skip to content

Commit 71d23a0

Browse files
committed
latest before implementing the act picker
1 parent 04a5fe3 commit 71d23a0

File tree

2 files changed

+84
-40
lines changed

2 files changed

+84
-40
lines changed

addons/dialogic/Editor/EditorView.tscn

Lines changed: 75 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=13 format=2]
1+
[gd_scene load_steps=14 format=2]
22

33
[ext_resource path="res://addons/dialogic/Editor/editor_view.gd" type="Script" id=1]
44
[ext_resource path="res://addons/dialogic/Images/dialog.svg" type="Texture" id=2]
@@ -10,6 +10,7 @@
1010
[ext_resource path="res://addons/dialogic/Images/audio-event.svg" type="Texture" id=8]
1111
[ext_resource path="res://addons/dialogic/Images/open-icon.svg" type="Texture" id=9]
1212
[ext_resource path="res://addons/dialogic/Images/closed-icon.svg" type="Texture" id=10]
13+
[ext_resource path="res://addons/dialogic/Images/portraits/df-1.png" type="Texture" id=11]
1314

1415
[sub_resource type="StyleBoxFlat" id=1]
1516
content_margin_left = 5.0
@@ -267,116 +268,159 @@ __meta__ = {
267268
"_edit_use_anchors_": false
268269
}
269270

270-
[node name="Container" type="VBoxContainer" parent="Editor/CharacterEditor"]
271+
[node name="HBoxContainer" type="HBoxContainer" parent="Editor/CharacterEditor"]
271272
margin_left = 5.0
272273
margin_top = 5.0
273274
margin_right = 800.0
274-
margin_bottom = 209.0
275+
margin_bottom = 536.0
276+
size_flags_horizontal = 3
277+
size_flags_vertical = 3
278+
279+
[node name="Container" type="VBoxContainer" parent="Editor/CharacterEditor/HBoxContainer"]
280+
margin_right = 395.0
281+
margin_bottom = 531.0
275282
grow_horizontal = 2
276283
grow_vertical = 2
277284
size_flags_horizontal = 3
278285
size_flags_vertical = 9
279286

280-
[node name="Name" type="HBoxContainer" parent="Editor/CharacterEditor/Container"]
281-
margin_right = 795.0
287+
[node name="Name" type="HBoxContainer" parent="Editor/CharacterEditor/HBoxContainer/Container"]
288+
margin_right = 395.0
282289
margin_bottom = 24.0
283290

284-
[node name="Label" type="Label" parent="Editor/CharacterEditor/Container/Name"]
291+
[node name="Label" type="Label" parent="Editor/CharacterEditor/HBoxContainer/Container/Name"]
285292
margin_top = 5.0
286293
margin_right = 130.0
287294
margin_bottom = 19.0
288295
rect_min_size = Vector2( 130, 0 )
289296
text = "Name: "
290297

291-
[node name="LineEdit" type="LineEdit" parent="Editor/CharacterEditor/Container/Name"]
298+
[node name="LineEdit" type="LineEdit" parent="Editor/CharacterEditor/HBoxContainer/Container/Name"]
292299
margin_left = 134.0
293300
margin_right = 274.0
294301
margin_bottom = 24.0
295302
rect_min_size = Vector2( 140, 0 )
296303

297-
[node name="Color" type="HBoxContainer" parent="Editor/CharacterEditor/Container"]
304+
[node name="Color" type="HBoxContainer" parent="Editor/CharacterEditor/HBoxContainer/Container"]
298305
margin_top = 28.0
299-
margin_right = 795.0
306+
margin_right = 395.0
300307
margin_bottom = 48.0
301308

302-
[node name="Label" type="Label" parent="Editor/CharacterEditor/Container/Color"]
309+
[node name="Label" type="Label" parent="Editor/CharacterEditor/HBoxContainer/Container/Color"]
303310
margin_top = 3.0
304311
margin_right = 130.0
305312
margin_bottom = 17.0
306313
rect_min_size = Vector2( 130, 0 )
307314
text = "Color: "
308315

309-
[node name="ColorPickerButton" type="ColorPickerButton" parent="Editor/CharacterEditor/Container/Color"]
316+
[node name="ColorPickerButton" type="ColorPickerButton" parent="Editor/CharacterEditor/HBoxContainer/Container/Color"]
310317
margin_left = 134.0
311318
margin_right = 194.0
312319
margin_bottom = 20.0
313320
rect_min_size = Vector2( 60, 0 )
314321
color = Color( 1, 1, 1, 1 )
315322
edit_alpha = false
316323

317-
[node name="Description" type="HBoxContainer" parent="Editor/CharacterEditor/Container"]
324+
[node name="Description" type="HBoxContainer" parent="Editor/CharacterEditor/HBoxContainer/Container"]
318325
margin_top = 52.0
319-
margin_right = 795.0
326+
margin_right = 395.0
320327
margin_bottom = 152.0
321328

322-
[node name="Label" type="Label" parent="Editor/CharacterEditor/Container/Description"]
329+
[node name="Label" type="Label" parent="Editor/CharacterEditor/HBoxContainer/Container/Description"]
323330
margin_top = 43.0
324331
margin_right = 130.0
325332
margin_bottom = 57.0
326333
rect_min_size = Vector2( 130, 0 )
327334
text = "Description: "
328335

329-
[node name="TextEdit" type="TextEdit" parent="Editor/CharacterEditor/Container/Description"]
336+
[node name="TextEdit" type="TextEdit" parent="Editor/CharacterEditor/HBoxContainer/Container/Description"]
330337
margin_left = 134.0
331-
margin_right = 795.0
338+
margin_right = 395.0
332339
margin_bottom = 100.0
333340
rect_min_size = Vector2( 100, 100 )
334341
size_flags_horizontal = 3
335342

336-
[node name="FileName" type="HBoxContainer" parent="Editor/CharacterEditor/Container"]
343+
[node name="FileName" type="HBoxContainer" parent="Editor/CharacterEditor/HBoxContainer/Container"]
337344
margin_top = 156.0
338-
margin_right = 795.0
345+
margin_right = 395.0
339346
margin_bottom = 180.0
340347

341-
[node name="Label" type="Label" parent="Editor/CharacterEditor/Container/FileName"]
348+
[node name="Label" type="Label" parent="Editor/CharacterEditor/HBoxContainer/Container/FileName"]
342349
margin_top = 5.0
343350
margin_right = 130.0
344351
margin_bottom = 19.0
345352
rect_min_size = Vector2( 130, 0 )
346353
text = "File:"
347354

348-
[node name="LineEdit" type="LineEdit" parent="Editor/CharacterEditor/Container/FileName"]
355+
[node name="LineEdit" type="LineEdit" parent="Editor/CharacterEditor/HBoxContainer/Container/FileName"]
349356
margin_left = 134.0
350-
margin_right = 795.0
357+
margin_right = 395.0
351358
margin_bottom = 24.0
352359
rect_min_size = Vector2( 140, 0 )
353360
focus_mode = 0
354361
size_flags_horizontal = 3
355362
editable = false
356363

357-
[node name="Actions" type="HBoxContainer" parent="Editor/CharacterEditor/Container"]
364+
[node name="Actions" type="HBoxContainer" parent="Editor/CharacterEditor/HBoxContainer/Container"]
358365
margin_top = 184.0
359-
margin_right = 795.0
366+
margin_right = 395.0
360367
margin_bottom = 204.0
361368

362-
[node name="SaveButton" type="Button" parent="Editor/CharacterEditor/Container/Actions"]
369+
[node name="SaveButton" type="Button" parent="Editor/CharacterEditor/HBoxContainer/Container/Actions"]
363370
margin_right = 60.0
364371
margin_bottom = 20.0
365372
rect_min_size = Vector2( 60, 0 )
366373
text = "Save"
367374

368-
[node name="Control" type="Control" parent="Editor/CharacterEditor/Container/Actions"]
375+
[node name="Control" type="Control" parent="Editor/CharacterEditor/HBoxContainer/Container/Actions"]
369376
margin_left = 64.0
370-
margin_right = 736.0
377+
margin_right = 336.0
371378
margin_bottom = 20.0
372379
size_flags_horizontal = 3
373380

374-
[node name="DeleteButton" type="Button" parent="Editor/CharacterEditor/Container/Actions"]
375-
margin_left = 740.0
376-
margin_right = 795.0
381+
[node name="DeleteButton" type="Button" parent="Editor/CharacterEditor/HBoxContainer/Container/Actions"]
382+
margin_left = 340.0
383+
margin_right = 395.0
377384
margin_bottom = 20.0
378385
text = "Delete"
379386

387+
[node name="VBoxContainer" type="VBoxContainer" parent="Editor/CharacterEditor/HBoxContainer"]
388+
margin_left = 399.0
389+
margin_right = 795.0
390+
margin_bottom = 531.0
391+
size_flags_horizontal = 3
392+
size_flags_vertical = 3
393+
394+
[node name="Control" type="Control" parent="Editor/CharacterEditor/HBoxContainer/VBoxContainer"]
395+
margin_right = 396.0
396+
margin_bottom = 507.0
397+
size_flags_horizontal = 3
398+
size_flags_vertical = 3
399+
400+
[node name="TextureRect" type="TextureRect" parent="Editor/CharacterEditor/HBoxContainer/VBoxContainer/Control"]
401+
anchor_left = 0.5
402+
anchor_top = 0.5
403+
anchor_right = 0.5
404+
anchor_bottom = 0.5
405+
margin_left = -94.5
406+
margin_top = -167.5
407+
margin_right = 94.5
408+
margin_bottom = 167.5
409+
size_flags_horizontal = 3
410+
size_flags_vertical = 3
411+
texture = ExtResource( 11 )
412+
expand = true
413+
stretch_mode = 5
414+
__meta__ = {
415+
"_edit_use_anchors_": false
416+
}
417+
418+
[node name="Button" type="Button" parent="Editor/CharacterEditor/HBoxContainer/VBoxContainer"]
419+
margin_top = 511.0
420+
margin_right = 396.0
421+
margin_bottom = 531.0
422+
text = "Select Portrait"
423+
380424
[node name="RemoveConfirmation" type="ConfirmationDialog" parent="."]
381425
margin_right = 325.0
382426
margin_bottom = 88.0
@@ -399,6 +443,6 @@ __meta__ = {
399443
[connection signal="pressed" from="Editor/EventTools/VBoxContainer/ButtonSave" to="." method="_on_ButtonSave_pressed"]
400444
[connection signal="pressed" from="Editor/CharacterTools/Button" to="." method="_on_Button_pressed"]
401445
[connection signal="item_selected" from="Editor/CharacterTools/CharacterList/ItemList" to="." method="_on_ItemList_item_selected"]
402-
[connection signal="pressed" from="Editor/CharacterEditor/Container/Actions/SaveButton" to="." method="_on_character_SaveButton_pressed"]
403-
[connection signal="pressed" from="Editor/CharacterEditor/Container/Actions/DeleteButton" to="." method="_on_DeleteButton_pressed"]
446+
[connection signal="pressed" from="Editor/CharacterEditor/HBoxContainer/Container/Actions/SaveButton" to="." method="_on_character_SaveButton_pressed"]
447+
[connection signal="pressed" from="Editor/CharacterEditor/HBoxContainer/Container/Actions/DeleteButton" to="." method="_on_DeleteButton_pressed"]
404448
[connection signal="confirmed" from="RemoveConfirmation" to="." method="_on_RemoveConfirmation_confirmed"]

addons/dialogic/Editor/editor_view.gd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ var CHAR_DIR = WORKING_DIR + "/characters"
1212
onready var Timeline = $Editor/EventEditor/TimeLine
1313
onready var CharacterList = $Editor/CharacterTools/CharacterList/ItemList
1414
onready var CharacterEditor = {
15-
'editor': $Editor/CharacterEditor/Container,
16-
'name': $Editor/CharacterEditor/Container/Name/LineEdit,
17-
'description': $Editor/CharacterEditor/Container/Description/TextEdit,
18-
'file': $Editor/CharacterEditor/Container/FileName/LineEdit,
19-
'color': $Editor/CharacterEditor/Container/Color/ColorPickerButton
15+
'editor': $Editor/CharacterEditor/HBoxContainer/Container,
16+
'name': $Editor/CharacterEditor/HBoxContainer/Container/Name/LineEdit,
17+
'description': $Editor/CharacterEditor/HBoxContainer/Container/Description/TextEdit,
18+
'file': $Editor/CharacterEditor/HBoxContainer/Container/FileName/LineEdit,
19+
'color': $Editor/CharacterEditor/HBoxContainer/Container/Color/ColorPickerButton
2020
}
2121

2222
func _ready():
@@ -29,7 +29,7 @@ func _ready():
2929
editor_file_dialog = EditorFileDialog.new()
3030
plugin_reference.get_editor_interface().get_editor_viewport().add_child(editor_file_dialog)
3131
$Editor.visible = true
32-
$Editor/CharacterEditor/Container.visible = false
32+
$Editor/CharacterEditor/HBoxContainer/Container.visible = false
3333
load_nodes("res://addons/dialogic/demo/example.json")
3434
refresh_character_list()
3535

@@ -170,7 +170,7 @@ func _on_Button_pressed():
170170
_on_ItemList_item_selected(i)
171171

172172
func create_character():
173-
var character_file = 'character-' + str(rand_range(1000,9999)) + '-' + str(OS.get_unix_time()) + '.json'
173+
var character_file = 'character-' + str(OS.get_unix_time()) + '.json'
174174
var character = {
175175
'color': 'ffffff',
176176
'id': character_file
@@ -213,7 +213,7 @@ func _on_ItemList_item_selected(index):
213213
var selected = CharacterList.get_item_text(index)
214214
var file = CharacterList.get_item_metadata(index)['file']
215215
var data = load_json(CHAR_DIR + '/' + file)
216-
$Editor/CharacterEditor/Container.visible = true
216+
$Editor/CharacterEditor/HBoxContainer/Container.visible = true
217217
load_character_editor(data)
218218

219219
func load_character_editor(data):
@@ -258,7 +258,7 @@ func _on_RemoveConfirmation_confirmed():
258258
print('Remove ', $Editor/CharacterTools/CharacterList/ItemList.get_item_metadata(selected)['file'])
259259
var dir = Directory.new()
260260
dir.remove(CHAR_DIR + '/' + file)
261-
$Editor/CharacterEditor/Container.visible = false
261+
$Editor/CharacterEditor/HBoxContainer/Container.visible = false
262262
clear_character_editor()
263263
refresh_character_list()
264264

0 commit comments

Comments
 (0)