mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 07:39:25 +08:00
add: add hook operation tool
This commit is contained in:
9
alas.py
9
alas.py
@@ -903,6 +903,15 @@ class AzurLaneAutoScript(AzurLaneAutoScript):
|
||||
def coalition_sp(self):
|
||||
super().coalition_sp()
|
||||
|
||||
def hook_op(self):
|
||||
op = self.config.full_config.HookOp_HookOp_Operation
|
||||
if op == "inject":
|
||||
CrackResource(self.config, self.device).ensure()
|
||||
elif op == "apply":
|
||||
do_crack_op(self.config, self.device, CrackOp.EnableAll)
|
||||
else:
|
||||
logger.error(f"Unknown Hook Operation: {op}")
|
||||
|
||||
def get_next_task(self):
|
||||
while 1:
|
||||
task = self.config.get_next()
|
||||
|
||||
@@ -2677,5 +2677,13 @@
|
||||
"Storage": {
|
||||
"Storage": {}
|
||||
}
|
||||
},
|
||||
"HookOp": {
|
||||
"HookOp": {
|
||||
"Operation": "apply"
|
||||
},
|
||||
"Storage": {
|
||||
"Storage": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16919,5 +16919,25 @@
|
||||
"display": "disabled"
|
||||
}
|
||||
}
|
||||
},
|
||||
"HookOp": {
|
||||
"HookOp": {
|
||||
"Operation": {
|
||||
"type": "select",
|
||||
"value": "apply",
|
||||
"option": [
|
||||
"inject",
|
||||
"apply"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Storage": {
|
||||
"Storage": {
|
||||
"type": "storage",
|
||||
"value": {},
|
||||
"valuetype": "ignore",
|
||||
"display": "disabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1004,3 +1004,10 @@ Comment:
|
||||
Content:
|
||||
type: textarea
|
||||
value: ''
|
||||
|
||||
# ==================== Remark ======================
|
||||
|
||||
HookOp:
|
||||
Operation:
|
||||
value: apply
|
||||
option: [ inject, apply ]
|
||||
@@ -121,7 +121,8 @@
|
||||
"EventStory",
|
||||
"Benchmark",
|
||||
"AzurLaneUncensored",
|
||||
"GameManager"
|
||||
"GameManager",
|
||||
"HookOp"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -431,3 +431,5 @@ Tool:
|
||||
- AzurLaneUncensored
|
||||
GameManager:
|
||||
- GameManager
|
||||
HookOp:
|
||||
- HookOp
|
||||
@@ -639,5 +639,8 @@ class GeneratedConfig:
|
||||
# Group `Comment`
|
||||
Comment_Content = None
|
||||
|
||||
# Group `HookOp`
|
||||
HookOp_Operation = 'apply' # inject, apply
|
||||
|
||||
# Group `Storage`
|
||||
Storage_Storage = {}
|
||||
|
||||
@@ -1929,3 +1929,7 @@ class FullGeneratedConfig:
|
||||
# Task `GameManager`
|
||||
GameManager_GameManager_AutoRestart = None
|
||||
GameManager_Storage_Storage = None
|
||||
|
||||
# Task `HookOp`
|
||||
HookOp_HookOp_Operation = None
|
||||
HookOp_Storage_Storage = None
|
||||
|
||||
@@ -321,6 +321,10 @@
|
||||
"GameManager": {
|
||||
"name": "Game Manager(WIP)",
|
||||
"help": ""
|
||||
},
|
||||
"HookOp": {
|
||||
"name": "Task.HookOp.name",
|
||||
"help": "Task.HookOp.help"
|
||||
}
|
||||
},
|
||||
"Scheduler": {
|
||||
@@ -3464,6 +3468,18 @@
|
||||
"help": "Comment.Content.help"
|
||||
}
|
||||
},
|
||||
"HookOp": {
|
||||
"_info": {
|
||||
"name": "HookOp._info.name",
|
||||
"help": "HookOp._info.help"
|
||||
},
|
||||
"Operation": {
|
||||
"name": "HookOp.Operation.name",
|
||||
"help": "HookOp.Operation.help",
|
||||
"inject": "inject",
|
||||
"apply": "apply"
|
||||
}
|
||||
},
|
||||
"Storage": {
|
||||
"_info": {
|
||||
"name": "Task status",
|
||||
|
||||
@@ -321,6 +321,10 @@
|
||||
"GameManager": {
|
||||
"name": "Game Manager(WIP)",
|
||||
"help": ""
|
||||
},
|
||||
"HookOp": {
|
||||
"name": "Task.HookOp.name",
|
||||
"help": "Task.HookOp.help"
|
||||
}
|
||||
},
|
||||
"Scheduler": {
|
||||
@@ -3464,6 +3468,18 @@
|
||||
"help": "Comment.Content.help"
|
||||
}
|
||||
},
|
||||
"HookOp": {
|
||||
"_info": {
|
||||
"name": "HookOp._info.name",
|
||||
"help": "HookOp._info.help"
|
||||
},
|
||||
"Operation": {
|
||||
"name": "HookOp.Operation.name",
|
||||
"help": "HookOp.Operation.help",
|
||||
"inject": "inject",
|
||||
"apply": "apply"
|
||||
}
|
||||
},
|
||||
"Storage": {
|
||||
"_info": {
|
||||
"name": "Storage._info.name",
|
||||
|
||||
@@ -321,6 +321,10 @@
|
||||
"GameManager": {
|
||||
"name": "游戏管理器(未完成)",
|
||||
"help": ""
|
||||
},
|
||||
"HookOp": {
|
||||
"name": "Hook操作",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Scheduler": {
|
||||
@@ -3464,6 +3468,18 @@
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"HookOp": {
|
||||
"_info": {
|
||||
"name": "Hook操作",
|
||||
"help": ""
|
||||
},
|
||||
"Operation": {
|
||||
"name": "操作",
|
||||
"help": "",
|
||||
"inject": "注入",
|
||||
"apply": "设置Hook"
|
||||
}
|
||||
},
|
||||
"Storage": {
|
||||
"_info": {
|
||||
"name": "任务状态",
|
||||
|
||||
@@ -321,6 +321,10 @@
|
||||
"GameManager": {
|
||||
"name": "遊戲管理器(未完成)",
|
||||
"help": ""
|
||||
},
|
||||
"HookOp": {
|
||||
"name": "Task.HookOp.name",
|
||||
"help": "Task.HookOp.help"
|
||||
}
|
||||
},
|
||||
"Scheduler": {
|
||||
@@ -3464,6 +3468,18 @@
|
||||
"help": "Comment.Content.help"
|
||||
}
|
||||
},
|
||||
"HookOp": {
|
||||
"_info": {
|
||||
"name": "HookOp._info.name",
|
||||
"help": "HookOp._info.help"
|
||||
},
|
||||
"Operation": {
|
||||
"name": "HookOp.Operation.name",
|
||||
"help": "HookOp.Operation.help",
|
||||
"inject": "inject",
|
||||
"apply": "apply"
|
||||
}
|
||||
},
|
||||
"Storage": {
|
||||
"_info": {
|
||||
"name": "任務狀態",
|
||||
|
||||
@@ -88,4 +88,11 @@ def get_config_mod(config_name):
|
||||
return 'alas'
|
||||
|
||||
def has_config_mod(config_name):
|
||||
return os.path.exists(f"./config/{config_name}.json")
|
||||
return os.path.exists(f"./config/{config_name}.json")
|
||||
|
||||
|
||||
old_get_available_func = get_available_func
|
||||
|
||||
|
||||
def get_available_func():
|
||||
return [*old_get_available_func(), "HookOp"]
|
||||
|
||||
Reference in New Issue
Block a user