Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
a9879817c9 Bump http-proxy-middleware from 2.0.6 to 2.0.7
Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-31 08:05:35 +00:00
40 changed files with 189 additions and 527 deletions

1
.gitignore vendored
View File

@@ -10,7 +10,6 @@
# production # production
/build /build
/target
# misc # misc
.DS_Store .DS_Store

View File

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

2
src-tauri/Cargo.lock generated
View File

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

View File

@@ -1,13 +1,13 @@
[package] [package]
name = "cultivation" name = "cultivation"
version = "1.6.3" version = "1.5.1"
description = "A custom launcher for anime game." description = "A custom launcher for anime game."
authors = ["KingRainbow44", "SpikeHD"] authors = ["KingRainbow44", "SpikeHD"]
license = "" license = ""
repository = "https://github.com/Grasscutters/Cultivation.git" repository = "https://github.com/Grasscutters/Cultivation.git"
default-run = "cultivation" default-run = "cultivation"
edition = "2021" edition = "2021"
rust-version = "1.57" rust-version = "1.58"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "简体中文", "lang_name": "简体中文",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "启动", "launch_button": "启动",
"gc_enable": "以 Grasscutter 模式连接", "gc_enable": "以 Grasscutter 模式连接",
"https_enable": "使用 HTTPS", "https_enable": "使用 HTTPS",
@@ -37,13 +37,11 @@
"web_cache": "删除 webCaches 文件夹", "web_cache": "删除 webCaches 文件夹",
"launch_args": "启动参数", "launch_args": "启动参数",
"offline_mode": "离线模式", "offline_mode": "离线模式",
"fix_res": "修复登录超时", "fix_res": "修复登录超时"
"show_version": "在按钮上显示游戏版本",
"save_profile": "保存配置配置文件"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "下载 Grasscutter 一体化", "grasscutter_fullbuild": "下载 Grasscutter 一体化",
"grasscutter_fullquest": "下载 6.1 一体化", "grasscutter_fullquest": "下载 5.0 一体化",
"grasscutter_stable_data": "下载 Grasscutter 稳定版数据", "grasscutter_stable_data": "下载 Grasscutter 稳定版数据",
"grasscutter_latest_data": "下载 Grasscutter 开发版数据", "grasscutter_latest_data": "下载 Grasscutter 开发版数据",
"grasscutter_stable_data_update": "更新 Grasscutter 稳定版数据", "grasscutter_stable_data_update": "更新 Grasscutter 稳定版数据",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "繁體中文", "lang_name": "繁體中文",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "啟動", "launch_button": "啟動",
"gc_enable": "以Grasscutter模式連接", "gc_enable": "以Grasscutter模式連接",
"https_enable": "使用 HTTPS", "https_enable": "使用 HTTPS",
@@ -37,13 +37,11 @@
"web_cache": "刪除 webCaches 文件夾", "web_cache": "刪除 webCaches 文件夾",
"launch_args": "啟動參數", "launch_args": "啟動參數",
"offline_mode": "離線模式", "offline_mode": "離線模式",
"fix_res": "修復登入逾時", "fix_res": "修復登入逾時"
"show_version": "在按鈕上顯示遊戲版本",
"save_profile": "儲存配置設定檔"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "下載Grasscutter多合一下載", "grasscutter_fullbuild": "下載Grasscutter多合一下載",
"grasscutter_fullquest": "下载 6.1 一体化", "grasscutter_fullquest": "下载 5.0 一体化",
"grasscutter_stable_data": "下載Grasscutter穩定版數據Data", "grasscutter_stable_data": "下載Grasscutter穩定版數據Data",
"grasscutter_latest_data": "下載Grasscutter開發板數據Data", "grasscutter_latest_data": "下載Grasscutter開發板數據Data",
"grasscutter_stable_data_update": "更新Grasscutter穩定版數據Data", "grasscutter_stable_data_update": "更新Grasscutter穩定版數據Data",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "Deutsch", "lang_name": "Deutsch",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Starten", "launch_button": "Starten",
"gc_enable": "Mit Grasscutter verbinden", "gc_enable": "Mit Grasscutter verbinden",
"https_enable": "HTTPS verwenden", "https_enable": "HTTPS verwenden",
@@ -39,13 +39,11 @@
"web_cache": "WebCaches-Ordner löschen", "web_cache": "WebCaches-Ordner löschen",
"launch_args": "Start-Argumente", "launch_args": "Start-Argumente",
"offline_mode": "Offline-Modus", "offline_mode": "Offline-Modus",
"fix_res": "Login-Zeitüberschreitung beheben", "fix_res": "Login-Zeitüberschreitung beheben"
"show_version": "Spielversion in Schaltflächen anzeigen",
"save_profile": "Profil speichern"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Grasscutter All-in-One herunterladen", "grasscutter_fullbuild": "Grasscutter All-in-One herunterladen",
"grasscutter_fullquest": "6.1 All-in-One herunterladen", "grasscutter_fullquest": "5.0 All-in-One herunterladen",
"grasscutter_stable_data": "Stabile Grasscutter-Daten herunterladen", "grasscutter_stable_data": "Stabile Grasscutter-Daten herunterladen",
"grasscutter_latest_data": "Neueste Grasscutter-Daten herunterladen", "grasscutter_latest_data": "Neueste Grasscutter-Daten herunterladen",
"grasscutter_stable_data_update": "Stabile Grasscutter-Daten aktualisieren", "grasscutter_stable_data_update": "Stabile Grasscutter-Daten aktualisieren",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "English", "lang_name": "English",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Launch", "launch_button": "Launch",
"gc_enable": "Connect to Grasscutter", "gc_enable": "Connect to Grasscutter",
"https_enable": "Use HTTPS", "https_enable": "Use HTTPS",
@@ -39,13 +39,11 @@
"web_cache": "Delete webCaches folder", "web_cache": "Delete webCaches folder",
"launch_args": "Launch Args", "launch_args": "Launch Args",
"offline_mode": "Offline Mode", "offline_mode": "Offline Mode",
"fix_res": "Fix Login Timeout", "fix_res": "Fix Login Timeout"
"show_version": "Show game version in buttons",
"save_profile": "Save profile"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Download Grasscutter 4.0 All-in-One", "grasscutter_fullbuild": "Download Grasscutter All-in-One",
"grasscutter_fullquest": "Download 6.1 All-in-One", "grasscutter_fullquest": "Download 5.0 All-in-One",
"grasscutter_stable_data": "Download Grasscutter Stable Data", "grasscutter_stable_data": "Download Grasscutter Stable Data",
"grasscutter_latest_data": "Download Grasscutter Latest Data", "grasscutter_latest_data": "Download Grasscutter Latest Data",
"grasscutter_stable_data_update": "Update Grasscutter Stable Data", "grasscutter_stable_data_update": "Update Grasscutter Stable Data",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "Español", "lang_name": "Español",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Launch", "launch_button": "Launch",
"gc_enable": "Conectar Via Grasscutter", "gc_enable": "Conectar Via Grasscutter",
"https_enable": "Usar HTTPS", "https_enable": "Usar HTTPS",
@@ -37,13 +37,11 @@
"web_cache": "Eliminar la carpeta webCaches", "web_cache": "Eliminar la carpeta webCaches",
"launch_args": "Args de lanzamiento", "launch_args": "Args de lanzamiento",
"offline_mode": "Modo sin conexión", "offline_mode": "Modo sin conexión",
"fix_res": "Reparar el tiempo de espera", "fix_res": "Reparar el tiempo de espera"
"show_version": "Mostrar versión del juego en botones",
"save_profile": "Guardar perfil"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Descargar datos todo en uno de Grasscutter", "grasscutter_fullbuild": "Descargar datos todo en uno de Grasscutter",
"grasscutter_fullquest": "Descargar datos todo en uno de 6.1", "grasscutter_fullquest": "Descargar datos todo en uno de 5.0",
"grasscutter_stable_data": "Descargar datos Estables de Grasscutter", "grasscutter_stable_data": "Descargar datos Estables de Grasscutter",
"grasscutter_latest_data": "Descargar datos más Recientes de Grasscutter", "grasscutter_latest_data": "Descargar datos más Recientes de Grasscutter",
"grasscutter_stable_data_update": "Actualizar datos estables de Grasscutter", "grasscutter_stable_data_update": "Actualizar datos estables de Grasscutter",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "Francais", "lang_name": "Francais",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Lancer", "launch_button": "Lancer",
"gc_enable": "Se connecter avec Grasscutter", "gc_enable": "Se connecter avec Grasscutter",
"https_enable": "Utiliser HTTPS", "https_enable": "Utiliser HTTPS",
@@ -37,13 +37,11 @@
"web_cache": "Supprimer le dossier webCaches", "web_cache": "Supprimer le dossier webCaches",
"launch_args": "Arguments de lancement", "launch_args": "Arguments de lancement",
"offline_mode": "Mode hors ligne", "offline_mode": "Mode hors ligne",
"fix_res": "Réparation du login", "fix_res": "Réparation du login"
"show_version": "Afficher la version du jeu sur les boutons",
"save_profile": "Enregistrer le profil"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Telecharger Grasscutter tout-en-un", "grasscutter_fullbuild": "Telecharger Grasscutter tout-en-un",
"grasscutter_fullquest": "Télécharger les 6.1 tout-en-un", "grasscutter_fullquest": "Télécharger les 5.0 tout-en-un",
"grasscutter_stable_data": "Télécharger les donnees de Grasscutter (version stable)", "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_latest_data": "Télécharger les donnees de Grasscutter (derniere version)",
"grasscutter_stable_data_update": "Mettre à jour les données de Grasscutter (version stable)", "grasscutter_stable_data_update": "Mettre à jour les données de Grasscutter (version stable)",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "Indonesia", "lang_name": "Indonesia",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Luncurkan", "launch_button": "Luncurkan",
"gc_enable": "Terhubung Melalui GrassCutter", "gc_enable": "Terhubung Melalui GrassCutter",
"ip_placeholder": "Alamat Server...", "ip_placeholder": "Alamat Server...",
@@ -36,13 +36,11 @@
"web_cache": "Hapus folder webCaches", "web_cache": "Hapus folder webCaches",
"launch_args": "Luncurkan Args", "launch_args": "Luncurkan Args",
"offline_mode": "Mode Offline", "offline_mode": "Mode Offline",
"fix_res": "Perbaiki batas waktu login", "fix_res": "Perbaiki batas waktu login"
"show_version": "Tampilkan versi game pada tombol",
"save_profile": "Simpan profil"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Sedang Mendownload Grasscutter Semua Dalam Satu", "grasscutter_fullbuild": "Sedang Mendownload Grasscutter Semua Dalam Satu",
"grasscutter_fullquest": "Unduh 6.1 semua dalam satu", "grasscutter_fullquest": "Unduh 5.0 semua dalam satu",
"grasscutter_stable_data": "Sedang Mendownload Grasscutter Versi Stabil", "grasscutter_stable_data": "Sedang Mendownload Grasscutter Versi Stabil",
"grasscutter_latest_data": "Sedang Mendownload Grasscutter Data Terbaru", "grasscutter_latest_data": "Sedang Mendownload Grasscutter Data Terbaru",
"grasscutter_stable_data_update": "Memperbaharui Grasscutter Data Stabil", "grasscutter_stable_data_update": "Memperbaharui Grasscutter Data Stabil",

