Skip to content

Commit 0fe830f

Browse files
committed
deleting path of default portrait
1 parent e83f875 commit 0fe830f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

addons/dialogic/Editor/CharacterEditor/PortraitEntry.gd

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ func _process(_delta):
1313

1414

1515
func _on_ButtonDelete_pressed():
16-
queue_free()
16+
if $NameEdit.text == 'Default':
17+
$PathEdit.text = ''
18+
update_preview('')
19+
else:
20+
queue_free()
1721

1822

1923
func _on_ButtonSelect_pressed():
@@ -34,7 +38,9 @@ func _on_focus_entered():
3438

3539

3640
func update_preview(path):
37-
if path != '':
41+
if path == '':
42+
image_node.texture = null
43+
else:
3844
if '.png' in path or '.svg' in path:
3945
image_node.texture = load(path)
4046
return true

addons/dialogic/Editor/EditorCharacter.gd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ func load_character_editor(data):
153153
var default_portrait = create_portrait_entry()
154154
default_portrait.get_node('NameEdit').text = 'Default'
155155
default_portrait.get_node('NameEdit').editable = false
156-
default_portrait.get_node('ButtonDelete').disabled = true
157156
if data.has('portraits'):
158157
for p in data['portraits']:
159158
if p['name'] == 'Default':

addons/dialogic/Editor/Pieces/TextBlock.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ visible = false
8282
margin_left = 191.0
8383
margin_right = 257.0
8484
margin_bottom = 30.0
85-
text = "[Default]"
85+
text = "Default"
8686

8787
[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
8888
visible = false

0 commit comments

Comments
 (0)