Compare commits

..

13 Commits

Author SHA1 Message Date
Thoronium
fcd08cace5 Bump version 2025-02-26 13:05:21 -07:00
Thoronium
0258aa006a Remove unused patch 2025-02-26 13:04:25 -07:00
Thoronium
8c10c00b53 Update file 2025-02-15 14:28:50 -07:00
Thoronium
fe094c952b Fix typo 2025-02-14 23:49:11 -07:00
Thoronium
63a883cf1d Bump version 2025-02-14 15:25:56 -07:00
Thoronium
8207260968 Add 5.4 AIO 2025-02-14 15:19:18 -07:00
Thoronium
4e72101fda Bump version 2025-02-03 17:11:19 -07:00
Thoronium
14206e87a0 Update menu version 2025-02-03 17:09:56 -07:00
Thoronium
13d129f175 Add 5.3 AIO 2025-02-03 17:03:44 -07:00
Thoronium
14173e5b9f Merge branch 'main' of https://github.com/Grasscutters/Cultivation 2025-01-16 20:45:13 -07:00
Thoronium
3669bb334b Bump version 2025-01-16 20:45:07 -07:00
Thoronium
03fed7a69a Support XXMI launching with args 2025-01-16 20:41:17 -07:00
Thoronium
55a90ea531 Add 5.3 patch
Bump version
2025-01-01 13:47:37 -07:00
30 changed files with 148 additions and 113 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "cultivation",
"version": "1.5.2",
"version": "1.5.7",
"private": true,
"dependencies": {
"@tauri-apps/api": "^1.0.0-rc.5",

2
src-tauri/Cargo.lock generated
View File

@@ -959,7 +959,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
[[package]]
name = "cultivation"
version = "1.5.2"
version = "1.5.7"
dependencies = [
"anime-launcher-sdk",
"anyhow",

View File

@@ -1,6 +1,6 @@
[package]
name = "cultivation"
version = "1.5.2"
version = "1.5.7"
description = "A custom launcher for anime game."
authors = ["KingRainbow44", "SpikeHD"]
license = ""

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "下载 Grasscutter 一体化",
"grasscutter_fullquest": "下载 5.0 一体化",
"grasscutter_fullquest": "下载 5.4 一体化",
"grasscutter_stable_data": "下载 Grasscutter 稳定版数据",
"grasscutter_latest_data": "下载 Grasscutter 开发版数据",
"grasscutter_stable_data_update": "更新 Grasscutter 稳定版数据",

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "下載Grasscutter多合一下載",
"grasscutter_fullquest": "下载 5.0 一体化",
"grasscutter_fullquest": "下载 5.4 一体化",
"grasscutter_stable_data": "下載Grasscutter穩定版數據Data",
"grasscutter_latest_data": "下載Grasscutter開發板數據Data",
"grasscutter_stable_data_update": "更新Grasscutter穩定版數據Data",

View File

@@ -43,7 +43,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Grasscutter All-in-One herunterladen",
"grasscutter_fullquest": "5.0 All-in-One herunterladen",
"grasscutter_fullquest": "5.4 All-in-One herunterladen",
"grasscutter_stable_data": "Stabile Grasscutter-Daten herunterladen",
"grasscutter_latest_data": "Neueste Grasscutter-Daten herunterladen",
"grasscutter_stable_data_update": "Stabile Grasscutter-Daten aktualisieren",

View File

@@ -43,7 +43,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Download Grasscutter All-in-One",
"grasscutter_fullquest": "Download 5.0 All-in-One",
"grasscutter_fullquest": "Download 5.4 All-in-One",
"grasscutter_stable_data": "Download Grasscutter Stable Data",
"grasscutter_latest_data": "Download Grasscutter Latest Data",
"grasscutter_stable_data_update": "Update Grasscutter Stable Data",

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Descargar datos todo en uno de Grasscutter",
"grasscutter_fullquest": "Descargar datos todo en uno de 5.0",
"grasscutter_fullquest": "Descargar datos todo en uno de 5.4",
"grasscutter_stable_data": "Descargar datos Estables de Grasscutter",
"grasscutter_latest_data": "Descargar datos más Recientes de Grasscutter",
"grasscutter_stable_data_update": "Actualizar datos estables de Grasscutter",

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Telecharger Grasscutter tout-en-un",
"grasscutter_fullquest": "Télécharger les 5.0 tout-en-un",
"grasscutter_fullquest": "Télécharger les 5.4 tout-en-un",
"grasscutter_stable_data": "Télécharger les donnees de Grasscutter (version stable)",
"grasscutter_latest_data": "Télécharger les donnees de Grasscutter (derniere version)",
"grasscutter_stable_data_update": "Mettre à jour les données de Grasscutter (version stable)",

View File

@@ -40,7 +40,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Sedang Mendownload Grasscutter Semua Dalam Satu",
"grasscutter_fullquest": "Unduh 5.0 semua dalam satu",
"grasscutter_fullquest": "Unduh 5.4 semua dalam satu",
"grasscutter_stable_data": "Sedang Mendownload Grasscutter Versi Stabil",
"grasscutter_latest_data": "Sedang Mendownload Grasscutter Data Terbaru",
"grasscutter_stable_data_update": "Memperbaharui Grasscutter Data Stabil",

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Scarica Grasscutter Tutto-in-Uno",
"grasscutter_fullquest": "Scarica 5.0 Tutto-in-Uno",
"grasscutter_fullquest": "Scarica 5.4 Tutto-in-Uno",
"grasscutter_stable_data": "Scarica i dati di Grasscutter Stabili",
"grasscutter_latest_data": "Scarica i dati di Grasscutter Più Recenti",
"grasscutter_stable_data_update": "Aggiorna i dati di Grasscutter Stabili",

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Grasscutter All-in-Oneをダウンロード",
"grasscutter_fullquest": "Questing All-in-Oneをダウンロード",
"grasscutter_fullquest": "5.4 All-in-Oneをダウンロード",
"grasscutter_stable_data": "Grasscutter安定版データファイルをダウンロード",
"grasscutter_latest_data": "Grasscutter最新版データファイルをダウンロード",
"grasscutter_stable_data_update": "Grasscutter安定版データファイルをアップデート",

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "올인원 Grasscutter 다운로드",
"grasscutter_fullquest": "5.0 올인원 다운로드",
"grasscutter_fullquest": "5.4 올인원 다운로드",
"grasscutter_stable_data": "안정적인 데이터 다운로드",
"grasscutter_latest_data": "최신 데이터 다운로드",
"grasscutter_stable_data_update": "안정적 데이터 업데이트",

View File

@@ -39,7 +39,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Lejupielādējiet Grasscutter viss vienā",
"grasscutter_fullquest": "Lejupielādēt 5.0 viss vienā",
"grasscutter_fullquest": "Lejupielādēt 5.4 viss vienā",
"grasscutter_stable_data": "Lejupielādējiet Grasscutter stabilos datus",
"grasscutter_latest_data": "Lejupielādējiet Grasscutter jaunākos datus",
"grasscutter_stable_data_update": "Atjauniniet Grasscutter stabilos datus",

View File

@@ -40,7 +40,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Grasscutter Alles-in-één Downloaden",
"grasscutter_fullquest": "Alles-in-één 5.0 downloaden",
"grasscutter_fullquest": "Alles-in-één 5.4 downloaden",
"grasscutter_stable_data": "Download Stabiele Gegevens Van Grasscutter",
"grasscutter_latest_data": "Download De Nieuwste Gegevens Van Grasscutter",
"grasscutter_stable_data_update": "Stabiele gegevens Van Grasscutter bijwerken",

View File

@@ -43,7 +43,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Pobierz Grasscutter (wszystko w jednym)",
"grasscutter_fullquest": "Pobierz 5.0 (wszystko w jednym)",
"grasscutter_fullquest": "Pobierz 5.4 (wszystko w jednym)",
"grasscutter_stable_data": "Pobierz stabilne dane Grasscuttera",
"grasscutter_latest_data": "Pobierz najnowsze dane Grasscuttera",
"grasscutter_stable_data_update": "Zaaktualizuj stabilne dane Grasscuttera",

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Baixar o Grasscutter Tudo-em-Um",
"grasscutter_fullquest": "Baixar de 5.0 em um só lugar",
"grasscutter_fullquest": "Baixar de 5.4 em um só lugar",
"grasscutter_stable_data": "Baixar os Dados do Grasscutter Estável",
"grasscutter_latest_data": "Baixar os Dados do Grasscutter Mais Recente",
"grasscutter_stable_data_update": "Atualizar os Dados do Grasscutter Estável",

View File

@@ -40,7 +40,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Скачать все в одном Grasscutter",
"grasscutter_fullquest": "Скачать 5.0 все в одном",
"grasscutter_fullquest": "Скачать 5.4 все в одном",
"grasscutter_stable_data": "Скачать стабильные данные Grasscutter",
"grasscutter_latest_data": "Скачать последние данные Grasscutter",
"grasscutter_stable_data_update": "Обновить стабильные данные Grasscutter",

View File

@@ -41,7 +41,7 @@
},
"downloads": {
"grasscutter_fullbuild": "Tải Grasscutter tất cả trong một",
"grasscutter_fullquest": "Tải 5.0 tất cả trong một",
"grasscutter_fullquest": "Tải 5.4 tất cả trong một",
"grasscutter_stable_data": "Tải dữ liệu Grasscutter bản ổn định",
"grasscutter_latest_data": "Tải dữ liệu Grasscutter bản mới nhất",
"grasscutter_stable_data_update": "Cập nhật dữ liệu Grasscutter bản ổn định",

Binary file not shown.

Binary file not shown.

View File

@@ -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,

View File

@@ -50,79 +50,80 @@ struct WhatToUnpach {
#[cfg(windows)]
#[tauri::command]
pub async fn patch_game(newer_game: bool, version: String) -> bool {
pub async fn patch_game(_newer_game: bool, version: String) -> bool {
let mut patch_path;
// Altpatch first - Now using as hoyonet switch
if newer_game {
let alt_patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch");
// People keep using this when they shouldn't, 99.8% of people will never need it. Just remove for now.
// if newer_game {
// let alt_patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch");
// Should handle overwriting backup with new version backup later
let backup_path = PathBuf::from(system_helpers::install_location())
.join("altpatch/original-mihoyonet.dll")
.to_str()
.unwrap()
.to_string();
let backup_exists = file_helpers::does_file_exist(&backup_path);
// // Should handle overwriting backup with new version backup later
// let backup_path = PathBuf::from(system_helpers::install_location())
// .join("altpatch/original-mihoyonet.dll")
// .to_str()
// .unwrap()
// .to_string();
// let backup_exists = file_helpers::does_file_exist(&backup_path);
if !backup_exists {
let backup = file_helpers::copy_file_with_new_name(
get_game_rsa_path().await.unwrap()
+ &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"),
alt_patch_path.clone().to_str().unwrap().to_string(),
String::from("original-mihoyonet.dll"),
);
// if !backup_exists {
// let backup = file_helpers::copy_file_with_new_name(
// get_game_rsa_path().await.unwrap()
// + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"),
// alt_patch_path.clone().to_str().unwrap().to_string(),
// String::from("original-mihoyonet.dll"),
// );
if !backup {
println!("Unable to backup file!");
}
}
// if !backup {
// println!("Unable to backup file!");
// }
// }
patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll");
// Copy the other part of patch to game files
let alt_replaced = file_helpers::copy_file_with_new_name(
patch_path.clone().to_str().unwrap().to_string(),
get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins"),
String::from("mihoyonet.dll"),
);
// patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll");
// // Copy the other part of patch to game files
// let alt_replaced = file_helpers::copy_file_with_new_name(
// patch_path.clone().to_str().unwrap().to_string(),
// get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins"),
// String::from("mihoyonet.dll"),
// );
if !alt_replaced {
return false;
}
// if !alt_replaced {
// return false;
// }
/*** For replacing old backup file with new one, for example when version changes
* Currently replaces when it shouldn't. Will figure it out when it matters
* ***/
// else {
// // Check if game file matches backup
// let matching_alt_backup = file_helpers::are_files_identical(
// &backup_path.clone(),
// PathBuf::from(get_game_rsa_path().await.unwrap())
// .join("/GenshinImpact_Data/Plugins/mihoyonet.dll")
// .to_str()
// .unwrap(),
// );
/*** For replacing old backup file with new one, for example when version changes
* Currently replaces when it shouldn't. Will figure it out when it matters
* ***/
// else {
// // Check if game file matches backup
// let matching_alt_backup = file_helpers::are_files_identical(
// &backup_path.clone(),
// PathBuf::from(get_game_rsa_path().await.unwrap())
// .join("/GenshinImpact_Data/Plugins/mihoyonet.dll")
// .to_str()
// .unwrap(),
// );
// let is_alt_patched = file_helpers::are_files_identical(
// PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll").to_str().unwrap(),
// PathBuf::from(get_game_rsa_path().await.unwrap())
// .join("/GenshinImpact_Data/Plugins/mihoyonet.dll")
// .to_str()
// .unwrap(),
// );
// let is_alt_patched = file_helpers::are_files_identical(
// PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll").to_str().unwrap(),
// PathBuf::from(get_game_rsa_path().await.unwrap())
// .join("/GenshinImpact_Data/Plugins/mihoyonet.dll")
// .to_str()
// .unwrap(),
// );
// // Check if already alt patched
// if !matching_alt_backup {
// // Copy new backup if it is not patched
// if !is_alt_patched {
// file_helpers::copy_file_with_new_name(
// get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"),
// alt_patch_path.clone().to_str().unwrap().to_string(),
// String::from("original-mihoyonet.dll"),
// );
// }
// }
// }
}
// // Check if already alt patched
// if !matching_alt_backup {
// // Copy new backup if it is not patched
// if !is_alt_patched {
// file_helpers::copy_file_with_new_name(
// get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"),
// alt_patch_path.clone().to_str().unwrap().to_string(),
// String::from("original-mihoyonet.dll"),
// );
// }
// }
// }
// }
// Standard patch
patch_path = PathBuf::from(system_helpers::install_location()).join("patch/version.dll");

View File

@@ -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

View File

@@ -7,7 +7,7 @@
},
"package": {
"productName": "Cultivation",
"version": "1.5.2"
"version": "1.5.7"
},
"tauri": {
"allowlist": {

View File

@@ -149,7 +149,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
// Connect to proxy
if (config.toggle_grasscutter) {
const game_exe = await getGameExecutable()
let newerGame = false
const newerGame = false
const patchable = game_exe?.toLowerCase().includes('yuanshen') || game_exe?.toLowerCase().includes('genshin')
@@ -183,35 +183,36 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
const versionString = gameVersion?.major.toString() + gameVersion?.minor.toString()
if ((gameVersion?.major == 4 && gameVersion?.minor > 5) || config.newer_game) {
newerGame = true
// Keeps being misused, remove for now.
// if ((gameVersion?.major == 4 && gameVersion?.minor > 5) || config.newer_game) {
// newerGame = true
const path = (await invoke('install_location')) as string
// const path = (await invoke('install_location')) as string
const patchstring = '\\altpatch\\'
const altPatch = path + patchstring
// const patchstring = '\\altpatch\\'
// const altPatch = path + patchstring
const ALT_PATCH =
'https://autopatchhk.yuanshen.com/client_app/download/pc_zip/20231030132335_iOEfPMcbrXpiA8Ca/ScatteredFiles/GenshinImpact_Data/Plugins/mihoyonet.dll'
const pExists = (await invoke('dir_exists', {
path: altPatch,
})) as boolean
// const ALT_PATCH =
// 'https://autopatchhk.yuanshen.com/client_app/download/pc_zip/20231030132335_iOEfPMcbrXpiA8Ca/ScatteredFiles/GenshinImpact_Data/Plugins/mihoyonet.dll'
// const pExists = (await invoke('dir_exists', {
// path: altPatch,
// })) as boolean
if (!pExists) {
await invoke('dir_create', {
path: altPatch,
})
this.props.downloadHandler.addDownload(ALT_PATCH, path + '/altpatch/mihoyonet.dll')
await confirm('Please wait for the download in the bottom left to disappear, then click yes')
}
// if (!pExists) {
// await invoke('dir_create', {
// path: altPatch,
// })
// this.props.downloadHandler.addDownload(ALT_PATCH, path + '/altpatch/mihoyonet.dll')
// await confirm('Please wait for the download in the bottom left to disappear, then click yes')
// }
/* For custom address patch only, used in 4.5 */
// let httpString = 'http://'
// if (this.state.httpsEnabled) {
// httpString = 'https://'
// }
// config.launch_args = '-server=' + httpString + this.state.ip + ':' + this.state.port
}
// /* For custom address patch only, used in 4.5 */
// // let httpString = 'http://'
// // if (this.state.httpsEnabled) {
// // httpString = 'https://'
// // }
// // config.launch_args = '-server=' + httpString + this.state.ip + ':' + this.state.port
// }
const patched = await patchGame(newerGame, versionString)
@@ -278,6 +279,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', {

View File

@@ -16,7 +16,7 @@ import { ask } from '@tauri-apps/api/dialog'
const FULL_BUILD_DOWNLOAD = 'https://github.com/NotThorny/Grasscutter/releases/download/culti-aio/GrasscutterCulti.zip' // Change to link that can be updated without modifying here
const FULL_QUEST_DOWNLOAD = 'https://github.com/NotThorny/Grasscutter/releases/download/culti-aio/GrasscutterQuests.zip'
const FULL_50_DOWNLOAD = 'https://github.com/NotThorny/Grasscutter/releases/download/culti-aio/GrasscutterLunaGC50.zip' // https://github.com/Kei-Luna/LunaGC_5.0.0
const FULL_50_DOWNLOAD = 'https://github.com/NotThorny/Grasscutter/releases/download/culti-aio/GrasscutterLunaGC54.zip' // https://github.com/pmagixc/LunaGC_5.4.0
const STABLE_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/stable.zip'
const DEV_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/development.zip'
const UNSTABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/unstable/Grasscutter.zip'

View File

@@ -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() {

View File

@@ -712,7 +712,7 @@ export default class Options extends React.Component<IProps, IState> {
</div>
</div>
<div className="OptionSection" id="menuOptionsContainerNewerGame">
{/* <div className="OptionSection" id="menuOptionsContainerNewerGame">
<div className="OptionLabel" id="menuOptionsLabelNewerGame">
<Tr text="Patch Mihoyonet" />
</div>
@@ -723,7 +723,7 @@ export default class Options extends React.Component<IProps, IState> {
id="newerGame"
/>
</div>
</div>
</div> */}
<Divider />

View File

@@ -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.2
version: Grasscutter 1.7.4 - Cultivation 1.5.7
</td>
</tr>
)