mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 08:04:52 +01:00
Compare commits
5 Commits
dependabot
...
v1.5.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14173e5b9f | ||
|
|
3669bb334b | ||
|
|
03fed7a69a | ||
|
|
55a90ea531 | ||
|
|
b28c3881e6 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cultivation",
|
||||
"version": "1.5.1",
|
||||
"version": "1.5.4",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^1.0.0-rc.5",
|
||||
|
||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@@ -959,7 +959,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
|
||||
|
||||
[[package]]
|
||||
name = "cultivation"
|
||||
version = "1.5.1"
|
||||
version = "1.5.4"
|
||||
dependencies = [
|
||||
"anime-launcher-sdk",
|
||||
"anyhow",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cultivation"
|
||||
version = "1.5.1"
|
||||
version = "1.5.4"
|
||||
description = "A custom launcher for anime game."
|
||||
authors = ["KingRainbow44", "SpikeHD"]
|
||||
license = ""
|
||||
|
||||
BIN
src-tauri/patch/52version.dll
Normal file
BIN
src-tauri/patch/52version.dll
Normal file
Binary file not shown.
BIN
src-tauri/patch/53version.dll
Normal file
BIN
src-tauri/patch/53version.dll
Normal file
Binary file not shown.
@@ -209,6 +209,7 @@ fn main() -> Result<(), ArgsError> {
|
||||
get_theme_list,
|
||||
system_helpers::run_command,
|
||||
system_helpers::run_program,
|
||||
system_helpers::run_program_args,
|
||||
system_helpers::run_program_relative,
|
||||
system_helpers::start_service,
|
||||
system_helpers::service_status,
|
||||
|
||||
@@ -108,6 +108,18 @@ impl SpawnItsFineReally for Command {
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_program_args(path: String, args: Option<String>) {
|
||||
match open::with(
|
||||
format!("{}", args.unwrap_or_else(|| "".into())),
|
||||
path.clone(),
|
||||
) {
|
||||
Ok(_) => (),
|
||||
Err(e) => println!("Failed to open program ({}): {}", &path, e),
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_program(path: String, args: Option<String>) {
|
||||
// Without unwrap_or, this can crash when UAC prompt is denied
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "Cultivation",
|
||||
"version": "1.5.1"
|
||||
"version": "1.5.4"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
||||
@@ -278,6 +278,13 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
if (config.launch_args.length < 1) {
|
||||
// Run relative when there are no args
|
||||
await invoke('run_program_relative', { path: exe || config.game_install_path })
|
||||
}
|
||||
// Handle XXMI
|
||||
else if (proc_name?.toLowerCase().includes('xxmi')) {
|
||||
await invoke('run_program_args', {
|
||||
path: exe,
|
||||
args: config.launch_args,
|
||||
})
|
||||
} else {
|
||||
// Run directly when there are args
|
||||
await invoke('run_program', {
|
||||
|
||||
@@ -69,7 +69,10 @@ export class ExtrasMenu extends React.Component<IProps, IState> {
|
||||
|
||||
// This injects independent of the game
|
||||
if (this.state.launch_migoto) {
|
||||
await this.launchMigoto()
|
||||
if (await this.launchMigoto()) {
|
||||
// Already launched the game (ie. via XXMI)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// This injects independent of the game
|
||||
@@ -104,7 +107,17 @@ export class ExtrasMenu extends React.Component<IProps, IState> {
|
||||
|
||||
if (!config.migoto_path) return alert('Migoto not installed or set!')
|
||||
|
||||
if (config.migoto_path?.toLowerCase().includes('xxmi')) {
|
||||
// Get game exe from game path, so we can watch it
|
||||
const pathArr = config.migoto_path.replace(/\\/g, '/').split('/')
|
||||
const gameExec = pathArr[pathArr.length - 1]
|
||||
|
||||
this.props.playGame(config.migoto_path, gameExec)
|
||||
return true
|
||||
}
|
||||
|
||||
await invoke('run_program_relative', { path: config.migoto_path })
|
||||
return false
|
||||
}
|
||||
|
||||
async launchReshade() {
|
||||
|
||||
@@ -143,7 +143,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
<tr>
|
||||
<td>
|
||||
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.4
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
|
||||
@@ -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]),
|
||||
|
||||
@@ -3417,9 +3417,9 @@ cross-env@^7.0.3:
|
||||
cross-spawn "^7.0.1"
|
||||
|
||||
cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
||||
version "7.0.6"
|
||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
|
||||
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
|
||||
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
|
||||
dependencies:
|
||||
path-key "^3.1.0"
|
||||
shebang-command "^2.0.0"
|
||||
|
||||
Reference in New Issue
Block a user