View File

@@ -37,13 +37,11 @@
"web_cache": "Elimina la cartella webCaches", "web_cache": "Elimina la cartella webCaches",
"launch_args": "Argomenti di lancio", "launch_args": "Argomenti di lancio",
"offline_mode": "Modalità Offline", "offline_mode": "Modalità Offline",
"fix_res": "Correggere il timeout dell'accesso", "fix_res": "Correggere il timeout dell'accesso"
"show_version": "Mostra la versione del gioco sui pulsanti",
"save_profile": "Salva il profilo"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Scarica Grasscutter Tutto-in-Uno", "grasscutter_fullbuild": "Scarica Grasscutter Tutto-in-Uno",
"grasscutter_fullquest": "Scarica 6.1 Tutto-in-Uno", "grasscutter_fullquest": "Scarica 5.0 Tutto-in-Uno",
"grasscutter_stable_data": "Scarica i dati di Grasscutter Stabili", "grasscutter_stable_data": "Scarica i dati di Grasscutter Stabili",
"grasscutter_latest_data": "Scarica i dati di Grasscutter Più Recenti", "grasscutter_latest_data": "Scarica i dati di Grasscutter Più Recenti",
"grasscutter_stable_data_update": "Aggiorna i dati di Grasscutter Stabili", "grasscutter_stable_data_update": "Aggiorna i dati di Grasscutter Stabili",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "日本語", "lang_name": "日本語",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "起動", "launch_button": "起動",
"gc_enable": "Grasscutterに接続", "gc_enable": "Grasscutterに接続",
"https_enable": "HTTPS接続を使用", "https_enable": "HTTPS接続を使用",
@@ -37,13 +37,11 @@
"check_aagl": "その他のオプションは、他のランチャーをチェックしてください", "check_aagl": "その他のオプションは、他のランチャーをチェックしてください",
"grasscutter_elevation": "制限されたポートでのGCの実行方法", "grasscutter_elevation": "制限されたポートでのGCの実行方法",
"web_cache": "webCachesフォルダを削除", "web_cache": "webCachesフォルダを削除",
"launch_args": "Launch Args", "launch_args": "Launch Args"
"show_version": "ボタンにゲームバージョンを表示",
"save_profile": "プロフィールを保存"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Grasscutter All-in-Oneをダウンロード", "grasscutter_fullbuild": "Grasscutter All-in-Oneをダウンロード",
"grasscutter_fullquest": "6.1 All-in-Oneをダウンロード", "grasscutter_fullquest": "Questing All-in-Oneをダウンロード",
"grasscutter_stable_data": "Grasscutter安定版データファイルをダウンロード", "grasscutter_stable_data": "Grasscutter安定版データファイルをダウンロード",
"grasscutter_latest_data": "Grasscutter最新版データファイルをダウンロード", "grasscutter_latest_data": "Grasscutter最新版データファイルをダウンロード",
"grasscutter_stable_data_update": "Grasscutter安定版データファイルをアップデート", "grasscutter_stable_data_update": "Grasscutter安定版データファイルをアップデート",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "한국어", "lang_name": "한국어",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "게임 시작", "launch_button": "게임 시작",
"gc_enable": "Grasscutter 연결", "gc_enable": "Grasscutter 연결",
"https_enable": "HTTPS 사용", "https_enable": "HTTPS 사용",
@@ -37,13 +37,11 @@
"web_cache": "webCaches 폴더 삭제", "web_cache": "webCaches 폴더 삭제",
"launch_args": "실행 인수", "launch_args": "실행 인수",
"offline_mode": "오프라인 모드", "offline_mode": "오프라인 모드",
"fix_res": "로그인 시간 초과 수정", "fix_res": "로그인 시간 초과 수정"
"show_version": "버튼에 게임 버전 표시",
"save_profile": "프로필 저장"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "올인원 Grasscutter 다운로드", "grasscutter_fullbuild": "올인원 Grasscutter 다운로드",
"grasscutter_fullquest": "6.1 올인원 다운로드", "grasscutter_fullquest": "5.0 올인원 다운로드",
"grasscutter_stable_data": "안정적인 데이터 다운로드", "grasscutter_stable_data": "안정적인 데이터 다운로드",
"grasscutter_latest_data": "최신 데이터 다운로드", "grasscutter_latest_data": "최신 데이터 다운로드",
"grasscutter_stable_data_update": "안정적 데이터 업데이트", "grasscutter_stable_data_update": "안정적 데이터 업데이트",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "Latviešu", "lang_name": "Latviešu",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Palaist", "launch_button": "Palaist",
"gc_enable": "Savienot ar Grasscutter", "gc_enable": "Savienot ar Grasscutter",
"https_enable": "Izm. HTTPS", "https_enable": "Izm. HTTPS",
@@ -35,13 +35,11 @@
"web_cache": "Dzēsiet mapi WebCaches", "web_cache": "Dzēsiet mapi WebCaches",
"launch_args": "Palaišanas args", "launch_args": "Palaišanas args",
"offline_mode": "Bezsaistes režīms", "offline_mode": "Bezsaistes režīms",
"fix_res": "Fiksēt pieteikšanās laika", "fix_res": "Fiksēt pieteikšanās laika"
"show_version": "Pogās redzamā spēles versija",
"save_profile": "Saglabāt profilu"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Lejupielādējiet Grasscutter viss vienā", "grasscutter_fullbuild": "Lejupielādējiet Grasscutter viss vienā",
"grasscutter_fullquest": "Lejupielādēt 6.1 viss vienā", "grasscutter_fullquest": "Lejupielādēt 5.0 viss vienā",
"grasscutter_stable_data": "Lejupielādējiet Grasscutter stabilos datus", "grasscutter_stable_data": "Lejupielādējiet Grasscutter stabilos datus",
"grasscutter_latest_data": "Lejupielādējiet Grasscutter jaunākos datus", "grasscutter_latest_data": "Lejupielādējiet Grasscutter jaunākos datus",
"grasscutter_stable_data_update": "Atjauniniet Grasscutter stabilos datus", "grasscutter_stable_data_update": "Atjauniniet Grasscutter stabilos datus",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "Nederlands", "lang_name": "Nederlands",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Start", "launch_button": "Start",
"gc_enable": "Verbind Met Grasscutter", "gc_enable": "Verbind Met Grasscutter",
"https_enable": "Gebruik HTTPS", "https_enable": "Gebruik HTTPS",
@@ -36,13 +36,11 @@
"web_cache": "Verwijder de webCaches-map", "web_cache": "Verwijder de webCaches-map",
"launch_args": "Args starten", "launch_args": "Args starten",
"offline_mode": "Offline Modus", "offline_mode": "Offline Modus",
"fix_res": "Time-out inloggen verhelpen", "fix_res": "Time-out inloggen verhelpen"
"show_version": "Spelversie weergegeven op knoppen",
"save_profile": "Profiel opslaan"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Grasscutter Alles-in-één Downloaden", "grasscutter_fullbuild": "Grasscutter Alles-in-één Downloaden",
"grasscutter_fullquest": "Alles-in-één 6.1 downloaden", "grasscutter_fullquest": "Alles-in-één 5.0 downloaden",
"grasscutter_stable_data": "Download Stabiele Gegevens Van Grasscutter", "grasscutter_stable_data": "Download Stabiele Gegevens Van Grasscutter",
"grasscutter_latest_data": "Download De Nieuwste Gegevens Van Grasscutter", "grasscutter_latest_data": "Download De Nieuwste Gegevens Van Grasscutter",
"grasscutter_stable_data_update": "Stabiele gegevens Van Grasscutter bijwerken", "grasscutter_stable_data_update": "Stabiele gegevens Van Grasscutter bijwerken",

