Browse Source

fix: empty ini output when editor hint

LanzaSchneider 1 year ago
parent
commit
5cb832fd15
1 changed files with 5 additions and 0 deletions
  1. 5 0
      editor/config-importer.tscn

+ 5 - 0
editor/config-importer.tscn

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