Jelajahi Sumber

fix: empty ini output when editor hint

LanzaSchneider 1 tahun lalu
induk
melakukan
5cb832fd15
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      editor/config-importer.tscn

+ 5 - 0
editor/config-importer.tscn

@@ -12,6 +12,8 @@ var _task: Thread
 const _config_section := 'CONFIG'
 
 func _enter_tree() -> void:
+	if path.is_empty():
+		return
 	_config_path = path.path_join('config-importer.ini')
 	_config.load(_config_path)
 	$config_path.text = _config.get_value(_config_section, 'config_path', '')
@@ -19,6 +21,8 @@ func _enter_tree() -> void:
 	$generate_field_info.button_pressed = _config.get_value(_config_section, 'generate_field_info', true)
 
 func _exit_tree() -> void:
+	if path.is_empty():
+		return
 	_config_save()
 
 func _config_save() -> void:
@@ -122,6 +126,7 @@ placeholder_text = "生成路径"
 
 [node name="generate_field_info" type="CheckBox" parent="."]
 layout_mode = 2
+button_pressed = true
 text = "生成所有字段注释"
 
 [node name="import_perform" type="Button" parent="."]