View File

@@ -39,13 +39,11 @@
"web_cache": "Usuń folder webCaches", "web_cache": "Usuń folder webCaches",
"launch_args": "Argumenty uruchamiania", "launch_args": "Argumenty uruchamiania",
"offline_mode": "Tryb offline", "offline_mode": "Tryb offline",
"fix_res": "Napraw limit czasu logowania", "fix_res": "Napraw limit czasu logowania"
"show_version": "Wersja gry wyświetlana na przyciskach",
"save_profile": "Zapisz profil"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Pobierz Grasscutter (wszystko w jednym)", "grasscutter_fullbuild": "Pobierz Grasscutter (wszystko w jednym)",
"grasscutter_fullquest": "Pobierz 6.1 (wszystko w jednym)", "grasscutter_fullquest": "Pobierz 5.0 (wszystko w jednym)",
"grasscutter_stable_data": "Pobierz stabilne dane Grasscuttera", "grasscutter_stable_data": "Pobierz stabilne dane Grasscuttera",
"grasscutter_latest_data": "Pobierz najnowsze dane Grasscuttera", "grasscutter_latest_data": "Pobierz najnowsze dane Grasscuttera",
"grasscutter_stable_data_update": "Zaaktualizuj stabilne dane Grasscuttera", "grasscutter_stable_data_update": "Zaaktualizuj stabilne dane Grasscuttera",

View File

@@ -37,13 +37,11 @@
"web_cache": "Excluir pasta webCaches", "web_cache": "Excluir pasta webCaches",
"launch_args": "Argumentos de lançamento", "launch_args": "Argumentos de lançamento",
"offline_mode": "Modo offline", "offline_mode": "Modo offline",
"fix_res": "Corrigir o tempo limite de login", "fix_res": "Corrigir o tempo limite de login"
"show_version": "Versão do jogo exibida nos botões",
"save_profile": "Salvar perfil"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Baixar o Grasscutter Tudo-em-Um", "grasscutter_fullbuild": "Baixar o Grasscutter Tudo-em-Um",
"grasscutter_fullquest": "Baixar de 6.1 em um só lugar", "grasscutter_fullquest": "Baixar de 5.0 em um só lugar",
"grasscutter_stable_data": "Baixar os Dados do Grasscutter Estável", "grasscutter_stable_data": "Baixar os Dados do Grasscutter Estável",
"grasscutter_latest_data": "Baixar os Dados do Grasscutter Mais Recente", "grasscutter_latest_data": "Baixar os Dados do Grasscutter Mais Recente",
"grasscutter_stable_data_update": "Atualizar os Dados do Grasscutter Estável", "grasscutter_stable_data_update": "Atualizar os Dados do Grasscutter Estável",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "Русский", "lang_name": "Русский",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Запустить", "launch_button": "Запустить",
"gc_enable": "Подключиться с Grasscutter", "gc_enable": "Подключиться с Grasscutter",
"https_enable": "Исп. HTTPS", "https_enable": "Исп. HTTPS",
@@ -36,13 +36,11 @@
"web_cache": "Удалить папку webCaches", "web_cache": "Удалить папку webCaches",
"launch_args": "Параметры запуска", "launch_args": "Параметры запуска",
"offline_mode": "Автономный режим", "offline_mode": "Автономный режим",
"fix_res": "Исправить таймаут входа в систему", "fix_res": "Исправить таймаут входа в систему"
"show_version": "Версия игры отображается на кнопках",
"save_profile": "Сохранить профиль"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Скачать все в одном Grasscutter", "grasscutter_fullbuild": "Скачать все в одном Grasscutter",
"grasscutter_fullquest": "Скачать 6.1 все в одном", "grasscutter_fullquest": "Скачать 5.0 все в одном",
"grasscutter_stable_data": "Скачать стабильные данные Grasscutter", "grasscutter_stable_data": "Скачать стабильные данные Grasscutter",
"grasscutter_latest_data": "Скачать последние данные Grasscutter", "grasscutter_latest_data": "Скачать последние данные Grasscutter",
"grasscutter_stable_data_update": "Обновить стабильные данные Grasscutter", "grasscutter_stable_data_update": "Обновить стабильные данные Grasscutter",

