-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path7DaystoDie.ts
81 lines (75 loc) · 2.2 KB
/
7DaystoDie.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
/**
* @description 7日杀 支持
*/
import { basename, join, extname } from "node:path"
import { ElMessage } from "element-plus";
export const supportedGames: ISupportedGames = {
GlossGameId: 40,
steamAppID: 251570,
NexusMods: {
game_id: 1059,
game_domain_name: "7daystodie",
},
installdir: join("7 Days to Die"),
gameName: "7 Days to Die",
gameExe: "7DaysToDie.exe",
archivePath: join(FileHandler.GetAppData(), "Roaming", "7DaysToDie"),
startExe: [
{
name: "Steam 启动",
cmd: "steam://rungameid/251570"
},
{
name: "直接启动",
exePath: join("7DaysToDie.exe")
}
],
gameCoverImg: "https://mod.3dmgame.com/static/upload/game/40.jpg",
modType: [
{
id: 1,
name: "Mods",
installPath: join("Mods"),
async install(mod) {
return Manager.installByFile(mod, this.installPath ?? "", 'modinfo.xml', true)
},
async uninstall(mod) {
return Manager.installByFile(mod, this.installPath ?? "", 'modinfo.xml', false)
}
},
{
id: 2,
name: "Avatars",
installPath: join("Mods", "VRoidMod", "Avatars"),
async install(mod) {
return Manager.generalInstall(mod, this.installPath ?? "", false)
},
async uninstall(mod) {
return Manager.generalUninstall(mod, this.installPath ?? "", false)
}
},
{
id: 99,
name: "未知",
installPath: "",
async install(mod) {
ElMessage.warning("未知类型, 请手动安装")
return false
},
async uninstall(mod) {
return true
}
}
],
checkModType(mod) {
let Mods = false
let Avatars = false
mod.modFiles.forEach(item => {
if (basename(item).toLowerCase() == 'modinfo.xml') Mods = true
if (extname(item) == '.unity3d') Avatars = true
})
if (Mods) return 1
if (Avatars) return 2
return 99
}
}