Skip to content

Commit 43cfd83

Browse files
committed
增加emt示例
1 parent 633f4db commit 43cfd83

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ working_images/
7373
mod/*
7474
# 但不忽略这个特定的文件夹
7575
!mod/示例-无巧手30火突破素材(1080p) by望目/
76+
!mod/示例-脚本工具/
7677
!mod/builtin/
7778

7879
# 忽略vscode插件文件
578 KB
Binary file not shown.
Binary file not shown.
11.1 MB
Binary file not shown.

src/tasks/fullauto/ImportTask.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, *args, **kwargs):
4848
})
4949
self.config_type['外部文件夹'] = {
5050
"type": "drop_down",
51-
"options": self.load_direct_folder(f'{Path.cwd()}\mod'),
51+
"options": self.load_direct_folder(fr'{Path.cwd()}\mod'),
5252
}
5353

5454
self.config_type['副本类型'] = {
@@ -76,8 +76,8 @@ def run(self):
7676
self.set_check_monthly_card()
7777
try:
7878
path = Path.cwd()
79-
self.script = self.process_json_files(f'{path}\mod\{self.config.get("外部文件夹")}\scripts')
80-
self.img = self.load_png_files(f'{path}\mod\{self.config.get("外部文件夹")}\map')
79+
self.script = self.process_json_files(fr'{path}\mod\{self.config.get("外部文件夹")}\scripts')
80+
self.img = self.load_png_files(fr'{path}\mod\{self.config.get("外部文件夹")}\map')
8181
if self.config.get('副本类型') == '扼守无尽':
8282
_to_do_task = self.get_task_by_class(AutoDefence)
8383
elif self.config.get('副本类型') == '探险无尽':
@@ -165,9 +165,12 @@ def stop_func(self):
165165

166166
def load_direct_folder(self, path):
167167
folders = []
168+
excluded_keywords = ("builtin", "示例-脚本工具")
168169
for item in os.listdir(path):
169170
item_path = os.path.join(path, item)
170-
if os.path.isdir(item_path) and item != 'builtin':
171+
if any(keyword in item_path for keyword in excluded_keywords):
172+
continue
173+
if os.path.isdir(item_path):
171174
folders.append(item)
172175
return folders
173176

0 commit comments

Comments
 (0)