-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathArmoredCore6.ts
110 lines (101 loc) · 3.43 KB
/
ArmoredCore6.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
* @description 装甲核心6 支持
*/
import axios from "axios";
import { ElMessage } from "element-plus";
import { statSync } from "fs";
import { basename, join } from "path";
let dictionaryList: string[] = []
async function handleMod(mod: IModInfo, installPath: string, isInstall: boolean) {
try {
if (isInstall) {
if (!Manager.checkInstalled("ModEngine2", 197418)) return false
}
if (dictionaryList.length == 0) {
let EldenRingDictionary = (await axios.get("res/ArmoredCore6Dictionary.txt")).data
dictionaryList = EldenRingDictionary.split("\r\n")
}
const manager = useManager()
let res: IState[] = []
mod.modFiles.forEach(async file => {
try {
let modStorage = join(manager.modStorage ?? "", mod.id.toString(), file)
// 判断是否是文件
if (!statSync(modStorage).isFile()) return
let name = basename(file)
// 判断name 是否在list中
if (dictionaryList.some(item => item.includes(name))) {
// 获取对应的目录
let path = dictionaryList.find(item => item.includes(name))
let gameStorage = join(manager.gameStorage ?? "", installPath, path ?? "")
if (isInstall) {
let state = await FileHandler.copyFile(modStorage, gameStorage)
res.push({ file: file, state: state })
} else {
let state = FileHandler.deleteFile(gameStorage)
res.push({ file: file, state: state })
}
}
} catch (error) {
res.push({ file: file, state: false })
}
})
return res
} catch (error) {
ElMessage.error(`错误:${error}`)
return false
}
}
export const supportedGames: ISupportedGames = {
GlossGameId: 323,
steamAppID: 1888160,
NexusMods: {
game_domain_name: "armoredcore6firesofrubicon",
game_id: 5679
},
installdir: join('ARMORED CORE VI FIRES OF RUBICON', 'Game'),
gameName: "Armored Core 6",
gameExe: 'armoredcore6.exe',
startExe: [
{
name: '启动 激活Mod',
exePath: 'launchmod_armoredcore6.bat'
},
{
name: 'Steam启动',
cmd: 'steam://rungameid/1888160'
}
],
archivePath: join(FileHandler.GetAppData(), 'Roaming', 'ArmoredCore6'),
gameCoverImg: "https://mod.3dmgame.com/static/upload/game/64e5a555a4360.webp",
modType: [
{
id: 1,
name: '通用类型',
installPath: '\\mods',
async install(mod) {
return handleMod(mod, this.installPath ?? '', true)
},
async uninstall(mod) {
return handleMod(mod, this.installPath ?? '', false)
}
},
{
id: 2,
name: 'Engine 2',
installPath: "\\",
async install(mod) {
return Manager.generalInstall(mod, this.installPath ?? "", true)
},
async uninstall(mod) {
return Manager.generalUninstall(mod, this.installPath ?? "", true)
},
}
],
checkModType(mod) {
if (mod.webId == 197418) {
return 2
}
return 1
}
}