mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 02:10:21 +08:00
Feat: Auto Update now orders Global tasks.json like Official
Tasks_Sorter.py now orders the Global servers tasks with the same order of the official server For EN: removed Award task + I.S. trader shopping regex For KR: removed deprecated I.S. tasks Co-authored-by: 178619 <snoo91919@gmail.com>
This commit is contained in:
4
.github/workflows/res-update-game.yml
vendored
4
.github/workflows/res-update-game.yml
vendored
@@ -31,7 +31,9 @@ jobs:
|
||||
- name: Run Resource Updater
|
||||
run: |
|
||||
.\tools\ResourceUpdater\x64\Release\ResourceUpdater.exe
|
||||
|
||||
- name: Overseas Tasks Ordering
|
||||
run: |
|
||||
python3 tools/ResourceUpdater/Tasks_Sorter.py
|
||||
- name: Check if only sorted
|
||||
id: check_only_sorted
|
||||
run: |
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
{
|
||||
"Award": {
|
||||
"roi": [
|
||||
700,
|
||||
530,
|
||||
200,
|
||||
130
|
||||
],
|
||||
"template": "Task.png"
|
||||
},
|
||||
"BattleQuickFormationExpandRole": {
|
||||
"roi": [
|
||||
1166,
|
||||
@@ -2582,13 +2573,12 @@
|
||||
]
|
||||
},
|
||||
"ClickedCorrectStageOrSwipe": {
|
||||
"action": "DoNothing",
|
||||
"baseTask": "StartButton1",
|
||||
"action": "DoNothing",
|
||||
"reduceOtherTimes": [],
|
||||
"next": [
|
||||
"ClickedCorrectStage",
|
||||
"FullStageNavigation"
|
||||
],
|
||||
"reduceOtherTimes": [
|
||||
]
|
||||
},
|
||||
"CreditShop-NoMoney": {
|
||||
@@ -4203,6 +4193,10 @@
|
||||
"Mantle of the Wrongly Condemned",
|
||||
"替罪领巾"
|
||||
],
|
||||
[
|
||||
"Support Replenishment",
|
||||
"Support Replenishment Station"
|
||||
],
|
||||
[
|
||||
"Support Replenishment Station",
|
||||
"支援补给站"
|
||||
@@ -5307,19 +5301,18 @@
|
||||
]
|
||||
},
|
||||
"SSSDropRecruitmentOCR": {
|
||||
"action": "DoNothing",
|
||||
"algorithm": "OcrDetect",
|
||||
"baseTask": "CharsNameOcrReplace",
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "DoNothing",
|
||||
"text": [],
|
||||
"cache": false,
|
||||
"postDelay": 1000,
|
||||
"roi": [
|
||||
0,
|
||||
352,
|
||||
1280,
|
||||
263
|
||||
],
|
||||
"text": [
|
||||
]
|
||||
"postDelay": 1000
|
||||
},
|
||||
"SSSEquipmentConfirm": {
|
||||
"roi": [
|
||||
|
||||
@@ -2746,11 +2746,6 @@
|
||||
"구매센터"
|
||||
]
|
||||
},
|
||||
"Mizuki@Roguelike@FromIntegratedStrategies": {
|
||||
"text": [
|
||||
"테마진입"
|
||||
]
|
||||
},
|
||||
"Mizuki@Roguelike@NextLevel": {
|
||||
"text": [
|
||||
"하늘빛해안",
|
||||
@@ -2792,11 +2787,6 @@
|
||||
"인원"
|
||||
]
|
||||
},
|
||||
"Phantom@Roguelike@FromIntegratedStrategies": {
|
||||
"text": [
|
||||
"테마진입"
|
||||
]
|
||||
},
|
||||
"Phantom@Roguelike@NextLevel": {
|
||||
"text": [
|
||||
"안개의기로",
|
||||
@@ -5367,7 +5357,8 @@
|
||||
352,
|
||||
1280,
|
||||
263
|
||||
]
|
||||
],
|
||||
"text": []
|
||||
},
|
||||
"SSSEquipmentConfirm": {
|
||||
"text": [
|
||||
|
||||
24
tools/ResourceUpdater/Tasks_Sorter.py
Normal file
24
tools/ResourceUpdater/Tasks_Sorter.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from collections import OrderedDict
|
||||
|
||||
path = str(Path(__file__).parents[2]) + '/'
|
||||
|
||||
servers = {
|
||||
'EN': 'YoStarEN',
|
||||
'JP': 'YoStarJP',
|
||||
'KR': 'YoStarKR',
|
||||
'TW': 'txwy'
|
||||
}
|
||||
|
||||
with open(path+'resource/tasks.json', 'r', encoding='UTF-8') as file:
|
||||
order = list(json.load(file).keys())
|
||||
print('CN', len(order))
|
||||
|
||||
for server, name in servers.items():
|
||||
with open(path+f'resource/global/{name}/resource/tasks.json', 'r', encoding='UTF-8') as file:
|
||||
tasks = json.load(file)
|
||||
tasks = OrderedDict(sorted(tasks.items(), key=lambda item:order.index(item[0]) if item[0] in order else -1))
|
||||
with open(path+f'resource/global/{name}/resource/tasks.json', 'w', encoding='UTF-8') as file:
|
||||
json.dump(tasks, file, indent=4, ensure_ascii=False)
|
||||
print(server, len(tasks))
|
||||
Reference in New Issue
Block a user