-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDivinityos2.ts
95 lines (85 loc) · 2.55 KB
/
Divinityos2.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
/**
* @description 神界:原罪2 支持
*/
import { join, extname, sep, basename, dirname } from 'path'
import { ElMessage } from "element-plus";
async function handlePakMod(mod: IModInfo, isInstall: boolean) {
let myDocuments = await FileHandler.getMyDocuments();
const manager = useManager()
let installPath = join(myDocuments, "Larian Studios", "Divinity Original Sin 2 Definitive Edition", "Mods")
mod.modFiles.forEach(item => {
let name = basename(item)
if (extname(item) == '.pak') {
let modStorage = join(manager.modStorage, mod.id.toString(), item)
// console.log(modStorage);
if (isInstall) {
FileHandler.copyFile(modStorage, join(installPath, name))
} else {
FileHandler.deleteFile(join(installPath, name))
}
}
})
return true
}
export const supportedGames: ISupportedGames = {
GlossGameId: 34,
steamAppID: 435150,
NexusMods: {
game_domain_name: "divinityoriginalsin2",
game_id: 1661
},
installdir: join("Divinity Original Sin 2", "DefEd", "bin"),
gameName: "Divinity Original Sin 2",
startExe: [
{
name: "Steam 启动",
cmd: "steam://rungameid/435150"
},
{
name: "直接启动",
exePath: join("DefEd", "bin", "EoCApp.exe")
}
],
gameExe: [
{
name: "EoCApp.exe",
rootPath: join('..', '..')
}
],
archivePath: join(FileHandler.getMyDocuments(), "Larian Studios", "Divinity Original Sin 2 Definitive Edition"),
gameCoverImg: "https://mod.3dmgame.com/static/upload/game/34.jpg",
modType: [
{
id: 1,
name: 'pak',
installPath: join('mods'),
async install(mod) {
return handlePakMod(mod, true)
},
async uninstall(mod) {
return handlePakMod(mod, false)
}
},
{
id: 99,
name: '未知',
installPath: '\\',
async install(mod) {
ElMessage.warning("该mod类型未知, 无法自动安装, 请手动安装!")
return false
},
async uninstall(mod) {
return true
}
}
],
checkModType(mod) {
let pak = false
mod.modFiles.forEach(item => {
let ext = extname(item)
if (ext == '.pak') pak = true
})
if (pak) return 1
return 99
}
}