View File

@@ -1,7 +1,7 @@
{ {
"lang_name": "Tiếng Việt", "lang_name": "Tiếng Việt",
"main": { "main": {
"title": "Cultivation: Thorny Edition", "title": "Cultivation",
"launch_button": "Khởi Chạy", "launch_button": "Khởi Chạy",
"gc_enable": "Kết nối qua Grasscutter", "gc_enable": "Kết nối qua Grasscutter",
"https_enable": "Dùng HTTPS", "https_enable": "Dùng HTTPS",
@@ -37,13 +37,11 @@
"web_cache": "Xóa thư mục webCaches", "web_cache": "Xóa thư mục webCaches",
"launch_args": "Khởi chạy đối số", "launch_args": "Khởi chạy đối số",
"offline_mode": "Chế độ ngoại tuyến", "offline_mode": "Chế độ ngoại tuyến",
"fix_res": "Sửa lỗi hết thời gian đăng nhập", "fix_res": "Sửa lỗi hết thời gian đăng nhập"
"show_version": "Hiển thị phiên bản trò chơi trên các nút",
"save_profile": "Lưu hồ sơ"
}, },
"downloads": { "downloads": {
"grasscutter_fullbuild": "Tải Grasscutter tất cả trong một", "grasscutter_fullbuild": "Tải Grasscutter tất cả trong một",
"grasscutter_fullquest": "Tải 6.1 tất cả trong một", "grasscutter_fullquest": "Tải 5.0 tất cả trong một",
"grasscutter_stable_data": "Tải dữ liệu Grasscutter bản ổn định", "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_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", "grasscutter_stable_data_update": "Cập nhật dữ liệu Grasscutter bản ổn định",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -30,33 +30,20 @@ pub struct Configuration {
pub redirect_more: Option<bool>, pub redirect_more: Option<bool>,
pub launch_args: Option<String>, pub launch_args: Option<String>,
pub offline_mode: Option<bool>, pub offline_mode: Option<bool>,
pub show_version: Option<bool>,
pub profile: Option<String>,
} }
pub fn config_path(profile: String) -> PathBuf { pub fn config_path() -> PathBuf {
let mut path = tauri::api::path::data_dir().unwrap(); let mut path = tauri::api::path::data_dir().unwrap();
path.push("cultivation"); path.push("cultivation");
if profile.as_str() == "default" { path.push("configuration.json");
path.push("configuration.json");
} else {
path.push("profiles");
path.push(profile + ".json");
}
path path
} }
pub fn get_config(profile_name: String) -> Configuration { pub fn get_config() -> Configuration {
let path = config_path(profile_name.clone()); let path = config_path();
let config = std::fs::read_to_string(path).unwrap_or("{}".to_string()); let config = std::fs::read_to_string(path).unwrap_or("{}".to_string());
let config: Configuration = serde_json::from_str(&config).unwrap_or_default(); let config: Configuration = serde_json::from_str(&config).unwrap_or_default();
//let default = String::from("default");
let prof = config.profile.clone().unwrap_or_default();
if prof != String::from("default") && prof != profile_name.clone() {
return get_config(prof.clone());
}
config config
} }

View File

@@ -101,7 +101,7 @@ async fn parse_args(inp: &Vec<String>) -> Result<Args, ArgsError> {
args.parse(inp).unwrap(); args.parse(inp).unwrap();
let config = config::get_config(String::from("default")); let config = config::get_config();
if args.value_of("help")? { if args.value_of("help")? {
println!("{}", args.full_usage()); println!("{}", args.full_usage());
@@ -207,10 +207,8 @@ fn main() -> Result<(), ArgsError> {
is_grasscutter_running, is_grasscutter_running,
restart_grasscutter, restart_grasscutter,
get_theme_list, get_theme_list,
get_profile_list,
system_helpers::run_command, system_helpers::run_command,
system_helpers::run_program, system_helpers::run_program,
system_helpers::run_program_args,
system_helpers::run_program_relative, system_helpers::run_program_relative,
system_helpers::start_service, system_helpers::start_service,
system_helpers::service_status, system_helpers::service_status,
@@ -537,20 +535,3 @@ async fn get_theme_list(data_dir: String) -> Vec<HashMap<String, String>> {
themes themes
} }
#[tauri::command]
async fn get_profile_list(data_dir: String) -> Vec<String> {
let profile_loc = format!("{}/profiles", data_dir);
// Ensure folder exists
if !std::path::Path::new(&profile_loc).exists() {
std::fs::create_dir_all(&profile_loc).unwrap();
}
let mut p_list = Vec::new();
for entry in std::fs::read_dir(&profile_loc).unwrap() {
p_list.push(entry.unwrap().file_name().into_string().unwrap());
}
p_list
}

View File

@@ -50,80 +50,79 @@ struct WhatToUnpach {
#[cfg(windows)] #[cfg(windows)]
#[tauri::command] #[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; let mut patch_path;
// Altpatch first - Now using as hoyonet switch // Altpatch first - Now using as hoyonet switch
// People keep using this when they shouldn't, 99.8% of people will never need it. Just remove for now. if newer_game {
// if newer_game { let alt_patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch");
// let alt_patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch");
// // Should handle overwriting backup with new version backup later // Should handle overwriting backup with new version backup later
// let backup_path = PathBuf::from(system_helpers::install_location()) let backup_path = PathBuf::from(system_helpers::install_location())
// .join("altpatch/original-mihoyonet.dll") .join("altpatch/original-mihoyonet.dll")
// .to_str() .to_str()
// .unwrap() .unwrap()
// .to_string(); .to_string();
// let backup_exists = file_helpers::does_file_exist(&backup_path); let backup_exists = file_helpers::does_file_exist(&backup_path);
// if !backup_exists { if !backup_exists {
// let backup = file_helpers::copy_file_with_new_name( let backup = file_helpers::copy_file_with_new_name(
// get_game_rsa_path().await.unwrap() get_game_rsa_path().await.unwrap()
// + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"), + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"),
// alt_patch_path.clone().to_str().unwrap().to_string(), alt_patch_path.clone().to_str().unwrap().to_string(),
// String::from("original-mihoyonet.dll"), String::from("original-mihoyonet.dll"),
// ); );
// if !backup { if !backup {
// println!("Unable to backup file!"); println!("Unable to backup file!");
// } }
// } }
// patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll"); patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll");
// // Copy the other part of patch to game files // Copy the other part of patch to game files
// let alt_replaced = file_helpers::copy_file_with_new_name( let alt_replaced = file_helpers::copy_file_with_new_name(
// patch_path.clone().to_str().unwrap().to_string(), patch_path.clone().to_str().unwrap().to_string(),
// get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins"), get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins"),
// String::from("mihoyonet.dll"), String::from("mihoyonet.dll"),
// ); );
// if !alt_replaced { if !alt_replaced {
// return false; return false;
// } }
/*** For replacing old backup file with new one, for example when version changes /*** 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 * Currently replaces when it shouldn't. Will figure it out when it matters
* ***/ * ***/
// else { // else {
// // Check if game file matches backup // // Check if game file matches backup
// let matching_alt_backup = file_helpers::are_files_identical( // let matching_alt_backup = file_helpers::are_files_identical(
// &backup_path.clone(), // &backup_path.clone(),
// PathBuf::from(get_game_rsa_path().await.unwrap()) // PathBuf::from(get_game_rsa_path().await.unwrap())
// .join("/GenshinImpact_Data/Plugins/mihoyonet.dll") // .join("/GenshinImpact_Data/Plugins/mihoyonet.dll")
// .to_str() // .to_str()
// .unwrap(), // .unwrap(),
// ); // );
// let is_alt_patched = file_helpers::are_files_identical( // let is_alt_patched = file_helpers::are_files_identical(
// PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll").to_str().unwrap(), // PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll").to_str().unwrap(),
// PathBuf::from(get_game_rsa_path().await.unwrap()) // PathBuf::from(get_game_rsa_path().await.unwrap())
// .join("/GenshinImpact_Data/Plugins/mihoyonet.dll") // .join("/GenshinImpact_Data/Plugins/mihoyonet.dll")
// .to_str() // .to_str()
// .unwrap(), // .unwrap(),
// ); // );
// // Check if already alt patched // // Check if already alt patched
// if !matching_alt_backup { // if !matching_alt_backup {
// // Copy new backup if it is not patched // // Copy new backup if it is not patched
// if !is_alt_patched { // if !is_alt_patched {
// file_helpers::copy_file_with_new_name( // file_helpers::copy_file_with_new_name(
// get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"), // get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"),
// alt_patch_path.clone().to_str().unwrap().to_string(), // alt_patch_path.clone().to_str().unwrap().to_string(),
// String::from("original-mihoyonet.dll"), // String::from("original-mihoyonet.dll"),
// ); // );
// } // }
// } // }
// } // }
// } }
// Standard patch // Standard patch
patch_path = PathBuf::from(system_helpers::install_location()).join("patch/version.dll"); patch_path = PathBuf::from(system_helpers::install_location()).join("patch/version.dll");
@@ -153,14 +152,8 @@ pub async fn patch_game(_newer_game: bool, version: String) -> bool {
return true; return true;
} }
// For 5.0 and up use universal // For 5.0 and up
if i_ver > 49 { if i_ver > 49 {
if i_ver < 59 {
patch_path = PathBuf::from(system_helpers::install_location()).join("patch/5version.dll");
} else {
// 6.0 patch not checked/tested if works for old vers, so separate
patch_path = PathBuf::from(system_helpers::install_location()).join("patch/6version.dll");
}
let replaced50 = file_helpers::copy_file_with_new_name( let replaced50 = file_helpers::copy_file_with_new_name(
patch_path.clone().to_str().unwrap().to_string(), patch_path.clone().to_str().unwrap().to_string(),
get_game_rsa_path().await.unwrap(), get_game_rsa_path().await.unwrap(),
@@ -349,7 +342,7 @@ pub async fn unpatch_game() -> bool {
} }
pub async fn get_game_rsa_path() -> Option<String> { pub async fn get_game_rsa_path() -> Option<String> {
let config = config::get_config(String::from("default")); let config = config::get_config();
config.game_install_path.as_ref()?; config.game_install_path.as_ref()?;

View File

@@ -108,18 +108,6 @@ 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] #[tauri::command]
pub fn run_program(path: String, args: Option<String>) { pub fn run_program(path: String, args: Option<String>) {
// Without unwrap_or, this can crash when UAC prompt is denied // Without unwrap_or, this can crash when UAC prompt is denied

View File

@@ -7,7 +7,7 @@
}, },
"package": { "package": {
"productName": "Cultivation", "productName": "Cultivation",
"version": "1.7.1" "version": "1.5.1"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {
@@ -67,13 +67,11 @@
"windows": [ "windows": [
{ {
"fullscreen": false, "fullscreen": false,
"transparent": true,
"height": 730, "height": 730,
"resizable": true, "resizable": true,
"title": "Cultivation", "title": "Cultivation",
"width": 1280, "width": 1280,
"decorations": false, "decorations": false
"center": true
} }
] ]
} }

View File

@@ -170,8 +170,6 @@ export class Main extends React.Component<IProps, IState> {
} }
// Ensure old configs are updated to use RSA // Ensure old configs are updated to use RSA
const updatedProfile = await getConfigOption('profile')
await setConfigOption('profile', updatedProfile)
const updatedConfig = await getConfigOption('patch_rsa') const updatedConfig = await getConfigOption('patch_rsa')
await setConfigOption('patch_rsa', updatedConfig) await setConfigOption('patch_rsa', updatedConfig)

View File

@@ -14,7 +14,7 @@
} }
#playButton > div { #playButton > div {
margin-bottom: 2px; margin-bottom: 6px;
} }
#playButton .BigButton { #playButton .BigButton {
@@ -26,27 +26,10 @@
#serverControls { #serverControls {
color: white; color: white;
display: flex;
justify-content: space-between;
flex-direction: row;
text-shadow: 1px 1px 8px black; text-shadow: 1px 1px 8px black;
} }
#menuOptionsContainerProfiles {
justify-self: right;
align-self: right;
padding-left: 8px;
width: min-content;
}
#serverControls select {
width: 150px;
height: 30px;
border: none;
border-bottom: 2px solid #cecece;
border-radius: 6px;
}
.BottomSection .CheckboxDisplay { .BottomSection .CheckboxDisplay {
border-color: #c5c5c5; border-color: #c5c5c5;
background: #fff; background: #fff;

View File

@@ -3,7 +3,7 @@ import Checkbox from './common/Checkbox'
import BigButton from './common/BigButton' import BigButton from './common/BigButton'
import TextInput from './common/TextInput' import TextInput from './common/TextInput'
import HelpButton from './common/HelpButton' import HelpButton from './common/HelpButton'
import { getConfig, saveConfig, setConfigOption, setProfileOption } from '../../utils/configuration' import { getConfig, saveConfig, setConfigOption } from '../../utils/configuration'
import { translate } from '../../utils/language' import { translate } from '../../utils/language'
import { invoke } from '@tauri-apps/api/tauri' import { invoke } from '@tauri-apps/api/tauri'
@@ -43,8 +43,6 @@ interface IState {
migotoSet: boolean migotoSet: boolean
unElevated: boolean unElevated: boolean
profile: string
profiles: string[]
} }
export default class ServerLaunchSection extends React.Component<IProps, IState> { export default class ServerLaunchSection extends React.Component<IProps, IState> {
@@ -68,8 +66,6 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
akebiSet: false, akebiSet: false,
migotoSet: false, migotoSet: false,
unElevated: false, unElevated: false,
profile: 'default',
profiles: ['default'],
} }
this.toggleGrasscutter = this.toggleGrasscutter.bind(this) this.toggleGrasscutter = this.toggleGrasscutter.bind(this)
@@ -79,7 +75,6 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
this.toggleHttps = this.toggleHttps.bind(this) this.toggleHttps = this.toggleHttps.bind(this)
this.launchServer = this.launchServer.bind(this) this.launchServer = this.launchServer.bind(this)
this.setButtonLabel = this.setButtonLabel.bind(this) this.setButtonLabel = this.setButtonLabel.bind(this)
this.setProfile = this.setProfile.bind(this)
listen('start_grasscutter', async () => { listen('start_grasscutter', async () => {
this.launchServer() this.launchServer()
@@ -107,8 +102,6 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
akebiSet: config.akebi_path !== '', akebiSet: config.akebi_path !== '',
migotoSet: config.migoto_path !== '', migotoSet: config.migoto_path !== '',
unElevated: config.un_elevated || false, unElevated: config.un_elevated || false,
profile: config.profile || 'default',
profiles: (await this.getProfileList()).map((t) => t),
}) })
this.setButtonLabel() this.setButtonLabel()
@@ -156,7 +149,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
// Connect to proxy // Connect to proxy
if (config.toggle_grasscutter) { if (config.toggle_grasscutter) {
const game_exe = await getGameExecutable() const game_exe = await getGameExecutable()
const newerGame = false let newerGame = false
const patchable = game_exe?.toLowerCase().includes('yuanshen') || game_exe?.toLowerCase().includes('genshin') const patchable = game_exe?.toLowerCase().includes('yuanshen') || game_exe?.toLowerCase().includes('genshin')
@@ -190,36 +183,35 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
const versionString = gameVersion?.major.toString() + gameVersion?.minor.toString() const versionString = gameVersion?.major.toString() + gameVersion?.minor.toString()
// Keeps being misused, remove for now. if ((gameVersion?.major == 4 && gameVersion?.minor > 5) || config.newer_game) {
// if ((gameVersion?.major == 4 && gameVersion?.minor > 5) || config.newer_game) { newerGame = true
// newerGame = true
// const path = (await invoke('install_location')) as string const path = (await invoke('install_location')) as string
// const patchstring = '\\altpatch\\' const patchstring = '\\altpatch\\'
// const altPatch = path + patchstring const altPatch = path + patchstring
// const ALT_PATCH = const ALT_PATCH =
// 'https://autopatchhk.yuanshen.com/client_app/download/pc_zip/20231030132335_iOEfPMcbrXpiA8Ca/ScatteredFiles/GenshinImpact_Data/Plugins/mihoyonet.dll' 'https://autopatchhk.yuanshen.com/client_app/download/pc_zip/20231030132335_iOEfPMcbrXpiA8Ca/ScatteredFiles/GenshinImpact_Data/Plugins/mihoyonet.dll'
// const pExists = (await invoke('dir_exists', { const pExists = (await invoke('dir_exists', {
// path: altPatch, path: altPatch,
// })) as boolean })) as boolean
// if (!pExists) { if (!pExists) {
// await invoke('dir_create', { await invoke('dir_create', {
// path: altPatch, path: altPatch,
// }) })
// this.props.downloadHandler.addDownload(ALT_PATCH, path + '/altpatch/mihoyonet.dll') 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') 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 */ /* For custom address patch only, used in 4.5 */
// // let httpString = 'http://' // let httpString = 'http://'
// // if (this.state.httpsEnabled) { // if (this.state.httpsEnabled) {
// // httpString = 'https://' // httpString = 'https://'
// // } // }
// // config.launch_args = '-server=' + httpString + this.state.ip + ':' + this.state.port // config.launch_args = '-server=' + httpString + this.state.ip + ':' + this.state.port
// } }
const patched = await patchGame(newerGame, versionString) const patched = await patchGame(newerGame, versionString)
@@ -286,13 +278,6 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
if (config.launch_args.length < 1) { if (config.launch_args.length < 1) {
// Run relative when there are no args // Run relative when there are no args
await invoke('run_program_relative', { path: exe || config.game_install_path }) 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 { } else {
// Run directly when there are args // Run directly when there are args
await invoke('run_program', { await invoke('run_program', {
@@ -400,25 +385,6 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
} }
} }
async setProfile(value: string) {
this.setState({ profile: value })
await setProfileOption('profile', value)
window.location.reload()
}
async getProfileList() {
const profiles: string[] = await invoke('get_profile_list', {
dataDir: `${await dataDir()}/cultivation`,
})
const list = ['default']
profiles.forEach((t) => {
list.push(t.split('.json')[0])
})
return list
}
render() { render() {
return ( return (
<div id="playButton"> <div id="playButton">
@@ -429,23 +395,6 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
onChange={this.toggleGrasscutter} onChange={this.toggleGrasscutter}
checked={this.state.grasscutterEnabled} checked={this.state.grasscutterEnabled}
/> />
<div className="OptionSection" id="menuOptionsContainerProfiles">
<div className="OptionValue" id="menuOptionsSelectProfiles">
<select
value={this.state.profile}
id="menuOptionsSelectMenuProfiles"
onChange={(event) => {
this.setProfile(event.target.value)
}}
>
{this.state.profiles.map((t) => (
<option key={t} value={t}>
{t}
</option>
))}
</select>
</div>
</div>
</div> </div>
{this.state.grasscutterEnabled && ( {this.state.grasscutterEnabled && (

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_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_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/GrasscutterLunaGC61.zip' // https://github.com/pmagixc/LunaGC_6.0.0 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 STABLE_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/stable.zip' 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 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' const UNSTABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/unstable/Grasscutter.zip'

View File

@@ -69,10 +69,7 @@ export class ExtrasMenu extends React.Component<IProps, IState> {
// This injects independent of the game // This injects independent of the game
if (this.state.launch_migoto) { if (this.state.launch_migoto) {
if (await this.launchMigoto()) { await this.launchMigoto()
// Already launched the game (ie. via XXMI)
return
}
} }
// This injects independent of the game // This injects independent of the game
@@ -107,17 +104,7 @@ export class ExtrasMenu extends React.Component<IProps, IState> {
if (!config.migoto_path) return alert('Migoto not installed or set!') 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 }) await invoke('run_program_relative', { path: config.migoto_path })
return false
} }
async launchReshade() { async launchReshade() {

View File

@@ -20,8 +20,3 @@
.OptionSection .HelpButton img { .OptionSection .HelpButton img {
filter: invert(0%) sepia(91%) saturate(7464%) hue-rotate(101deg) brightness(0%) contrast(107%); filter: invert(0%) sepia(91%) saturate(7464%) hue-rotate(101deg) brightness(0%) contrast(107%);
} }
input#profile_name {
height: 25px;
border-radius: 6px;
}

View File

@@ -4,14 +4,7 @@ import { dataDir } from '@tauri-apps/api/path'
import DirInput from '../common/DirInput' import DirInput from '../common/DirInput'
import Menu from './Menu' import Menu from './Menu'
import Tr, { getLanguages } from '../../../utils/language' import Tr, { getLanguages } from '../../../utils/language'
import { import { setConfigOption, getConfig, getConfigOption, Configuration } from '../../../utils/configuration'
setConfigOption,
getConfig,
getConfigOption,
Configuration,
saveNewProfileConfig,
setProfileOption,
} from '../../../utils/configuration'
import Checkbox from '../common/Checkbox' import Checkbox from '../common/Checkbox'
import Divider from './Divider' import Divider from './Divider'
import { getThemeList } from '../../../utils/themes' import { getThemeList } from '../../../utils/themes'
@@ -64,8 +57,6 @@ interface IState {
launch_args: string launch_args: string
offline_mode: boolean offline_mode: boolean
newer_game: boolean newer_game: boolean
show_version: boolean
profile_name: string
// Linux stuff // Linux stuff
grasscutter_elevation: string grasscutter_elevation: string
@@ -104,8 +95,6 @@ export default class Options extends React.Component<IProps, IState> {
launch_args: '', launch_args: '',
offline_mode: false, offline_mode: false,
newer_game: false, newer_game: false,
show_version: true,
profile_name: '',
// Linux stuff // Linux stuff
grasscutter_elevation: GrasscutterElevation.None, grasscutter_elevation: GrasscutterElevation.None,
@@ -129,9 +118,6 @@ export default class Options extends React.Component<IProps, IState> {
this.addMigotoDelay = this.addMigotoDelay.bind(this) this.addMigotoDelay = this.addMigotoDelay.bind(this)
this.toggleUnElevatedGame = this.toggleUnElevatedGame.bind(this) this.toggleUnElevatedGame = this.toggleUnElevatedGame.bind(this)
this.setLaunchArgs = this.setLaunchArgs.bind(this) this.setLaunchArgs = this.setLaunchArgs.bind(this)
this.toggleShowVersion = this.toggleShowVersion.bind(this)
this.setProfileName = this.setProfileName.bind(this)
this.saveProfile = this.saveProfile.bind(this)
} }
async componentDidMount() { async componentDidMount() {
@@ -170,7 +156,6 @@ export default class Options extends React.Component<IProps, IState> {
launch_args: config.launch_args, launch_args: config.launch_args,
offline_mode: config.offline_mode || false, offline_mode: config.offline_mode || false,
newer_game: config.newer_game || false, newer_game: config.newer_game || false,
show_version: config.show_version || false,
// Linux stuff // Linux stuff
grasscutter_elevation: config.grasscutter_elevation || GrasscutterElevation.None, grasscutter_elevation: config.grasscutter_elevation || GrasscutterElevation.None,
@@ -365,17 +350,6 @@ export default class Options extends React.Component<IProps, IState> {
}) })
} }
async toggleShowVersion() {
const changedVal = !(await getConfigOption('show_version'))
await setConfigOption('show_version', changedVal)
this.setState({
show_version: changedVal,
})
emit('set_config', { show_version: changedVal })
}
async setGCElevation(value: string) { async setGCElevation(value: string) {
setConfigOption('grasscutter_elevation', value) setConfigOption('grasscutter_elevation', value)
@@ -513,28 +487,6 @@ export default class Options extends React.Component<IProps, IState> {
}) })
} }
setProfileName(text: string) {
this.setState({
profile_name: text,
})
}
async saveProfile() {
if (this.state.profile_name == '') {
alert('No name set')
return
}
const config = await getConfig()
await saveNewProfileConfig(config, this.state.profile_name)
await setProfileOption('profile', this.state.profile_name)
this.setState({
profile_name: '',
})
window.location.reload()
}
render() { render() {
return ( return (
<Menu closeFn={this.props.closeFn} className="Options" heading="Options"> <Menu closeFn={this.props.closeFn} className="Options" heading="Options">
@@ -707,24 +659,6 @@ export default class Options extends React.Component<IProps, IState> {
<Divider /> <Divider />
<div className="OptionSection" id="profileConfigContainer">
<div className="OptionLabel" id="menuOptionsLabelProfile">
<Tr text="options.save_profile" />
</div>
<TextInput
id="profile_name"
key="profile_name"
placeholder={'Profile name...'}
onChange={this.setProfileName}
initalValue={''}
/>
<BigButton onClick={this.saveProfile} id="saveProfile">
{'Save'}
</BigButton>
</div>
<Divider />
<div className="OptionSection" id="menuOptionsContainerGCWGame"> <div className="OptionSection" id="menuOptionsContainerGCWGame">
<div className="OptionLabel" id="menuOptionsLabelGCWDame"> <div className="OptionLabel" id="menuOptionsLabelGCWDame">
<Tr text="options.grasscutter_with_game" /> <Tr text="options.grasscutter_with_game" />
@@ -777,12 +711,17 @@ export default class Options extends React.Component<IProps, IState> {
/> />
</div> </div>
</div> </div>
<div className="OptionSection" id="menuOptionsContainerShowVer">
<div className="OptionLabel" id="menuOptionsLabelShowVer"> <div className="OptionSection" id="menuOptionsContainerNewerGame">
<Tr text="options.show_version" /> <div className="OptionLabel" id="menuOptionsLabelNewerGame">
<Tr text="Patch Mihoyonet" />
</div> </div>
<div className="OptionValue" id="menuOptionsButtonShowVer"> <div className="OptionValue" id="menuOptionsCheckboxNewerGame">
<Checkbox onChange={() => this.toggleShowVersion()} checked={this.state.show_version} id="showVer" /> <Checkbox
onChange={() => this.toggleOption('newer_game')}
checked={this.state?.newer_game}
id="newerGame"
/>
</div> </div>
</div> </div>
@@ -884,32 +823,25 @@ export default class Options extends React.Component<IProps, IState> {
<Tr text="components.delete" /> <Tr text="components.delete" />
</BigButton> </BigButton>
</div> </div>
</div>
<div className="OptionSection" id="menuOptionsContainerLaunchArgs">
<div className="OptionLabel" id="menuOptionsLaunchArgs"> <div className="OptionLabel" id="menuOptionsLaunchArgs">
<Tr text="options.launch_args" /> <Tr text="options.launch_args" />
</div> </div>
<div className="OptionValue" id="menuOptionsValueLaunchArgs"> <TextInput
<TextInput id="launch_args"
id="launch_args" key="launch_args"
key="launch_args" placeholder={'-arg=value'}
placeholder={'-arg=value'} onChange={this.setLaunchArgs}
onChange={this.setLaunchArgs} value={this.state.launch_args}
value={this.state.launch_args} />
/>
</div>
</div> </div>
<div className="OptionSection" id="menuOptionsContainerFixRes"> <div className="OptionLabel" id="menuOptionsLabelFixRes">
<div className="OptionLabel" id="menuOptionsLabelFixRes"> <Tr text="options.fix_res" />
<Tr text="options.fix_res" /> </div>
</div> <div className="OptionValue" id="menuOptionsButtonfixRes">
<div className="OptionValue" id="menuOptionsButtonfixRes"> <BigButton onClick={this.fixRes} id="fixRes">
<BigButton onClick={this.fixRes} id="fixRes"> <Tr text="components.fix" />
<Tr text="components.fix" /> </BigButton>
</BigButton>
</div>
</div> </div>
</Menu> </Menu>
) )

View File

@@ -143,7 +143,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
<tr> <tr>
<td> <td>
Work in progress area! These numbers may be outdated, so please do not use them as reference. Latest Work in progress area! These numbers may be outdated, so please do not use them as reference. Latest
version: Grasscutter 1.7.4 (4.0) / Forks (6.1) - Cultivation 1.7.1 version: Grasscutter 1.7.4 - Cultivation 1.5.1
</td> </td>
</tr> </tr>
) )

View File

@@ -31,8 +31,6 @@ let defaultConfig: Configuration
launch_args: '', launch_args: '',
offline_mode: false, offline_mode: false,
newer_game: false, newer_game: false,
show_version: true,
profile: 'default',
// Linux stuff // Linux stuff
grasscutter_elevation: 'None', grasscutter_elevation: 'None',
@@ -70,8 +68,6 @@ export interface Configuration {
launch_args: string launch_args: string
offline_mode: boolean offline_mode: boolean
newer_game: boolean newer_game: boolean
show_version: boolean
profile: string
// Linux stuff // Linux stuff
grasscutter_elevation: string grasscutter_elevation: string
@@ -94,15 +90,6 @@ export async function setConfigOption<K extends keyof Configuration>(key: K, val
await saveConfig(<Configuration>config) await saveConfig(<Configuration>config)
} }
export async function setProfileOption<K extends keyof Configuration>(key: K, value: Configuration[K]): Promise<void> {
const config = await getConfig()
config[key] = value
const defaultConfig = await getDefaultConfig()
defaultConfig[key] = value
await saveProfileConfig(<Configuration>defaultConfig)
}
export async function getConfigOption<K extends keyof Configuration>(key: K): Promise<Configuration[K]> { export async function getConfigOption<K extends keyof Configuration>(key: K): Promise<Configuration[K]> {
const config = await getConfig() const config = await getConfig()
const defaults = defaultConfig const defaults = defaultConfig
@@ -126,69 +113,16 @@ export async function getConfig() {
return parsed return parsed
} }
export async function getDefaultConfig() {
const raw = await readDefaultConfigFile()
let parsed: Configuration = defaultConfig
try {
parsed = <Configuration>JSON.parse(raw)
} catch (e) {
// We could not open the file
console.log(e)
}
return parsed
}
export async function saveConfig(obj: Configuration) { export async function saveConfig(obj: Configuration) {
const raw = JSON.stringify(obj) const raw = JSON.stringify(obj)
await writeConfigFile(raw) await writeConfigFile(raw)
} }
export async function saveProfileConfig(obj: Configuration) {
const local = await dataDir()
const raw = JSON.stringify(obj)
const prevPath = configFilePath
configFilePath = local + 'cultivation/configuration.json'
await writeConfigFile(raw)
configFilePath = prevPath
}
export async function saveNewProfileConfig(obj: Configuration, prof: string) {
obj['profile'] = prof
const local = await dataDir()
const raw = JSON.stringify(obj)
configFilePath = local + 'cultivation/profiles/' + obj['profile'] + '.json'
const file: fs.FsTextFileOption = {
path: configFilePath,
contents: raw,
}
await fs.writeFile(file)
}
async function readConfigFile() { async function readConfigFile() {
const local = await dataDir() const local = await dataDir()
if (!configFilePath) { if (!configFilePath) configFilePath = local + 'cultivation/configuration.json'
configFilePath = local + 'cultivation/configuration.json'
}
// Read existing config to get profile name
const raw = await fs.readTextFile(configFilePath)
const cfg = <Configuration>JSON.parse(raw)
// Switch file to config-specified profile
let pf = cfg['profile']
if (pf && pf != 'default') {
const pff = pf
pf = 'profiles/' + pff + '.json'
} else {
pf = 'configuration.json'
}
configFilePath = local + 'cultivation/' + pf
// Ensure Cultivation dir exists // Ensure Cultivation dir exists
const dirs = await fs.readDir(local) const dirs = await fs.readDir(local)
@@ -223,12 +157,6 @@ async function readConfigFile() {
return await fs.readTextFile(configFilePath) return await fs.readTextFile(configFilePath)
} }
async function readDefaultConfigFile() {
const local = await dataDir()
configFilePath = local + 'cultivation/configuration.json'
return await fs.readTextFile(configFilePath)
}
async function writeConfigFile(raw: string) { async function writeConfigFile(raw: string) {
// All external config functions call readConfigFile, which ensure files exists // All external config functions call readConfigFile, which ensure files exists
await fs.writeFile({ await fs.writeFile({

View File

@@ -109,35 +109,25 @@ export default class DownloadHandler {
downloadingJar() { downloadingJar() {
// Kinda hacky but it works // Kinda hacky but it works
return this.downloads.some( return this.downloads.some((d) => d.path.includes('grasscutter.zip') && d.status != ('finished' || 'error'))
(d) => d.path.includes('grasscutter.zip') && !(d.status.includes('finished') || d.status.includes('error'))
)
} }
downloadingFullBuild() { downloadingFullBuild() {
// Kinda hacky but it works // Kinda hacky but it works
return this.downloads.some( return this.downloads.some((d) => d.path.includes('GrasscutterCulti') && d.status != ('finished' || 'error'))
(d) => d.path.includes('GrasscutterCulti') && !(d.status.includes('finished') || d.status.includes('error'))
)
} }
downloadingResources() { downloadingResources() {
// Kinda hacky but it works // Kinda hacky but it works
return this.downloads.some( return this.downloads.some((d) => d.path.includes('resources') && d.status != ('finished' || 'error'))
(d) => d.path.includes('resources') && !(d.status.includes('finished') || d.status.includes('error'))
)
} }
downloadingRepo() { downloadingRepo() {
return this.downloads.some( return this.downloads.some((d) => d.path.includes('grasscutter_repo.zip') && d.status != ('finished' || 'error'))
(d) => d.path.includes('grasscutter_repo.zip') && !(d.status.includes('finished') || d.status.includes('error'))
)
} }
downloadingMigoto() { downloadingMigoto() {
return this.downloads.some( return this.downloads.some((d) => d.path.includes('3dmigoto') && d.status != ('finished' || 'error'))
(d) => d.path.includes('3dmigoto') && !(d.status.includes('finished') || d.status.includes('error'))
)
} }
addDownload(url: string, path: string, onFinish?: () => void) { addDownload(url: string, path: string, onFinish?: () => void) {

View File

@@ -50,34 +50,20 @@ export async function getGameDataFolder() {
export async function getGameVersion() { export async function getGameVersion() {
const GameData = await getGameDataFolder() const GameData = await getGameDataFolder()
const platform = await invoke('get_platform')
if (!GameData) { if (!GameData) {
return null return null
} }
let hasAsb = await invoke('dir_exists', { const hasAsb = await invoke('dir_exists', {
path: GameData + '\\StreamingAssets\\asb_settings.json', path: GameData + '\\StreamingAssets\\asb_settings.json',
}) })
if (platform != 'windows') {
hasAsb = await invoke('dir_exists', {
path: GameData + '/StreamingAssets/asb_settings.json',
})
}
if (!hasAsb) { if (!hasAsb) {
// For games that cannot determine game version // For games that cannot determine game version
let otherGameVer: string = await invoke('read_file', { const otherGameVer: string = await invoke('read_file', {
path: GameData + '\\StreamingAssets\\BinaryVersion.bytes', path: GameData + '\\StreamingAssets\\BinaryVersion.bytes',
}) })
if (platform != 'windows') {
otherGameVer = await invoke('read_file', {
path: GameData + '/StreamingAssets/BinaryVersion.bytes',
})
}
const versionRaw = otherGameVer.split('.') const versionRaw = otherGameVer.split('.')
const version = { const version = {
major: parseInt(versionRaw[0]), major: parseInt(versionRaw[0]),

View File

@@ -4980,9 +4980,9 @@ http-proxy-agent@^4.0.1:
debug "4" debug "4"
http-proxy-middleware@^2.0.3: http-proxy-middleware@^2.0.3:
version "2.0.6" version "2.0.7"
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6"
integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==
dependencies: dependencies:
"@types/http-proxy" "^1.17.8" "@types/http-proxy" "^1.17.8"
http-proxy "^1.18.1" http-proxy "^1.18.1"