Skip to content

Commit

Permalink
更新重新导入逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwdit committed Jul 17, 2022
1 parent 0808ee6 commit 78a1f36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions libs/core/modules/global_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,17 @@ func _add_import_helper()->void:
dir.open(import_helper_path)
for f in dir.get_files():
dir.copy(import_helper_path+f,import_helper_target_path+f)
dir.copy(project_file_path,"res://project.godot.bak")
c_file.set_value("editor_plugins","enabled",PackedStringArray(arr))
c_file.save(project_file_path)


func _remove_import_helper()->void:
clear_dir_files(root_path+"addons/")
var c_file:ConfigFile = ConfigFile.new()
var err:int = c_file.load(project_file_path)
if c_file.has_section("editor_plugins"):
c_file.erase_section("editor_plugins")
c_file.save(project_file_path)
OS.execute(OS.get_executable_path(),["--editor","--headless","--quit"])
var dir:Directory = Directory.new()
dir.open(GlobalManager.root_path)
dir.copy("res://project.godot.bak",project_file_path)
dir.remove("res://project.godot.bak")


class ResourceLoadHelper:
Expand Down
2 changes: 1 addition & 1 deletion update.json

Large diffs are not rendered by default.

0 comments on commit 78a1f36

Please sign in to comment.