mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-16 09:04:45 +01:00
Changes from 1.2.1 - 1.5.1
Contains slightly modified commits from between 1.2.1 and 1.5.1.
This commit is contained in:
@@ -45,7 +45,7 @@ export async function getGameDataFolder() {
|
||||
return null
|
||||
}
|
||||
|
||||
return (await getGameFolder()) + '/' + gameExec.replace('.exe', '_Data')
|
||||
return (await getGameFolder()) + '\\' + gameExec.replace('.exe', '_Data')
|
||||
}
|
||||
|
||||
export async function getGameVersion() {
|
||||
@@ -55,9 +55,33 @@ export async function getGameVersion() {
|
||||
return null
|
||||
}
|
||||
|
||||
const hasAsb = await invoke('dir_exists', {
|
||||
path: GameData + '\\StreamingAssets\\asb_settings.json',
|
||||
})
|
||||
|
||||
if (!hasAsb) {
|
||||
// For games that cannot determine game version
|
||||
const otherGameVer: string = await invoke('read_file', {
|
||||
path: GameData + '\\StreamingAssets\\BinaryVersion.bytes',
|
||||
})
|
||||
const versionRaw = otherGameVer.split('.')
|
||||
const version = {
|
||||
major: parseInt(versionRaw[0]),
|
||||
minor: parseInt(versionRaw[1]),
|
||||
// This will probably never matter, just use major/minor. If needed, full version values are near EOF
|
||||
release: 0,
|
||||
}
|
||||
|
||||
if (otherGameVer == null || otherGameVer.length < 1) {
|
||||
return null
|
||||
}
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
const settings = JSON.parse(
|
||||
await invoke('read_file', {
|
||||
path: GameData + '/StreamingAssets/asb_settings.json',
|
||||
path: GameData + '\\StreamingAssets\\asb_settings.json',
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user