mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 15:44:35 +01:00
Compare commits
68 Commits
more_cli
...
v1.1.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d551344f39 | ||
|
|
84a6267c65 | ||
|
|
4c9e70a8f8 | ||
|
|
87897aabec | ||
|
|
acb9061d1c | ||
|
|
a954fcfc1c | ||
|
|
13dcbcd361 | ||
|
|
302754d486 | ||
|
|
c2cbf4049e | ||
|
|
554bda4643 | ||
|
|
d1018c249e | ||
|
|
0df78f35bd | ||
|
|
fb60889857 | ||
|
|
9516c78871 | ||
|
|
2a45f35062 | ||
|
|
ba12ab6586 | ||
|
|
0c37493d2a | ||
|
|
c8a368235c | ||
|
|
c2587cc923 | ||
|
|
00929a3efe | ||
|
|
ce78bf69aa | ||
|
|
732e020eb3 | ||
|
|
114a1d2023 | ||
|
|
3ed197b4b4 | ||
|
|
eed59e7883 | ||
|
|
5b9af3fcce | ||
|
|
b9b8632992 | ||
|
|
878dfed932 | ||
|
|
15e6958527 | ||
|
|
36b3c2f841 | ||
|
|
c6abf53880 | ||
|
|
9dcaea7e5b | ||
|
|
f4b8cdf732 | ||
|
|
ed743b2ff9 | ||
|
|
776aee0265 | ||
|
|
f508b3f0cf | ||
|
|
5bad4d05ee | ||
|
|
f53d903a8b | ||
|
|
47b15fc2ff | ||
|
|
bdb0fd3eb7 | ||
|
|
4631a6d38d | ||
|
|
b34f71a301 | ||
|
|
dea373a0d5 | ||
|
|
cab19e64c4 | ||
|
|
5cdde7d391 | ||
|
|
95e7949f18 | ||
|
|
5600269d7e | ||
|
|
b46a1d1fcf | ||
|
|
31f77355f1 | ||
|
|
7a4c28b501 | ||
|
|
96c4e4b886 | ||
|
|
17fed553da | ||
|
|
5374e2b0b9 | ||
|
|
d13c8e8861 | ||
|
|
26d1df2927 | ||
|
|
6e711073ad | ||
|
|
e38467f054 | ||
|
|
df48f888ff | ||
|
|
b78479a293 | ||
|
|
3969c26a58 | ||
|
|
9d9bc43119 | ||
|
|
2568694ac1 | ||
|
|
c735b8936a | ||
|
|
420e437788 | ||
|
|
6f1f55663b | ||
|
|
f3f5dc95ae | ||
|
|
470ddb0598 | ||
|
|
cf267657dd |
@@ -29,7 +29,7 @@ For game versions 3.1 and above, Cultivation automatically makes a small patch t
|
||||
|
||||
Download and open the MSI, and once installed, run Cultivation as administrator. Refer below for more [detailed setup instructions](#setup).
|
||||
|
||||
**Windows 7 Users:** You will need to download [WebView](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section) manually, and download the `.zip` instead of the `.msi`.
|
||||
**Windows 7 Users:** You will need to download [WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section) manually, and download the `.zip` instead of the `.msi`.
|
||||
|
||||
# Setup
|
||||
|
||||
@@ -37,7 +37,7 @@ Download and open the MSI, and once installed, run Cultivation as administrator.
|
||||
|
||||
- Download Cultivation
|
||||
- If you are on Windows 10 or 11, use the MSI
|
||||
- If you are on Windows 7, or the MSI doesn't work, use the zip and download [WebView](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)
|
||||
- If you are on Windows 7, or the MSI doesn't work, use the zip and download [WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)
|
||||
- If you are on GNU/Linux or MacOS, [help us port Windows-specific system calls to GNU/Linux and MacOS!](https://github.com/Grasscutters/Cultivation/issues/7)
|
||||
- Install or extract Cultivation
|
||||
- Open Cultivation **_as administrator_**
|
||||
@@ -79,7 +79,7 @@ Please allow the Cultivation window to pop back up once you have quit out of the
|
||||
- Install [yarn](https://classic.yarnpkg.com/lang/en/docs/install) (cry about it `npm` lovers)
|
||||
- Install [Rust](https://www.rust-lang.org/tools/install)
|
||||
- `yarn install`
|
||||
- `yarn start:dev`
|
||||
- `yarn tauri dev`
|
||||
|
||||
### Building
|
||||
|
||||
|
||||
52
src-tauri/Cargo.lock
generated
52
src-tauri/Cargo.lock
generated
@@ -357,9 +357,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.10.0"
|
||||
version = "3.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3"
|
||||
checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
|
||||
|
||||
[[package]]
|
||||
name = "bytecount"
|
||||
@@ -387,9 +387,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
|
||||
|
||||
[[package]]
|
||||
name = "bzip2"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0"
|
||||
checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8"
|
||||
dependencies = [
|
||||
"bzip2-sys",
|
||||
"libc",
|
||||
@@ -788,7 +788,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
|
||||
|
||||
[[package]]
|
||||
name = "cultivation"
|
||||
version = "0.1.0"
|
||||
version = "1.1.0"
|
||||
dependencies = [
|
||||
"args",
|
||||
"cc",
|
||||
@@ -1592,9 +1592,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.3.13"
|
||||
version = "0.3.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57"
|
||||
checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"fnv",
|
||||
@@ -2324,9 +2324,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ntapi"
|
||||
version = "0.3.7"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f"
|
||||
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
@@ -2561,9 +2561,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "openssl"
|
||||
version = "0.10.41"
|
||||
version = "0.10.52"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0"
|
||||
checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cfg-if",
|
||||
@@ -2593,11 +2593,10 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
|
||||
|
||||
[[package]]
|
||||
name = "openssl-sys"
|
||||
version = "0.9.75"
|
||||
version = "0.9.87"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f"
|
||||
checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
@@ -3995,9 +3994,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "sysinfo"
|
||||
version = "0.24.6"
|
||||
version = "0.28.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b6e19da72a8d75be4d40e4dd4686afca31507f26c3ffdf6bd3073278d9de0a0"
|
||||
checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"core-foundation-sys",
|
||||
@@ -4099,9 +4098,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri"
|
||||
version = "1.0.7"
|
||||
version = "1.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f75c3e334088164e8ce14dc44e6568d2a7cda53c35ef8fca3258828d266d4bc6"
|
||||
checksum = "0d935ccc2848c5dc05ba698a994fe97aa17821ab290cb496aa9936d894e01504"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"attohttpc",
|
||||
@@ -4208,9 +4207,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "0.10.2"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4e4cff3b4d9469727fa2107c4b3d2eda110df1ba45103fb420178e536362fae4"
|
||||
checksum = "59edc884920cd3541620ec52d7e6e97e5b45e52d0610b6c71a1c4054729286c3"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
@@ -4221,6 +4220,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tauri-utils",
|
||||
"thiserror",
|
||||
"url",
|
||||
"uuid 1.1.2",
|
||||
"webview2-com",
|
||||
"windows 0.37.0",
|
||||
@@ -4228,9 +4228,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "0.10.2"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fa8c4edaf01d8b556e7172c844b1b4dd3399adcd1a606bd520fc3e65f698546"
|
||||
checksum = "7fcc220eab1e5709486273617901dc99f35bdb4fe25da4163aee6923375d1a99"
|
||||
dependencies = [
|
||||
"cocoa",
|
||||
"gtk",
|
||||
@@ -4239,6 +4239,7 @@ dependencies = [
|
||||
"raw-window-handle",
|
||||
"tauri-runtime",
|
||||
"tauri-utils",
|
||||
"url",
|
||||
"uuid 1.1.2",
|
||||
"webkit2gtk",
|
||||
"webview2-com",
|
||||
@@ -4378,9 +4379,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.20.0"
|
||||
version = "1.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e"
|
||||
checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"bytes",
|
||||
@@ -4388,11 +4389,10 @@ dependencies = [
|
||||
"memchr",
|
||||
"mio",
|
||||
"num_cpus",
|
||||
"once_cell",
|
||||
"pin-project-lite",
|
||||
"signal-hook-registry",
|
||||
"socket2",
|
||||
"winapi",
|
||||
"windows-sys 0.45.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cultivation"
|
||||
version = "0.1.0"
|
||||
version = "1.1.0"
|
||||
description = "A custom launcher for anime game."
|
||||
authors = ["KingRainbow44", "SpikeHD"]
|
||||
license = ""
|
||||
@@ -24,14 +24,14 @@ sudo = "0.6.0"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.0.7", features = ["api-all"] }
|
||||
tauri = { version = "1.0.9", features = ["api-all"] }
|
||||
|
||||
# Arg parsing
|
||||
args = "2.0"
|
||||
getopts = "0.2"
|
||||
|
||||
# Access system process info.
|
||||
sysinfo = "0.24.6"
|
||||
sysinfo = "0.28.4"
|
||||
|
||||
# ZIP-archive library.
|
||||
zip-extract = "0.1.1"
|
||||
@@ -58,7 +58,7 @@ hudsucker = "0.19.1"
|
||||
tracing = "0.1.21"
|
||||
tokio-rustls = "0.23.0"
|
||||
tokio-tungstenite = "0.17.0"
|
||||
tokio = { version = "1.18.2", features = ["signal"] }
|
||||
tokio = { version = "1.20.4", features = ["signal"] }
|
||||
rustls-pemfile = "1.0.0"
|
||||
reqwest = { version = "0.11.3", features = ["stream"] }
|
||||
futures-util = "0.3.14"
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "下载 Grasscutter 一体化",
|
||||
"grasscutter_fullquest": "下载 Quest 一体化",
|
||||
"grasscutter_stable_data": "下载 Grasscutter 稳定版数据",
|
||||
"grasscutter_latest_data": "下载 Grasscutter 开发版数据",
|
||||
"grasscutter_stable_data_update": "更新 Grasscutter 稳定版数据",
|
||||
"grasscutter_latest_data_update": "更新 Grasscutter 开发版数据",
|
||||
"grasscutter_stable": "下载 Grasscutter 稳定版",
|
||||
"grasscutter_unstable": "下载 Grasscutter 稳定版",
|
||||
"grasscutter_latest": "下载 Grasscutter 开发版",
|
||||
"grasscutter_stable_update": "更新 Grasscutter 稳定版",
|
||||
"grasscutter_unstable_update": "更新 Grasscutter 稳定版",
|
||||
"grasscutter_latest_update": "更新 Grasscutter 开发版",
|
||||
"resources": "下载 Grasscutter 资源",
|
||||
"game": "下载游戏",
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "下載Grasscutter多合一下載",
|
||||
"grasscutter_fullquest": "下载 Quest 一体化",
|
||||
"grasscutter_stable_data": "下載Grasscutter穩定版數據(Data)",
|
||||
"grasscutter_latest_data": "下載Grasscutter開發板數據(Data)",
|
||||
"grasscutter_stable_data_update": "更新Grasscutter穩定版數據(Data)",
|
||||
"grasscutter_latest_data_update": "更新Grasscutter開發板數據(Data)",
|
||||
"grasscutter_stable": "下載Grasscutter穩定版",
|
||||
"grasscutter_unstable": "下載Grasscutter穩定版",
|
||||
"grasscutter_latest": "下載Grasscutter開發板",
|
||||
"grasscutter_stable_update": "更新Grasscutter穩定版",
|
||||
"grasscutter_unstable_update": "更新Grasscutter穩定版",
|
||||
"grasscutter_latest_update": "更新Grasscutter開發板",
|
||||
"resources": "下載Grasscutter資源(Resources)",
|
||||
"game": "下載遊戲",
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Alles in Einem Grasscutter Daten herunterladen",
|
||||
"grasscutter_fullquest": "Alles in Einem Questing Daten herunterladen",
|
||||
"grasscutter_stable_data": "Stabile Grasscutter Daten herunterladen",
|
||||
"grasscutter_latest_data": "Aktuellste Grasscutter Daten herunterladen",
|
||||
"grasscutter_stable_data_update": "Stabile Grasscutter Daten aktualisieren",
|
||||
"grasscutter_latest_data_update": "Aktuellste Grasscutter Daten aktualisieren",
|
||||
"grasscutter_stable": "Stabile Grasscutter Version herunterladen",
|
||||
"grasscutter_unstable": "Stabile Grasscutter Version herunterladen",
|
||||
"grasscutter_latest": "Aktuellste Grasscutter Version herunterladen",
|
||||
"grasscutter_stable_update": "Stabile Grasscutter Version aktualisieren",
|
||||
"grasscutter_unstable_update": "Stabile Grasscutter Version aktualisieren",
|
||||
"grasscutter_latest_update": "Aktuellste Grasscutter Version aktualisieren",
|
||||
"resources": "Grasscutter Ressourcen herunterladen",
|
||||
"game": "Spiel herunterladen",
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Download Grasscutter All-in-One",
|
||||
"grasscutter_fullquest": "Download Questing 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",
|
||||
"grasscutter_latest_data_update": "Update Grasscutter Latest Data",
|
||||
"grasscutter_stable": "Download Grasscutter Stable",
|
||||
"grasscutter_unstable": "Download Grasscutter Questing",
|
||||
"grasscutter_latest": "Download Grasscutter Latest",
|
||||
"grasscutter_stable_update": "Update Grasscutter Stable",
|
||||
"grasscutter_unstable_update": "Update Grasscutter Questing",
|
||||
"grasscutter_latest_update": "Update Grasscutter Latest",
|
||||
"resources": "Download Grasscutter Resources",
|
||||
"game": "Download Game",
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Descargar Datos todo en uno de Grasscutter",
|
||||
"grasscutter_fullquest": "Descargar Datos todo en uno de Questing",
|
||||
"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",
|
||||
"grasscutter_latest_data_update": "Actualizar Datos más Recientes de Grasscutter",
|
||||
"grasscutter_stable": "Descargar Grasscutter Estable",
|
||||
"grasscutter_unstable": "Descargar Grasscutter Estable",
|
||||
"grasscutter_latest": "Descargar Grasscutter más reciente",
|
||||
"grasscutter_stable_update": "Actualizar Grasscutter Estable",
|
||||
"grasscutter_unstable_update": "Actualizar Grasscutter Estable",
|
||||
"grasscutter_latest_update": "Actualizar Grasscutter más reciente",
|
||||
"resources": "Descargar Recursos de Grasscutter",
|
||||
"game": "Descarga el juego",
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Telecharger Grasscutter tout-en-un",
|
||||
"grasscutter_fullquest": "Télécharger les Quêtes tout-en-un",
|
||||
"grasscutter_stable_data": "Telecharger les donnees de Grasscutter (version stable)",
|
||||
"grasscutter_latest_data": "Telecharger les donnees de Grasscutter (derniere version)",
|
||||
"grasscutter_stable_data_update": "Mettre a jour les donnees de Grasscutter (version stable)",
|
||||
"grasscutter_latest_data_update": "Mettre a jour les donnees de Grasscutter (derniere version)",
|
||||
"grasscutter_stable": "Telecharger Grasscutter (version stable)",
|
||||
"grasscutter_unstable": "Telecharger Grasscutter (version stable)",
|
||||
"grasscutter_latest": "Telecharger Grasscutter (derniere version)",
|
||||
"grasscutter_stable_update": "Mettre a jour Grasscutter (version stable)",
|
||||
"grasscutter_unstable_update": "Mettre a jour Grasscutter (version stable)",
|
||||
"grasscutter_latest_update": "Mettre a jour Grasscutter (derniere version)",
|
||||
"resources": "Telecharger les ressources logicielles de Grasscutter",
|
||||
"aio_header": "Telechargements tout-en-un:",
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Sedang Mendownload Grasscutter Semua Dalam Satu",
|
||||
"grasscutter_fullquest": "Unduh pencarian 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",
|
||||
"grasscutter_latest_data_update": "Memperbaharui Grasscutter Data Terbaru",
|
||||
"grasscutter_stable": "Download Grasscutter Stabil Version ",
|
||||
"grasscutter_unstable": "Download Grasscutter Stabil Version ",
|
||||
"grasscutter_latest": "Download Grasscutter Terbaru Version",
|
||||
"grasscutter_stable_update": "Sedang MengUpdate Grasscutter Stabil",
|
||||
"grasscutter_unstable_update": "Sedang MengUpdate Grasscutter Stabil",
|
||||
"grasscutter_latest_update": "Sedang MengUpdate Grasscutter Terbaru",
|
||||
"resources": "Mendownload Grasscutter Resources",
|
||||
"aio_header": "Unduhan Semua Dalam Satu:",
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "올인원 Grasscutter 다운로드",
|
||||
"grasscutter_fullquest": "퀘스트 올인원 다운로드",
|
||||
"grasscutter_stable_data": "안정적인 데이터 다운로드",
|
||||
"grasscutter_latest_data": "최신 데이터 다운로드",
|
||||
"grasscutter_stable_data_update": "안정적 데이터 업데이트",
|
||||
"grasscutter_latest_data_update": "최신 데이터 업데이트",
|
||||
"grasscutter_stable": "안정 다운로드",
|
||||
"grasscutter_unstable": "안정 다운로드",
|
||||
"grasscutter_latest": "최신 다운로드",
|
||||
"grasscutter_stable_update": "안정 업데이트",
|
||||
"grasscutter_unstable_update": "안정 업데이트",
|
||||
"grasscutter_latest_update": "최신 업데이트",
|
||||
"resources": "리소스 다운로드",
|
||||
"game": "게임 다운로드",
|
||||
|
||||
@@ -32,13 +32,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Lejupielādējiet Grasscutter viss vienā",
|
||||
"grasscutter_fullquest": "Lejupielādēt questing 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",
|
||||
"grasscutter_latest_data_update": "Atjauniniet Grasscutter jaunākos datus",
|
||||
"grasscutter_stable": "Lejupielādēt Grasscutter stabilo",
|
||||
"grasscutter_unstable": "Lejupielādēt Grasscutter stabilo",
|
||||
"grasscutter_latest": "Lejupielādēt Grasscutter jaunāko",
|
||||
"grasscutter_stable_update": "Atjauniet Grasscutter stabilo",
|
||||
"grasscutter_unstable_update": "Atjauniet Grasscutter stabilo",
|
||||
"grasscutter_latest_update": "Atjauniet Grasscutter jaunāko",
|
||||
"resources": "Lejupielādējiet Grasscutter resursi",
|
||||
"aio_header": "Lejupielādes viss vienā",
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Grasscutter Alles-in-één Downloaden",
|
||||
"grasscutter_fullquest": "Alles-in-één zoeken 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",
|
||||
"grasscutter_latest_data_update": "Nieuwste gegevens Van Grasscutter bijwerken",
|
||||
"grasscutter_stable": "Download Stabiele Versie Van Grasscutter",
|
||||
"grasscutter_unstable": "Download Stabiele Versie Van Grasscutter",
|
||||
"grasscutter_latest": "Download De Nieuwste Versie Van Grasscutter",
|
||||
"grasscutter_stable_update": "Update Grasscutter Naar De Stabiele Versie",
|
||||
"grasscutter_unstable_update": "Update Grasscutter Naar De Stabiele Versie",
|
||||
"grasscutter_latest_update": "Update Grasscutter Naar De Nieuwste Versie",
|
||||
"resources": "Download Grasscutter bronnen",
|
||||
"game": "Download Spel",
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Baixar o Grasscutter Tudo-em-Um",
|
||||
"grasscutter_fullquest": "Baixar de missões 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",
|
||||
"grasscutter_latest_data_update": "Atualizar os Dados do Grasscutter Mais Recente",
|
||||
"grasscutter_stable": "Baixar o Grasscutter Estável",
|
||||
"grasscutter_unstable": "Baixar o Grasscutter Estável",
|
||||
"grasscutter_latest": "Baixar o Grasscutter Mais Recente",
|
||||
"grasscutter_stable_update": "Atualizar o Grasscutter Estável",
|
||||
"grasscutter_unstable_update": "Atualizar o Grasscutter Estável",
|
||||
"grasscutter_latest_update": "Atualizar o Grasscutter Mais Recente",
|
||||
"resources": "Baixar os Recursos do Grasscutter ",
|
||||
"game": "Baixar o Jogo",
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Скачать все в одном Grasscutter",
|
||||
"grasscutter_fullquest": "Скачать квесты все в одном",
|
||||
"grasscutter_stable_data": "Скачать стабильные данные Grasscutter",
|
||||
"grasscutter_latest_data": "Скачать последние данные Grasscutter",
|
||||
"grasscutter_stable_data_update": "Обновить стабильные данные Grasscutter",
|
||||
"grasscutter_latest_data_update": "Обновить последние данные Grasscutter",
|
||||
"grasscutter_stable": "Скачать стабильную версию Grasscutter",
|
||||
"grasscutter_unstable": "Скачать стабильную версию Grasscutter",
|
||||
"grasscutter_latest": "Скачать последнюю версию Grasscutter",
|
||||
"grasscutter_stable_update": "Обновить стабильную версию Grasscutter",
|
||||
"grasscutter_unstable_update": "Обновить стабильную версию Grasscutter",
|
||||
"grasscutter_latest_update": "Обновить последнюю версию Grasscutter",
|
||||
"resources": "Скачать ресурсы Grasscutter",
|
||||
"game": "Скачать Игру",
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Tải Grasscutter tất cả trong một",
|
||||
"grasscutter_fullquest": "Tải xuống truy vấn 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",
|
||||
"grasscutter_latest_data_update": "Cập nhật dữ liệu Grasscutter bản mới nhất",
|
||||
"grasscutter_stable": "Tải Grasscutter bản ổn định",
|
||||
"grasscutter_unstable": "Tải Grasscutter bản ổn định",
|
||||
"grasscutter_latest": "Tải Grasscutter bản mới nhất",
|
||||
"grasscutter_stable_update": "Cập nhật Grasscutter bản ổn định",
|
||||
"grasscutter_unstable_update": "Cập nhật Grasscutter bản ổn định",
|
||||
"grasscutter_latest_update": "Cập nhật Grasscutter bản mới nhất",
|
||||
"resources": "Tải tài nguyên Grasscutter",
|
||||
"game": "Tải game",
|
||||
|
||||
@@ -20,3 +20,6 @@ pub fn reopen_as_admin() {
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn reopen_as_admin() {}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn reopen_as_admin() {}
|
||||
|
||||
@@ -2,29 +2,30 @@ use serde::{Deserialize, Serialize};
|
||||
use std::path::PathBuf;
|
||||
use std::string::String;
|
||||
|
||||
// Config may not exist, or may be old, so it's okay if these are optional
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct Configuration {
|
||||
pub toggle_grasscutter: bool,
|
||||
pub game_install_path: String,
|
||||
pub grasscutter_with_game: bool,
|
||||
pub grasscutter_path: String,
|
||||
pub java_path: String,
|
||||
pub close_action: u64,
|
||||
pub startup_launch: bool,
|
||||
pub last_ip: String,
|
||||
pub last_port: String,
|
||||
pub language: String,
|
||||
pub customBackground: String,
|
||||
pub cert_generated: bool,
|
||||
pub theme: String,
|
||||
pub https_enabled: bool,
|
||||
pub debug_enabled: bool,
|
||||
pub patch_rsa: bool,
|
||||
pub use_internal_proxy: bool,
|
||||
pub wipe_login: bool,
|
||||
pub horny_mode: bool,
|
||||
pub auto_mongodb: bool,
|
||||
pub un_elevated: bool,
|
||||
pub toggle_grasscutter: Option<bool>,
|
||||
pub game_install_path: Option<String>,
|
||||
pub grasscutter_with_game: Option<bool>,
|
||||
pub grasscutter_path: Option<String>,
|
||||
pub java_path: Option<String>,
|
||||
pub close_action: Option<u64>,
|
||||
pub startup_launch: Option<bool>,
|
||||
pub last_ip: Option<String>,
|
||||
pub last_port: Option<String>,
|
||||
pub language: Option<String>,
|
||||
pub custom_background: Option<String>,
|
||||
pub cert_generated: Option<bool>,
|
||||
pub theme: Option<String>,
|
||||
pub https_enabled: Option<bool>,
|
||||
pub debug_enabled: Option<bool>,
|
||||
pub patch_rsa: Option<bool>,
|
||||
pub use_internal_proxy: Option<bool>,
|
||||
pub wipe_login: Option<bool>,
|
||||
pub horny_mode: Option<bool>,
|
||||
pub auto_mongodb: Option<bool>,
|
||||
pub un_elevated: Option<bool>,
|
||||
}
|
||||
|
||||
pub fn config_path() -> PathBuf {
|
||||
@@ -37,7 +38,7 @@ pub fn config_path() -> PathBuf {
|
||||
|
||||
pub fn get_config() -> Configuration {
|
||||
let path = config_path();
|
||||
let config = std::fs::read_to_string(path).unwrap();
|
||||
let config = std::fs::read_to_string(path).unwrap_or("{}".to_string());
|
||||
let config: Configuration = serde_json::from_str(&config).unwrap();
|
||||
|
||||
config
|
||||
|
||||
@@ -13,15 +13,26 @@ pub async fn get_download_links(mod_id: String) -> String {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn list_submissions(mode: String, page: String) -> String {
|
||||
web::query(
|
||||
format!(
|
||||
"{}/apiv9/Util/Game/Submissions?_idGameRow=8552&_nPage={}&_nPerpage=50&_sMode={}",
|
||||
SITE_URL, page, mode
|
||||
pub async fn list_submissions(mode: String, page: String, search: String) -> String {
|
||||
if search.is_empty() {
|
||||
web::query(
|
||||
format!(
|
||||
"{}/apiv9/Util/Game/Submissions?_idGameRow=8552&_nPage={}&_nPerpage=50&_sMode={}",
|
||||
SITE_URL, page, mode
|
||||
)
|
||||
.as_str(),
|
||||
)
|
||||
.as_str(),
|
||||
)
|
||||
.await
|
||||
.await
|
||||
} else {
|
||||
web::query(
|
||||
format!(
|
||||
"{}/apiv11/Util/Search/Results?_nPage={}&_sOrder=best_match&_idGameRow=8552&_sSearchString={}&_csvFields=name,description,article,attribs,studio,owner,credits",
|
||||
SITE_URL, page, search
|
||||
)
|
||||
.as_str()
|
||||
)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -98,22 +98,24 @@ async fn parse_args(inp: &Vec<String>) -> Result<Args, ArgsError> {
|
||||
|
||||
if args.value_of("launch-game")? {
|
||||
let game_path = config.game_install_path;
|
||||
let game_args: String = args.value_of("game-args").unwrap_or(String::new());
|
||||
let game_args: String = args.value_of("game-args").unwrap_or_default();
|
||||
|
||||
// Patch if needed
|
||||
if args.value_of("patch")? {
|
||||
patch::patch_game().await;
|
||||
}
|
||||
|
||||
if args.value_of("non-elevated-game")? {
|
||||
system_helpers::run_un_elevated(game_path.to_string(), Some(game_args))
|
||||
} else {
|
||||
system_helpers::run_program(game_path.to_string(), Some(game_args))
|
||||
if game_path.is_some() {
|
||||
if args.value_of("non-elevated-game")? {
|
||||
system_helpers::run_un_elevated(game_path.unwrap(), Some(game_args))
|
||||
} else {
|
||||
system_helpers::run_program(game_path.unwrap(), Some(game_args))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if args.value_of("server")? {
|
||||
let server_jar = config.grasscutter_path;
|
||||
if args.value_of("server")? && config.grasscutter_path.is_some() && config.java_path.is_some() {
|
||||
let server_jar = config.grasscutter_path.unwrap();
|
||||
let mut server_path = server_jar.clone();
|
||||
// Strip jar name from path
|
||||
if server_path.contains('/') {
|
||||
@@ -124,7 +126,7 @@ async fn parse_args(inp: &Vec<String>) -> Result<Args, ArgsError> {
|
||||
let len = server_jar.rfind('\\').unwrap();
|
||||
server_path.truncate(len);
|
||||
}
|
||||
let java_path = config.java_path;
|
||||
let java_path = config.java_path.unwrap();
|
||||
|
||||
system_helpers::run_jar(server_jar, server_path.to_string(), java_path);
|
||||
}
|
||||
@@ -155,7 +157,7 @@ fn main() -> Result<(), ArgsError> {
|
||||
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
|
||||
println!("===============================================================================");
|
||||
|
||||
reopen_as_admin();
|
||||
//reopen_as_admin();
|
||||
}
|
||||
|
||||
// Setup datadir/cultivation just in case something went funky and it wasn't made
|
||||
@@ -228,6 +230,13 @@ fn main() -> Result<(), ArgsError> {
|
||||
gamebanana::list_submissions,
|
||||
gamebanana::list_mods
|
||||
])
|
||||
.on_window_event(|event| match event.event() {
|
||||
tauri::WindowEvent::CloseRequested { api, .. } => {
|
||||
// Ensure all proxy stuff is handled
|
||||
disconnect();
|
||||
}
|
||||
_ => {}
|
||||
})
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
} else {
|
||||
@@ -306,6 +315,7 @@ fn is_grasscutter_running() -> bool {
|
||||
!proc.is_empty()
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
fn restart_grasscutter(window: tauri::Window) -> bool {
|
||||
let pid: usize = *GC_PID.lock().unwrap();
|
||||
@@ -336,6 +346,17 @@ fn restart_grasscutter(window: tauri::Window) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tauri::command]
|
||||
fn restart_grasscutter(_window: tauri::Window) {
|
||||
// Placeholder text for imports
|
||||
let s = System::new();
|
||||
if let Some(process) = s.process(Pid::from(1337)) {
|
||||
println!("{}", process.name());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
fn enable_grasscutter_watcher(window: tauri::Window, process: String) {
|
||||
let grasscutter_name = process.clone();
|
||||
@@ -396,6 +417,13 @@ fn enable_grasscutter_watcher(window: tauri::Window, process: String) {
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tauri::command]
|
||||
fn enable_grasscutter_watcher(_window: tauri::Window, _process: String) {
|
||||
let gc_pid = Pid::from(696969);
|
||||
*GC_PID.lock().unwrap() = gc_pid.into();
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn connect(port: u16, certificate_path: String) {
|
||||
// Log message to console.
|
||||
|
||||
@@ -52,7 +52,10 @@ pub async fn unpatch_game() -> bool {
|
||||
|
||||
pub async fn get_game_rsa_path() -> Option<String> {
|
||||
let config = config::get_config();
|
||||
let mut game_folder = PathBuf::from(config.game_install_path);
|
||||
|
||||
config.game_install_path.as_ref()?;
|
||||
|
||||
let mut game_folder = PathBuf::from(config.game_install_path.unwrap());
|
||||
game_folder.pop();
|
||||
|
||||
Some(format!("{}/", game_folder.to_str().unwrap()).replace('\\', "/"))
|
||||
|
||||
@@ -16,7 +16,8 @@ pub async fn get_latest_release() -> Release {
|
||||
.unwrap();
|
||||
let text = response.text().await.unwrap();
|
||||
|
||||
println!("Response: {}", text);
|
||||
// This includes ip when github rate limits you, so avoid it for now to avoid leaks through screenshots
|
||||
//println!("Response: {}", text);
|
||||
|
||||
// Parse "tag_name" from JSON
|
||||
let json: serde_json::Value = serde_json::from_str(&text).unwrap();
|
||||
|
||||
@@ -2,11 +2,13 @@ use duct::cmd;
|
||||
use ini::Ini;
|
||||
use std::ffi::OsStr;
|
||||
use std::path::PathBuf;
|
||||
use windows_service::service::{ServiceAccess, ServiceState::Stopped};
|
||||
use windows_service::service_manager::{ServiceManager, ServiceManagerAccess};
|
||||
|
||||
#[cfg(windows)]
|
||||
use registry::{Data, Hive, Security};
|
||||
use {
|
||||
registry::{Data, Hive, Security},
|
||||
windows_service::service::{ServiceAccess, ServiceState::Stopped},
|
||||
windows_service::service_manager::{ServiceManager, ServiceManagerAccess},
|
||||
};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_program(path: String, args: Option<String>) {
|
||||
@@ -230,7 +232,7 @@ pub fn service_status(service: String) -> bool {
|
||||
}
|
||||
};
|
||||
let status_result = my_service.query_status();
|
||||
if status_result.is_ok() {
|
||||
if let Ok(..) = status_result {
|
||||
let status = status_result.unwrap();
|
||||
println!("{} service status: {:?}", service, status.current_state);
|
||||
if status.current_state == Stopped {
|
||||
@@ -243,6 +245,10 @@ pub fn service_status(service: String) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tauri::command]
|
||||
pub fn service_status(_service: String) {}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
pub fn start_service(service: String) -> bool {
|
||||
@@ -262,6 +268,12 @@ pub fn start_service(service: String) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tauri::command]
|
||||
pub fn start_service(_service: String) {
|
||||
let _started = OsStr::new("Started service!");
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
pub fn stop_service(service: String) -> bool {
|
||||
@@ -281,6 +293,10 @@ pub fn stop_service(service: String) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tauri::command]
|
||||
pub fn stop_service(_service: String) {}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tauri::command]
|
||||
pub fn wipe_registry(_exec_name: String) {}
|
||||
|
||||
@@ -107,12 +107,9 @@ pub fn unzip(
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
if zipfile.contains("GIMI") {
|
||||
if zipfile.contains("GrasscutterQuests") {
|
||||
window
|
||||
.emit(
|
||||
"migoto_extracted",
|
||||
destpath.to_string() + "3DMigoto Loader.exe",
|
||||
)
|
||||
.emit("jar_extracted", destpath.to_string() + "grasscutter.jar")
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,27 @@
|
||||
use http::header;
|
||||
use once_cell::sync::Lazy;
|
||||
use reqwest::header::{CONTENT_TYPE, USER_AGENT};
|
||||
static CLIENT: Lazy<reqwest::Client> = Lazy::new(|| {
|
||||
let mut headers = header::HeaderMap::new();
|
||||
headers.insert(USER_AGENT, header::HeaderValue::from_static("cultivation"));
|
||||
headers.insert(
|
||||
CONTENT_TYPE,
|
||||
header::HeaderValue::from_static("application/json"),
|
||||
);
|
||||
|
||||
let client = reqwest::Client::builder().default_headers(headers);
|
||||
client.build().unwrap()
|
||||
});
|
||||
|
||||
pub(crate) async fn query(site: &str) -> String {
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
let response = client
|
||||
CLIENT
|
||||
.get(site)
|
||||
.header(USER_AGENT, "cultivation")
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.send()
|
||||
.await
|
||||
.ok();
|
||||
|
||||
if response.is_some() {
|
||||
response.unwrap().text().await.unwrap()
|
||||
} else {
|
||||
false.to_string()
|
||||
}
|
||||
.expect("Failed to get web response")
|
||||
.text()
|
||||
.await
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "Cultivation",
|
||||
"version": "1.0.26"
|
||||
"version": "1.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
"fs": {
|
||||
"scope": ["$DATA", "$DATA/cultivation", "$DATA/cultivation/*"]
|
||||
"scope": ["$DATA", "$DATA/cultivation", "$DATA/cultivation/**"]
|
||||
},
|
||||
"protocol": {
|
||||
"all": true,
|
||||
"asset": true,
|
||||
"assetScope": ["$DATA", "$DATA/cultivation", "$DATA/cultivation/*"]
|
||||
"assetScope": ["$DATA", "$DATA/cultivation", "$DATA/cultivation/**"]
|
||||
},
|
||||
"all": true
|
||||
},
|
||||
@@ -53,7 +53,7 @@
|
||||
}
|
||||
},
|
||||
"security": {
|
||||
"csp": "default-src 'self' https://asset.localhost; img-src 'self'; img-src https://* asset: https://asset.localhost"
|
||||
"csp": "default-src 'self'; img-src 'self'; img-src https://* asset: https://asset.localhost; media-src https://* asset: https://asset.localhost"
|
||||
},
|
||||
"updater": {
|
||||
"active": false,
|
||||
|
||||
@@ -107,11 +107,11 @@ select:focus {
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
|
||||
backdrop-filter: blur(10px);
|
||||
box-shadow: inset 0px 5px 12px -3px rgb(50 50 50 / 75%);
|
||||
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
backdrop-filter: blur(10px);
|
||||
box-shadow: inset 0px 5px 12px -3px rgb(0, 0, 0, 0.43);
|
||||
}
|
||||
|
||||
@media (max-height: 580px) {
|
||||
|
||||
@@ -38,7 +38,7 @@ class App extends React.Component<Readonly<unknown>, IState> {
|
||||
}
|
||||
|
||||
// Get custom bg AFTER theme is loaded !! important !!
|
||||
const custom_bg = await getConfigOption('customBackground')
|
||||
const custom_bg = await getConfigOption('custom_background')
|
||||
|
||||
if (custom_bg) {
|
||||
const isUrl = /^http(s)?:\/\//gm.test(custom_bg)
|
||||
|
||||
@@ -69,14 +69,6 @@ export class Main extends React.Component<IProps, IState> {
|
||||
setConfigOption('grasscutter_path', payload)
|
||||
})
|
||||
|
||||
listen('migoto_extracted', ({ payload }: { payload: string }) => {
|
||||
setConfigOption('migoto_path', payload)
|
||||
|
||||
invoke('set_migoto_target', {
|
||||
migotoPath: payload,
|
||||
})
|
||||
})
|
||||
|
||||
// Emitted for rsa replacing-purposes
|
||||
listen('game_closed', async () => {
|
||||
const wasPatched = await getConfigOption('patch_rsa')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.Mods {
|
||||
backdrop-filter: blur(10px);
|
||||
height: 90%;
|
||||
height: 80%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ import Back from '../resources/icons/back.svg'
|
||||
import Menu from './components/menu/Menu'
|
||||
import BigButton from './components/common/BigButton'
|
||||
import Tr from '../utils/language'
|
||||
import { ModPages } from './components/mods/ModPages'
|
||||
import TextInput from './components/common/TextInput'
|
||||
|
||||
interface IProps {
|
||||
downloadHandler: DownloadHandler
|
||||
@@ -23,8 +25,21 @@ interface IState {
|
||||
isDownloading: boolean
|
||||
category: string
|
||||
downloadList: { name: string; url: string; mod: ModData }[] | null
|
||||
page: number
|
||||
search: string
|
||||
}
|
||||
|
||||
const pages = [
|
||||
{
|
||||
name: -1,
|
||||
title: '<',
|
||||
},
|
||||
{
|
||||
name: 1,
|
||||
title: '>',
|
||||
},
|
||||
]
|
||||
|
||||
const headers = [
|
||||
{
|
||||
name: 'ripe',
|
||||
@@ -46,17 +61,22 @@ const headers = [
|
||||
* @TODO Categorizaiton/sorting (by likes, views, etc)
|
||||
*/
|
||||
export class Mods extends React.Component<IProps, IState> {
|
||||
timeout: number
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
this.timeout = 0
|
||||
|
||||
this.state = {
|
||||
isDownloading: false,
|
||||
category: '',
|
||||
downloadList: null,
|
||||
page: 1,
|
||||
search: '',
|
||||
}
|
||||
|
||||
this.setCategory = this.setCategory.bind(this)
|
||||
this.addDownload = this.addDownload.bind(this)
|
||||
this.setPage = this.setPage.bind(this)
|
||||
}
|
||||
|
||||
async addDownload(mod: ModData) {
|
||||
@@ -111,6 +131,29 @@ export class Mods extends React.Component<IProps, IState> {
|
||||
)
|
||||
}
|
||||
|
||||
async setPage(value: number) {
|
||||
const current = this.state.page
|
||||
if (current + value == 0) return
|
||||
this.setState(
|
||||
{
|
||||
page: current + value,
|
||||
},
|
||||
this.forceUpdate
|
||||
)
|
||||
}
|
||||
|
||||
async setSearch(text: string) {
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
this.timeout = window.setTimeout(() => {
|
||||
this.setState(
|
||||
{
|
||||
search: text,
|
||||
},
|
||||
this.forceUpdate
|
||||
)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="Mods">
|
||||
@@ -162,7 +205,30 @@ export class Mods extends React.Component<IProps, IState> {
|
||||
|
||||
<ModHeader onChange={this.setCategory} headers={headers} defaultHeader={'ripe'} />
|
||||
|
||||
<ModList key={this.state.category} mode={this.state.category} addDownload={this.addDownload} />
|
||||
{this.state.category != 'installed' && (
|
||||
<>
|
||||
<div className="ModPagesPage">
|
||||
<TextInput
|
||||
id="search"
|
||||
key="search"
|
||||
placeholder={this.state.page.toString()}
|
||||
onChange={(text: string) => {
|
||||
this.setSearch(text)
|
||||
}}
|
||||
initalValue={''}
|
||||
/>
|
||||
</div>
|
||||
<ModPages onClick={this.setPage} headers={pages} defaultHeader={this.state.page} />
|
||||
</>
|
||||
)}
|
||||
|
||||
<ModList
|
||||
key={`${this.state.category}_${this.state.page}_${this.state.search}`}
|
||||
mode={this.state.category}
|
||||
addDownload={this.addDownload}
|
||||
page={this.state.page}
|
||||
search={this.state.search}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,17 +8,12 @@
|
||||
justify-content: flex-start;
|
||||
|
||||
height: 100vh;
|
||||
width: 80px;
|
||||
width: 70px;
|
||||
right: 0%;
|
||||
|
||||
z-index: 99;
|
||||
|
||||
background-color: rgba(77, 77, 77, 0.6);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.BarImg:hover {
|
||||
cursor: pointer;
|
||||
background-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.RightBarInner > div {
|
||||
@@ -26,16 +21,11 @@
|
||||
}
|
||||
|
||||
.RightBar img {
|
||||
height: 40px;
|
||||
height: 30px;
|
||||
filter: invert(100%) sepia(0%) saturate(11%) hue-rotate(227deg) brightness(103%) contrast(105%);
|
||||
|
||||
transition: filter 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.RightBar img:hover {
|
||||
filter: invert(75%) sepia(0%) saturate(100%) hue-rotate(0deg) brightness(100%) contrast(100%);
|
||||
}
|
||||
|
||||
@media (max-height: 580px) {
|
||||
.RightBar {
|
||||
height: calc(100vh - 180px);
|
||||
@@ -47,3 +37,25 @@
|
||||
height: calc(100vh - 170px);
|
||||
}
|
||||
}
|
||||
|
||||
.BarImg {
|
||||
transition: 0.2s;
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-color: rgba(0, 0, 0, 0.685);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
.BarImg:hover {
|
||||
cursor: pointer;
|
||||
border: 2px solid #ffc920;
|
||||
}
|
||||
|
||||
.BarImg:hover img {
|
||||
transition: 0.2s;
|
||||
filter: invert(72%) sepia(68%) saturate(777%) hue-rotate(341deg) brightness(113%) contrast(101%);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#playButton .BigButton {
|
||||
height: 100%;
|
||||
box-shadow: 0 0 5px 3px rgba(0, 0, 0, 0.2);
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
#serverControls {
|
||||
|
||||
@@ -31,8 +31,6 @@ interface IState {
|
||||
ipPlaceholder: string
|
||||
portPlaceholder: string
|
||||
|
||||
portHelpText: string
|
||||
|
||||
httpsLabel: string
|
||||
httpsEnabled: boolean
|
||||
|
||||
@@ -55,7 +53,6 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
port: '',
|
||||
ipPlaceholder: '',
|
||||
portPlaceholder: '',
|
||||
portHelpText: '',
|
||||
httpsLabel: '',
|
||||
httpsEnabled: false,
|
||||
launchServer: () => {
|
||||
@@ -90,7 +87,6 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
port: config.last_port || '',
|
||||
ipPlaceholder: await translate('main.ip_placeholder'),
|
||||
portPlaceholder: await translate('help.port_placeholder'),
|
||||
portHelpText: await translate('help.port_help_text'),
|
||||
httpsLabel: await translate('main.https_enable'),
|
||||
httpsEnabled: config.https_enabled || false,
|
||||
swag: config.swag_mode || false,
|
||||
@@ -294,7 +290,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
onChange={this.setPort}
|
||||
initalValue={this.state.port}
|
||||
/>
|
||||
<HelpButton contents={this.state.portHelpText} />
|
||||
<HelpButton contents={'help.port_help_text'} />
|
||||
<Checkbox
|
||||
id="httpsEnable"
|
||||
label={this.state.httpsLabel}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
padding: 0 30px;
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
background: linear-gradient(#ffd326, #ffc61e);
|
||||
background: linear-gradient(#ffcf0d, #fec004);
|
||||
color: #704a1d;
|
||||
font-weight: bold;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
.BigButton:hover {
|
||||
cursor: pointer;
|
||||
background: linear-gradient(#ffc61e, #ffd326);
|
||||
background: linear-gradient(#fdd841, #ffc517);
|
||||
}
|
||||
|
||||
.BigButton.disabled {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
.CheckboxDisplay img {
|
||||
height: 100%;
|
||||
filter: invert(99%) sepia(0%) saturate(1188%) hue-rotate(186deg) brightness(97%) contrast(67%);
|
||||
filter: invert(60%);
|
||||
}
|
||||
|
||||
.Checkbox label {
|
||||
|
||||
@@ -14,13 +14,14 @@ import { listen } from '@tauri-apps/api/event'
|
||||
import HelpButton from '../common/HelpButton'
|
||||
|
||||
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 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 STABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/stable/Grasscutter.zip'
|
||||
const UNSTABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/unstable/Grasscutter.zip'
|
||||
const DEV_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/development/Grasscutter.zip'
|
||||
const RESOURCES_DOWNLOAD = 'https://gitlab.com/YuukiPS/GC-Resources/-/archive/3.5/GC-Resources-3.5.zip' // Use Yuuki res as grasscutter crepe res are broken
|
||||
const RESOURCES_DOWNLOAD = 'https://gitlab.com/YuukiPS/GC-Resources/-/archive/3.6/GC-Resources-3.6.zip' // Use Yuuki res as grasscutter crepe res are broken
|
||||
const MIGOTO_DOWNLOAD =
|
||||
'https://github.com/SilentNightSound/GI-Model-Importer/releases/download/V6.0/3dmigoto-GIMI-for-playing-mods.zip'
|
||||
'https://github.com/SilentNightSound/GI-Model-Importer/releases/download/V7.0/3dmigoto-GIMI-for-playing-mods.zip'
|
||||
|
||||
interface IProps {
|
||||
closeFn: () => void
|
||||
@@ -55,9 +56,10 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
|
||||
this.getGrasscutterFolder = this.getGrasscutterFolder.bind(this)
|
||||
this.downloadGrasscutterFullBuild = this.downloadGrasscutterFullBuild.bind(this)
|
||||
this.downloadGrasscutterFullQuest = this.downloadGrasscutterFullQuest.bind(this)
|
||||
this.downloadGrasscutterStableRepo = this.downloadGrasscutterStableRepo.bind(this)
|
||||
this.downloadGrasscutterDevRepo = this.downloadGrasscutterDevRepo.bind(this)
|
||||
this.downloadGrasscutterStable = this.downloadGrasscutterStable.bind(this)
|
||||
this.downloadGrasscutterUnstable = this.downloadGrasscutterUnstable.bind(this)
|
||||
this.downloadGrasscutterLatest = this.downloadGrasscutterLatest.bind(this)
|
||||
this.downloadResources = this.downloadResources.bind(this)
|
||||
this.downloadMigoto = this.downloadMigoto.bind(this)
|
||||
@@ -141,6 +143,16 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
this.toggleButtons()
|
||||
}
|
||||
|
||||
async downloadGrasscutterFullQuest() {
|
||||
const folder = await this.getGrasscutterFolder()
|
||||
this.props.downloadManager.addDownload(FULL_QUEST_DOWNLOAD, folder + '\\GrasscutterQuests.zip', async () => {
|
||||
await unzip(folder + '\\GrasscutterQuests.zip', folder + '\\', true)
|
||||
this.toggleButtons()
|
||||
})
|
||||
|
||||
this.toggleButtons()
|
||||
}
|
||||
|
||||
async downloadGrasscutterStableRepo() {
|
||||
const folder = await this.getGrasscutterFolder()
|
||||
this.props.downloadManager.addDownload(STABLE_REPO_DOWNLOAD, folder + '\\grasscutter_repo.zip', async () => {
|
||||
@@ -161,16 +173,13 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
this.toggleButtons()
|
||||
}
|
||||
|
||||
async downloadGrasscutterStable() {
|
||||
async downloadGrasscutterUnstable() {
|
||||
const folder = await this.getGrasscutterFolder()
|
||||
this.props.downloadManager.addDownload(STABLE_DOWNLOAD, folder + '\\grasscutter.zip', async () => {
|
||||
this.props.downloadManager.addDownload(UNSTABLE_DOWNLOAD, folder + '\\grasscutter.zip', async () => {
|
||||
await unzip(folder + '\\grasscutter.zip', folder + '\\', true)
|
||||
this.toggleButtons
|
||||
})
|
||||
|
||||
// Also add repo download
|
||||
this.downloadGrasscutterStableRepo()
|
||||
|
||||
this.toggleButtons()
|
||||
}
|
||||
|
||||
@@ -270,29 +279,46 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
{/* <div className="DownloadMenuSection" id="downloadMenuContainerGCStable">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCStable">
|
||||
<Tr
|
||||
text={this.state.grasscutter_set ? 'downloads.grasscutter_stable' : 'downloads.grasscutter_stable_update'}
|
||||
/>
|
||||
<HelpButton contents="help.gc_stable_jar" />
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerGCFullQuest">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCFullQuest">
|
||||
<Tr text={'downloads.grasscutter_fullquest'} />
|
||||
<HelpButton contents="help.gc_fullbuild" />
|
||||
</div>
|
||||
<div className="DownloadValue" id="downloadMenuButtonGCStable">
|
||||
<div className="DownloadValue" id="downloadMenuButtonGCFullQuest">
|
||||
<BigButton
|
||||
disabled={this.state.grasscutter_downloading}
|
||||
onClick={this.downloadGrasscutterStable}
|
||||
id="grasscutterStableBtn"
|
||||
onClick={this.downloadGrasscutterFullQuest}
|
||||
id="grasscutterFullBuildBtn"
|
||||
>
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className="HeaderText" id="downloadMenuIndividualHeader">
|
||||
<Tr text="downloads.individual_header" />
|
||||
</div>
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerGCUnstable">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCUnstable">
|
||||
<Tr
|
||||
text={
|
||||
this.state.grasscutter_set ? 'downloads.grasscutter_unstable' : 'downloads.grasscutter_unstable_update'
|
||||
}
|
||||
/>
|
||||
<HelpButton contents="help.gc_unstable_jar" />
|
||||
</div>
|
||||
<div className="DownloadValue" id="downloadMenuButtonGCUnstable">
|
||||
<BigButton
|
||||
disabled={this.state.grasscutter_downloading}
|
||||
onClick={this.downloadGrasscutterUnstable}
|
||||
id="grasscutterUnstableBtn"
|
||||
>
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerGCDev">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCDev">
|
||||
<Tr
|
||||
|
||||
@@ -111,7 +111,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
grasscutter_with_game: config.grasscutter_with_game || false,
|
||||
language_options: languages,
|
||||
current_language: config.language || 'en',
|
||||
bg_url_or_path: config.customBackground || '',
|
||||
bg_url_or_path: config.custom_background || '',
|
||||
themes: (await getThemeList()).map((t) => t.name),
|
||||
theme: config.theme || 'default',
|
||||
encryption: encEnabled || false,
|
||||
@@ -194,11 +194,6 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
this.setState({
|
||||
migoto_path: value,
|
||||
})
|
||||
|
||||
// Set game exe in Migoto ini
|
||||
invoke('set_migoto_target', {
|
||||
migotoPath: value,
|
||||
})
|
||||
}
|
||||
|
||||
setReshade(value: string) {
|
||||
@@ -231,13 +226,13 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
async setCustomBackground(value: string) {
|
||||
const isUrl = /^(?:http(s)?:\/\/)/gm.test(value)
|
||||
|
||||
if (!value) return await setConfigOption('customBackground', '')
|
||||
if (!value) return await setConfigOption('custom_background', '')
|
||||
|
||||
if (!isUrl) {
|
||||
const filename = value.replace(/\\/g, '/').split('/').pop()
|
||||
const localBgPath = ((await dataDir()) as string).replace(/\\/g, '/')
|
||||
|
||||
await setConfigOption('customBackground', `${localBgPath}/cultivation/bg/${filename}`)
|
||||
await setConfigOption('custom_background', `${localBgPath}/cultivation/bg/${filename}`)
|
||||
|
||||
// Copy the file over to the local directory
|
||||
await invoke('copy_file', {
|
||||
@@ -247,7 +242,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
|
||||
window.location.reload()
|
||||
} else {
|
||||
await setConfigOption('customBackground', value)
|
||||
await setConfigOption('custom_background', value)
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
@@ -541,7 +536,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
readonly={false}
|
||||
clearable={true}
|
||||
customClearBehaviour={async () => {
|
||||
await setConfigOption('customBackground', '')
|
||||
await setConfigOption('custom_background', '')
|
||||
window.location.reload()
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -8,6 +8,8 @@ import { ModTile } from './ModTile'
|
||||
|
||||
interface IProps {
|
||||
mode: string
|
||||
page: number
|
||||
search: string
|
||||
addDownload: (mod: ModData) => void
|
||||
}
|
||||
|
||||
@@ -62,7 +64,8 @@ export class ModList extends React.Component<IProps, IState> {
|
||||
return
|
||||
}
|
||||
|
||||
const mods = await getMods(this.props.mode)
|
||||
const mods = await getMods(this.props.mode, this.props.page, this.props.search)
|
||||
|
||||
const horny = await getConfigOption('horny_mode')
|
||||
|
||||
this.setState({
|
||||
|
||||
66
src/ui/components/mods/ModPages.css
Normal file
66
src/ui/components/mods/ModPages.css
Normal file
@@ -0,0 +1,66 @@
|
||||
.ModPages {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
width: 100%;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
|
||||
padding: 5px;
|
||||
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
background: rgba(77, 77, 77, 0.6);
|
||||
}
|
||||
|
||||
.ModPagesTitle {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
z-index: 3;
|
||||
|
||||
width: 100%;
|
||||
max-width: 20%;
|
||||
}
|
||||
|
||||
.ModPagesTitle:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ModPagesTitle.selected {
|
||||
border-bottom: 0px solid #fff;
|
||||
}
|
||||
|
||||
.ModPagesPage {
|
||||
position: absolute;
|
||||
justify-self: center;
|
||||
left: 50%;
|
||||
margin-top: 10px;
|
||||
transform: translateX(-50%);
|
||||
text-align: center;
|
||||
|
||||
padding: -5px;
|
||||
z-index: 3;
|
||||
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ModPagesPage input {
|
||||
text-align: center;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
height: 18px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
background: rgba(77, 77, 77, 0.6);
|
||||
}
|
||||
|
||||
.ModPagesPage .TextInputWrapper {
|
||||
background: rgba(77, 77, 77, 0.6);
|
||||
z-index: -1;
|
||||
display: inline-block;
|
||||
}
|
||||
54
src/ui/components/mods/ModPages.tsx
Normal file
54
src/ui/components/mods/ModPages.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
import React from 'react'
|
||||
|
||||
import './ModPages.css'
|
||||
|
||||
interface IProps {
|
||||
headers: {
|
||||
title: string
|
||||
name: number
|
||||
}[]
|
||||
onClick: (value: number) => void
|
||||
defaultHeader: number
|
||||
}
|
||||
|
||||
interface IState {
|
||||
selected: number
|
||||
}
|
||||
|
||||
export class ModPages extends React.Component<IProps, IState> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
selected: this.props.defaultHeader,
|
||||
}
|
||||
}
|
||||
|
||||
setSelected(value: number) {
|
||||
const current = this.state.selected
|
||||
if (current + value == 0) return
|
||||
this.setState({
|
||||
selected: current + value,
|
||||
})
|
||||
|
||||
this.props.onClick(value)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="ModPages">
|
||||
{this.props.headers.map((header, index) => {
|
||||
return (
|
||||
<div
|
||||
key={index}
|
||||
className={`ModPagesTitle ${this.state.selected === header.name ? 'selected' : ''}`}
|
||||
onClick={() => this.setSelected(header.name)}
|
||||
>
|
||||
{header.title}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
case 'latest_version':
|
||||
news = (
|
||||
<tr>
|
||||
<td>Latest version: Grasscutter 1.4.6 - Cultivation 1.0.10</td>
|
||||
<td>Latest version: Grasscutter 1.4.8 - Cultivation 1.1.0</td>
|
||||
</tr>
|
||||
)
|
||||
break
|
||||
|
||||
@@ -15,7 +15,7 @@ let defaultConfig: Configuration
|
||||
last_ip: 'localhost',
|
||||
last_port: '443',
|
||||
language: 'en',
|
||||
customBackground: '',
|
||||
custom_background: '',
|
||||
cert_generated: false,
|
||||
theme: 'default',
|
||||
https_enabled: false,
|
||||
@@ -43,7 +43,7 @@ export interface Configuration {
|
||||
last_ip: string
|
||||
last_port: string
|
||||
language: string
|
||||
customBackground: string
|
||||
custom_background: string
|
||||
cert_generated: boolean
|
||||
theme: string
|
||||
https_enabled: boolean
|
||||
|
||||
@@ -117,29 +117,42 @@ interface ModDownload {
|
||||
containsExe: boolean
|
||||
}
|
||||
|
||||
export async function getMods(mode: string) {
|
||||
export async function getMods(mode: string, page: number, search: string) {
|
||||
let modList: GamebananaResponse[] = []
|
||||
let hadMods = true
|
||||
let page = 1
|
||||
|
||||
while (hadMods) {
|
||||
const resp = JSON.parse(
|
||||
await invoke('list_submissions', {
|
||||
mode,
|
||||
page: '' + page,
|
||||
})
|
||||
)
|
||||
if (search.length > 0) {
|
||||
let hadMods = true
|
||||
let page = 1
|
||||
|
||||
if (resp.length === 0) hadMods = false
|
||||
while (hadMods) {
|
||||
const resp = JSON.parse(
|
||||
await invoke('list_submissions', {
|
||||
mode,
|
||||
page: '' + page,
|
||||
search: search,
|
||||
})
|
||||
)
|
||||
|
||||
modList = [...modList, ...resp]
|
||||
page++
|
||||
const total = resp._aMetadata._nRecordCount
|
||||
|
||||
console.log(page)
|
||||
console.log(resp)
|
||||
if (page > total / 15) hadMods = false
|
||||
|
||||
modList = [...modList, ...resp._aRecords]
|
||||
page++
|
||||
}
|
||||
|
||||
return formatGamebananaData(modList)
|
||||
}
|
||||
|
||||
console.log(modList)
|
||||
const resp = JSON.parse(
|
||||
await invoke('list_submissions', {
|
||||
mode,
|
||||
page: '' + page,
|
||||
search: '',
|
||||
})
|
||||
)
|
||||
|
||||
modList = [...modList, ...resp]
|
||||
|
||||
return formatGamebananaData(modList)
|
||||
}
|
||||
|
||||
@@ -89,31 +89,35 @@ export async function loadTheme(theme: ThemeList, document: Document) {
|
||||
const jsIncludes = theme.includes.js
|
||||
|
||||
// Load CSS files
|
||||
cssIncludes.forEach((css) => {
|
||||
if (!css) return
|
||||
if (cssIncludes) {
|
||||
cssIncludes?.forEach((css) => {
|
||||
if (!css) return
|
||||
|
||||
const link = document.createElement('link')
|
||||
const link = document.createElement('link')
|
||||
|
||||
link.rel = 'stylesheet'
|
||||
link.href = convertFileSrc(theme.path + '/' + css)
|
||||
head.appendChild(link)
|
||||
})
|
||||
link.rel = 'stylesheet'
|
||||
link.href = convertFileSrc(theme.path + '/' + css)
|
||||
head.appendChild(link)
|
||||
})
|
||||
}
|
||||
|
||||
// Load JS files
|
||||
jsIncludes.forEach((js) => {
|
||||
if (!js) return
|
||||
if (jsIncludes) {
|
||||
jsIncludes.forEach((js) => {
|
||||
if (!js) return
|
||||
|
||||
const script = document.createElement('script')
|
||||
const script = document.createElement('script')
|
||||
|
||||
script.src = convertFileSrc(theme.path + '/' + js)
|
||||
head.appendChild(script)
|
||||
})
|
||||
script.src = convertFileSrc(theme.path + '/' + js)
|
||||
head.appendChild(script)
|
||||
})
|
||||
}
|
||||
|
||||
// Set custom background
|
||||
if (theme.customBackgroundURL) {
|
||||
// If the custom bg is already set don't overwrite
|
||||
if (config.customBackground === '') {
|
||||
config.customBackground = theme.customBackgroundURL
|
||||
if (config.custom_background === '') {
|
||||
config.custom_background = theme.customBackgroundURL
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,13 +134,13 @@ export async function loadTheme(theme: ThemeList, document: Document) {
|
||||
|
||||
// Set the background
|
||||
// If the custom bg is already set don't overwrite
|
||||
if (config.customBackground === '') {
|
||||
config.customBackground = bgPath + imageName
|
||||
if (config.custom_background === '') {
|
||||
config.custom_background = bgPath + imageName
|
||||
}
|
||||
}
|
||||
|
||||
// Write config
|
||||
await setConfigOption('customBackground', config.customBackground)
|
||||
await setConfigOption('custom_background', config.custom_background)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
42
yarn.lock
42
yarn.lock
@@ -2385,7 +2385,7 @@ acorn@^7.0.0, acorn@^7.1.1:
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
|
||||
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
|
||||
|
||||
acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1:
|
||||
acorn@^8.2.4, acorn@^8.5.0, acorn@^8.7.1:
|
||||
version "8.7.1"
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30"
|
||||
integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==
|
||||
@@ -3570,9 +3570,9 @@ decimal.js@^10.2.1:
|
||||
integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
|
||||
integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
dedent@^0.7.0:
|
||||
version "0.7.0"
|
||||
@@ -3859,10 +3859,10 @@ encodeurl@~1.0.2:
|
||||
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
|
||||
integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==
|
||||
|
||||
enhanced-resolve@^5.9.3:
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6"
|
||||
integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==
|
||||
enhanced-resolve@^5.10.0:
|
||||
version "5.12.0"
|
||||
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634"
|
||||
integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==
|
||||
dependencies:
|
||||
graceful-fs "^4.2.4"
|
||||
tapable "^2.2.0"
|
||||
@@ -5867,9 +5867,9 @@ json-stable-stringify-without-jsonify@^1.0.1:
|
||||
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
|
||||
|
||||
json5@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
|
||||
integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593"
|
||||
integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==
|
||||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
|
||||
@@ -6248,9 +6248,9 @@ minimatch@^5.0.1:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimist@^1.2.0, minimist@^1.2.6:
|
||||
version "1.2.6"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
|
||||
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
|
||||
version "1.2.7"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
|
||||
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==
|
||||
|
||||
mkdirp@~0.5.1:
|
||||
version "0.5.6"
|
||||
@@ -8826,7 +8826,7 @@ walker@^1.0.7:
|
||||
dependencies:
|
||||
makeerror "1.0.12"
|
||||
|
||||
watchpack@^2.3.1:
|
||||
watchpack@^2.4.0:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"
|
||||
integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==
|
||||
@@ -8937,20 +8937,20 @@ webpack-sources@^3.2.3:
|
||||
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
|
||||
|
||||
webpack@^5.64.4:
|
||||
version "5.73.0"
|
||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.73.0.tgz#bbd17738f8a53ee5760ea2f59dce7f3431d35d38"
|
||||
integrity sha512-svjudQRPPa0YiOYa2lM/Gacw0r6PvxptHj4FuEKQ2kX05ZLkjbVc5MnPs6its5j7IZljnIqSVo/OsY2X0IpHGA==
|
||||
version "5.76.1"
|
||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.76.1.tgz#7773de017e988bccb0f13c7d75ec245f377d295c"
|
||||
integrity sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==
|
||||
dependencies:
|
||||
"@types/eslint-scope" "^3.7.3"
|
||||
"@types/estree" "^0.0.51"
|
||||
"@webassemblyjs/ast" "1.11.1"
|
||||
"@webassemblyjs/wasm-edit" "1.11.1"
|
||||
"@webassemblyjs/wasm-parser" "1.11.1"
|
||||
acorn "^8.4.1"
|
||||
acorn "^8.7.1"
|
||||
acorn-import-assertions "^1.7.6"
|
||||
browserslist "^4.14.5"
|
||||
chrome-trace-event "^1.0.2"
|
||||
enhanced-resolve "^5.9.3"
|
||||
enhanced-resolve "^5.10.0"
|
||||
es-module-lexer "^0.9.0"
|
||||
eslint-scope "5.1.1"
|
||||
events "^3.2.0"
|
||||
@@ -8963,7 +8963,7 @@ webpack@^5.64.4:
|
||||
schema-utils "^3.1.0"
|
||||
tapable "^2.1.1"
|
||||
terser-webpack-plugin "^5.1.3"
|
||||
watchpack "^2.3.1"
|
||||
watchpack "^2.4.0"
|
||||
webpack-sources "^3.2.3"
|
||||
|
||||
websocket-driver@>=0.5.1, websocket-driver@^0.7.4:
|
||||
|
||||
Reference in New Issue
Block a user