diff --git a/package.json b/package.json index f15609c8..59657c37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cultivation", - "version": "1.5.1", + "version": "1.5.2", "private": true, "dependencies": { "@tauri-apps/api": "^1.0.0-rc.5", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 8c92b445..a0313bba 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -959,7 +959,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "cultivation" -version = "1.5.1" +version = "1.5.2" dependencies = [ "anime-launcher-sdk", "anyhow", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 07d75288..a7fbf7dc 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cultivation" -version = "1.5.1" +version = "1.5.2" description = "A custom launcher for anime game." authors = ["KingRainbow44", "SpikeHD"] license = "" diff --git a/src-tauri/patch/52version.dll b/src-tauri/patch/52version.dll new file mode 100644 index 00000000..f57521ef Binary files /dev/null and b/src-tauri/patch/52version.dll differ diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index edadf92b..581260e3 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "Cultivation", - "version": "1.5.1" + "version": "1.5.2" }, "tauri": { "allowlist": { diff --git a/src/ui/components/news/NewsSection.tsx b/src/ui/components/news/NewsSection.tsx index 62b2487e..8f4fe2d3 100644 --- a/src/ui/components/news/NewsSection.tsx +++ b/src/ui/components/news/NewsSection.tsx @@ -143,7 +143,7 @@ export default class NewsSection extends React.Component { Work in progress area! These numbers may be outdated, so please do not use them as reference. Latest - version: Grasscutter 1.7.4 - Cultivation 1.5.1 + version: Grasscutter 1.7.4 - Cultivation 1.5.2 ) diff --git a/src/utils/game.ts b/src/utils/game.ts index 119fd459..3c7ff9bf 100644 --- a/src/utils/game.ts +++ b/src/utils/game.ts @@ -50,20 +50,34 @@ export async function getGameDataFolder() { export async function getGameVersion() { const GameData = await getGameDataFolder() + const platform = await invoke('get_platform') if (!GameData) { return null } - const hasAsb = await invoke('dir_exists', { + let hasAsb = await invoke('dir_exists', { path: GameData + '\\StreamingAssets\\asb_settings.json', }) + if (platform != 'windows') { + 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', { + let otherGameVer: string = await invoke('read_file', { path: GameData + '\\StreamingAssets\\BinaryVersion.bytes', }) + + if (platform != 'windows') { + otherGameVer = await invoke('read_file', { + path: GameData + '/StreamingAssets/BinaryVersion.bytes', + }) + } + const versionRaw = otherGameVer.split('.') const version = { major: parseInt(versionRaw[0]),