File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,11 @@ func _process(_delta):
1313
1414
1515func _on_ButtonDelete_pressed ():
16- queue_free ()
16+ if $ NameEdit .text == 'Default' :
17+ $ PathEdit .text = ''
18+ update_preview ('' )
19+ else :
20+ queue_free ()
1721
1822
1923func _on_ButtonSelect_pressed ():
@@ -34,7 +38,9 @@ func _on_focus_entered():
3438
3539
3640func 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
Original file line number Diff line number Diff 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' :
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ visible = false
8282margin_left = 191.0
8383margin_right = 257.0
8484margin_bottom = 30.0
85- text = "[ Default] "
85+ text = "Default"
8686
8787[node name ="Preview" type ="Label" parent ="PanelContainer/VBoxContainer/Header" ]
8888visible = false
You can’t perform that action at this time.
0 commit comments