diff --git a/.eslintrc.json b/.eslintrc.json
index f2dd2be..0238834 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,48 +1,40 @@
{
- "env": {
- "browser": true,
- "es2021": true,
- "node": true
+ "env": {
+ "browser": true,
+ "es2021": true,
+ "node": true
+ },
+ "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "ecmaFeatures": {
+ "jsx": true
},
- "extends": [
- "eslint:recommended",
- "plugin:react/recommended",
- "plugin:@typescript-eslint/recommended",
- "prettier"
- ],
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "ecmaFeatures": {
- "jsx": true
- },
- "ecmaVersion": "latest",
- "sourceType": "module"
- },
- "plugins": [
- "react",
- "@typescript-eslint"
- ],
- "rules": {
- "@typescript-eslint/ban-types": [
- "warn",
- {
- "extendDefaults": true,
- "types": {
- "{}": false
- }
- }
- ],
- "@typescript-eslint/no-unused-vars": [
- "warn",
- {
- "argsIgnorePattern": "^_",
- "varsIgnorePattern": "^_"
- }
- ]
- },
- "settings": {
- "react": {
- "version": "detect"
+ "ecmaVersion": "latest",
+ "sourceType": "module"
+ },
+ "plugins": ["react", "@typescript-eslint"],
+ "rules": {
+ "@typescript-eslint/ban-types": [
+ "warn",
+ {
+ "extendDefaults": true,
+ "types": {
+ "{}": false
}
+ }
+ ],
+ "@typescript-eslint/no-unused-vars": [
+ "warn",
+ {
+ "argsIgnorePattern": "^_",
+ "varsIgnorePattern": "^_"
+ }
+ ]
+ },
+ "settings": {
+ "react": {
+ "version": "detect"
}
+ }
}
diff --git a/.github/workflows/backend-checks.yml b/.github/workflows/backend-checks.yml
index a66b210..3274088 100644
--- a/.github/workflows/backend-checks.yml
+++ b/.github/workflows/backend-checks.yml
@@ -3,12 +3,12 @@ name: Check backend
on:
push:
paths:
- - ".github/workflows/backend-checks.yml"
- - "src-tauri/**"
+ - '.github/workflows/backend-checks.yml'
+ - 'src-tauri/**'
pull_request:
paths:
- - ".github/workflows/backend-checks.yml"
- - "src-tauri/**"
+ - '.github/workflows/backend-checks.yml'
+ - 'src-tauri/**'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
@@ -59,4 +59,3 @@ jobs:
name: clippy (${{ runner.os }})
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./src-tauri/Cargo.toml --no-default-features -- -D warnings
-
diff --git a/.github/workflows/frontend-checks.yml b/.github/workflows/frontend-checks.yml
index 4535d49..993b279 100644
--- a/.github/workflows/frontend-checks.yml
+++ b/.github/workflows/frontend-checks.yml
@@ -3,20 +3,20 @@ name: Check frontend
on:
push:
paths:
- - ".github/workflows/frontend-checks.yml"
- - "src/**"
- - ".eslintrc.json"
- - "package.json"
- - "tsconfig.json"
- - "yarn.lock"
+ - '.github/workflows/frontend-checks.yml'
+ - 'src/**'
+ - '.eslintrc.json'
+ - 'package.json'
+ - 'tsconfig.json'
+ - 'yarn.lock'
pull_request:
paths:
- - ".github/workflows/frontend-checks.yml"
- - "src/**"
- - ".eslintrc.json"
- - "package.json"
- - "tsconfig.json"
- - "yarn.lock"
+ - '.github/workflows/frontend-checks.yml'
+ - 'src/**'
+ - '.eslintrc.json'
+ - 'package.json'
+ - 'tsconfig.json'
+ - 'yarn.lock'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
@@ -34,4 +34,3 @@ jobs:
run: yarn tsc --noEmit
- name: Run ESLint
run: yarn eslint src
-
diff --git a/README.md b/README.md
index 96b7a6c..2e3b963 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,28 @@
# Client Patching Notice
+
For game versions 2.8 and above, Cultivation automatically makes a small patch to your game client when launching using Grasscutter, and restores it upon closing the game. In theory, you should still be totally safe, however it would be dishonest to not explicitly state that **modifying the game client could, theoretically, lead to a ban if you connect to official servers with it**. It is extremely unlikely AND there are no instances known of it happening, but the possibility exists.
# Cultivation
+
A game launcher designed to easily proxy traffic from anime game to private servers.
While the Cultivation repository is **open**. This does **not** mean it has released.
Please do **NOT install, download, or use pre-compiled versions of Cultivation found elsewhere**. Only use releases from this GitHub repository.
# Table Of Contents
-* [Download](#download)
-* [Developer Quick-start](#developer-quickstart)
- * [Setup](#setup)
- * [Building](#building)
- * [Code Formatting and Linting](#code-formatting-and-linting)
- * [Generating Update Artifacts](#generating-update-artifacts)
-* [Theming](#theming)
-* [Screenshots](#screenshots)
-* [Credits](#credits)
+- [Download](#download)
+- [Developer Quick-start](#developer-quickstart)
+ - [Setup](#setup)
+ - [Building](#building)
+ - [Code Formatting and Linting](#code-formatting-and-linting)
+ - [Generating Update Artifacts](#generating-update-artifacts)
+- [Theming](#theming)
+- [Screenshots](#screenshots)
+- [Credits](#credits)
# Download
+
[Find release builds here!](https://github.com/Grasscutters/Cultivation/releases)
Once downloaded, extract somewhere and open as administrator.
@@ -27,27 +30,33 @@ Once downloaded, extract somewhere and open as administrator.
# Developer Quickstart
### Setup
-* Install [NodeJS >12](https://nodejs.org/en/)
-* 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`
+
+- Install [NodeJS >12](https://nodejs.org/en/)
+- 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`
### Building
+
For a release build,
+
- `yarn build`
For a debug build,
+
- `yarn build --debug`
### Code Formatting and Linting
+
- `yarn format`
- `yarn lint`
### Generating Update Artifacts
-* Add the `TAURI_PRIVATE_KEY` as an environment variable with a path to your private key.
-* Add the `TAURI_KEY_PASSWORD` as an environment variable with the password for your private key.
-* `yarn build`
+
+- Add the `TAURI_PRIVATE_KEY` as an environment variable with a path to your private key.
+- Add the `TAURI_KEY_PASSWORD` as an environment variable with the password for your private key.
+- `yarn build`
The update will be at `src-tauri/target/(release|debug)/msi/Cultivation_X.X.X_x64_xx-XX.msi.zip`
@@ -56,6 +65,7 @@ The update will be at `src-tauri/target/(release|debug)/msi/Cultivation_X.X.X_x6
A full theming reference can be found [here!](/THEMES.md)
# Screenshots
+
![image](https://user-images.githubusercontent.com/25207995/173211603-e5e85df7-7fd3-430b-9246-749ebbc1e483.png)
![image](https://user-images.githubusercontent.com/25207995/173211543-b7e88943-cfd2-418b-ac48-7f856868129b.png)
![image](https://user-images.githubusercontent.com/25207995/173211561-a1778fdc-5cfe-4687-9a00-44500d29e470.png)
@@ -63,8 +73,9 @@ A full theming reference can be found [here!](/THEMES.md)
![image](https://user-images.githubusercontent.com/25207995/173211590-6a2242b5-1e8f-4db9-a5c7-06284688b131.png)
## Credits
-* [SpikeHD](https://github.com/SpikeHD): For originally creating **GrassClipper** and creating the amazing UI of Cultivation.
-* [KingRainbow44](https://github.com/KingRainbow44): For building a proxy daemon from scratch and integrating it with Cultivation.
-* [Benj](https://github.com/4Benj): For assistance in client patching.
-* [lilmayofuksu](https://github.com/lilmayofuksu): For assistance in client patching.
-* [Tauri](https://tauri.app): For providing an amazing, efficient, and simple desktop application framework/library.
+
+- [SpikeHD](https://github.com/SpikeHD): For originally creating **GrassClipper** and creating the amazing UI of Cultivation.
+- [KingRainbow44](https://github.com/KingRainbow44): For building a proxy daemon from scratch and integrating it with Cultivation.
+- [Benj](https://github.com/4Benj): For assistance in client patching.
+- [lilmayofuksu](https://github.com/lilmayofuksu): For assistance in client patching.
+- [Tauri](https://tauri.app): For providing an amazing, efficient, and simple desktop application framework/library.
diff --git a/THEMES.md b/THEMES.md
index 4350cd3..2c83157 100644
--- a/THEMES.md
+++ b/THEMES.md
@@ -2,7 +2,7 @@
1. Download your favorite theme! (You can find some in the `#themes` channel on Discord)
2. Place the unzipped theme folder inside of `%appdata%/cultivation/themes` (The path should look something like this: `cultivation/themes/theme_name/index.json`)
-4. Enable within Cultivation!
+3. Enable within Cultivation!
# Creating your own theme
@@ -16,16 +16,16 @@ You will need CSS and JS experience if you want to do anything cool.
`index.json` is where you tell Cultivation which files and images to include. It supports the following properties:
-| Property | Description |
-| :--- | :--- |
-| `name` | The name of the theme. |
-| `version` | Not shown anywhere, the version of the theme. |
-| `description` | Not shown anywhere, the description of the theme. |
-| `includes` | The files and folders to include. |
-| `includes.css` | Array of CSS files to include. Example: `css: ["index.css"]` |
-| `includes.js` | Array of JS files to includes. Example `js: ["index.js"]` |
-| `customBackgroundURL` | A custom image URL to set as the background. Backgrounds that users set in their config supercede this. Example: `"https://website.com/image.png"` |
-| `customBackgroundFile` | Path to a custom background image file. Backgrounds that users set in their config supercede this. Example: `"/image.png"` |
+| Property | Description |
+| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `name` | The name of the theme. |
+| `version` | Not shown anywhere, the version of the theme. |
+| `description` | Not shown anywhere, the description of the theme. |
+| `includes` | The files and folders to include. |
+| `includes.css` | Array of CSS files to include. Example: `css: ["index.css"]` |
+| `includes.js` | Array of JS files to includes. Example `js: ["index.js"]` |
+| `customBackgroundURL` | A custom image URL to set as the background. Backgrounds that users set in their config supercede this. Example: `"https://website.com/image.png"` |
+| `customBackgroundFile` | Path to a custom background image file. Backgrounds that users set in their config supercede this. Example: `"/image.png"` |
A full, complete `index.json` will look something like this:
@@ -55,15 +55,17 @@ Below are some small examples of what you can do:
```css
/* Change the font */
body {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
}
```
+
```css
/* Remove the news section */
.NewsSection {
display: none;
}
```
+
```css
/* Change the right bar width */
.RightBar {
@@ -72,6 +74,7 @@ body {
```
## How can I change XYZ element?
+
Every element is documented and describe [here](/docs/elementIds.md). Every\* single DOM element is assigned an ID to allow for easy and hyper-specific editing.
## Writing your JS
@@ -83,24 +86,26 @@ Below are some examples of what you can do:
```js
/* Change the version number every 500ms */
setInterval(() => {
- document.getElementById("version").innerHTML = "v" + Math.floor(Math.random() * 100);
-}, 500);
+ document.getElementById('version').innerHTML = 'v' + Math.floor(Math.random() * 100)
+}, 500)
```
+
```js
/* Load a custom font */
const head = document.head
-const link = document.createElement("link")
+const link = document.createElement('link')
-link.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
-link.rel = "stylesheet"
-link.type = "text/css"
+link.href = 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'
+link.rel = 'stylesheet'
+link.type = 'text/css'
head.appendChild(link)
```
+
```js
/* Create a new button that does nothing */
-const newButton = document.createElement("button");
-newButton.innerHTML = "New Button";
+const newButton = document.createElement('button')
+newButton.innerHTML = 'New Button'
-document.body.appendChild(newButton);
+document.body.appendChild(newButton)
```
diff --git a/docs/elementIds.md b/docs/elementIds.md
index 8f87a00..1910a61 100644
--- a/docs/elementIds.md
+++ b/docs/elementIds.md
@@ -1,133 +1,135 @@
# Documentation of Element ID's and Classes for custom theming
## IDs
+
This does not include commonly used components (buttons, divider lines, commit author and message, etc...) for accessing and modifying those elements, please check `Classes` section bellow.
-| #ID | Description |
-|----------------------------------------|-----------------------------------------------------------------|
-| `#miniDialogContainer` | Main container of MiniDialog |
-| `#miniDialogContainerTop` | Affects only top section of MiniDialog |
-| `#miniDialogButtonClose` | Close button (SVG) of MiniDialog |
-| `#miniDialogContent` | MiniDialog content |
-| `#rightBarContainer` | Main container of RightBar |
-| `#rightBarContent` | RightBar content |
-| `#rightBarButtonDiscord` | Discord button on the RightBar |
-| `#rightBarButtonGithub` | Github button on the RightBar |
-| `#playButton` | Main container for whole launch buttons section |
-| `#serverControls` | Container of "play on grasscutter" checkbox |
-| `#enableGC` | "play on grasscutter" checkbox |
-| `#ip` | Server ip input if play on grasscutter is enabled |
-| `#port` | Server port input if play on grasscutter is enabled |
-| `#httpsEnable` | "Enable https" checkbox if play on grasscutter is enabled |
-| `#officialPlay` | Launch button |
-| `#serverLaunch` | Launch server button |
-| `#serverlaunchIcon` | Icon (SVG) of server launch button |
-| `#serverConfigContainer` | Main container of server configuration section |
-| `#serverLaunchContainer` | Main container of launch buttons (includes launch server) |
-| `#topBarContainer` | Main container of launcher TopBar (minimize, exit, settings...) |
-| `#title` | Title of the TopBar |
-| `#version` | Version of the launcher in TopBar |
-| `#topBarButtonContainer` | Container of launcher TopBar buttons only |
-| `#closeBtn` | Exit launcher button |
-| `#minBtn` | Minimize launcher button |
-| `#settingsBtn` | Settings button |
-| `#downloadsBtn` | Downloads button (grasscutter resources, grasscutter...) |
-| `#newsContainer` | Main container of the news section |
-| `#newsTabsContainer` | Container for news tabs |
-| `#commits` | News tabs container commits button |
-| `#latest_version` | News tabs for latest version button |
-| `#newsContent` | Content section of news container |
-| `#newsCommitsTable` | Commits table of news section |
-| `#downloadMenuContainerGCStable` | Grasscutter stable update container |
-| `#downloadMenuLabelGCStable` | Label for stable update button |
-| `#downloadMenuButtonGCStable` | Button container for stable update button |
-| `#grasscutterStableBtn` | "Update grasscutter stable" button |
-| `#downloadMenuContainerGCDev` | Grasscutter development update container |
-| `#downloadMenuLabelGCDev` | Label for latest update button |
-| `#downloadMenuButtonGCDev` | Button container for latest update button |
-| `grasscutterLatestBtn` | "Update grasscutter latest" button |
-| `#downloadMenuContainerGCStableData` | Grasscutter stable data update container |
-| `#downloadMenuLabelGCStableData` | Label for stable data update |
-| `#downloadMenuButtonGCStableData` | Button container for stable data update button |
-| `#grasscutterStableRepo` | "Update grasscutter stable data" button |
-| `#downloadMenuContainerGCDevData` | Grasscutter latest data update container |
-| `#downloadMenuLabelGCDevData` | Label for latest data update |
-| `#downloadMenuButtonGCDevData` | Button container for latest data update button |
-| `#grasscutterDevRepo` | "Update grasscutter latest data" button |
-| `#downloadMenuContainerResources` | Container for grasscutter resources download |
-| `#downloadMenuLabelResources` | label for resources download |
-| `#downloadMenuButtonResources` | Button container for resources download button |
-| `#resourcesBtn` | "Download grasscutter resources" button |
-| `#menuContainer` | Generic Popup modal like menu container |
-| `#menuContainerTop` | Top section of menu container |
-| `#menuHeading` | Menu title |
-| `#menuButtonCloseContainer` | Container for menu close button |
-| `#menuButtonCloseIcon` | Menu close icon (SVG) |
-| `#menuContent` | Content section of the menu |
-| `#menuOptionsContainerGameExec` | Container for game executable option section |
-| `#menuOptionsLabelGameExec` | Label for game executable option |
-| `#menuOptionsDirGameExec` | Set game executable file browser |
-| `#menuOptionsContainerGCJar` | Container for grasscutter jar option |
-| `#menuOptionsLabelGCJar` | Label for grasscutter jar option |
-| `#menuOptionsDirGCJar` | Set grasscutter jar file browser |
-| `#menuOptionsContainerToggleEnc` | Container for toggle encryption option |
-| `#menuOptionsLabelToggleEnc` | Label for toggle encryption option |
-| `#menuOptionsButtonToggleEnc` | Toggle encryption button container |
-| `#toggleEnc` | Toggle encryption button |
-| `#menuOptionsContainerGCWGame` | Container for "grasscutter with game" option |
-| `#menuOptionsLabelGCWDame` | Label for "grasscutter with game" option |
-| `#menuOptionsCheckboxGCWGame` | Container for "grasscutter with game" option checkbox |
-| `#gcWithGame` | Grasscutter with game checkbox |
-| `#menuOptionsContainerThemes` | Container for themes section |
-| `#menuOptionsLabelThemes` | Label for set themes option |
-| `#menuOptionsSelectThemes` | Container for themes select menu |
-| `#menuOptionsSelectMenuThemes` | Set theme select menu |
-| `#menuOptionsContainerJavaPath` | Container for Java Path option |
-| `#menuOptionsLabelJavaPath` | Label for Java path option |
-| `#menuOptionsDirJavaPath` | Container for java path file browser |
-| `#menuOptionsContainerBG` | Container for Background option |
-| `#menuOptionsLabelBG` | Label for background option |
-| `#menuOptionsDirBG` | Container for background url/local path option |
-| `#menuOptionsContainerLang` | Container for language change option |
-| `#menuOptionsLabelLang` | Label for language change option |
-| `#menuOptionsSelectLang` | Container for language change select menu |
-| `#menuOptionsSelectMenuLang` | Language select menu |
-| `#DownloadProgress` | Download progress container |
-| `#bottomSectionContainer` | Bottom section container |
-| `#miniDownloadContainer` | Container for mini download |
+| #ID | Description |
+| ------------------------------------ | --------------------------------------------------------------- |
+| `#miniDialogContainer` | Main container of MiniDialog |
+| `#miniDialogContainerTop` | Affects only top section of MiniDialog |
+| `#miniDialogButtonClose` | Close button (SVG) of MiniDialog |
+| `#miniDialogContent` | MiniDialog content |
+| `#rightBarContainer` | Main container of RightBar |
+| `#rightBarContent` | RightBar content |
+| `#rightBarButtonDiscord` | Discord button on the RightBar |
+| `#rightBarButtonGithub` | Github button on the RightBar |
+| `#playButton` | Main container for whole launch buttons section |
+| `#serverControls` | Container of "play on grasscutter" checkbox |
+| `#enableGC` | "play on grasscutter" checkbox |
+| `#ip` | Server ip input if play on grasscutter is enabled |
+| `#port` | Server port input if play on grasscutter is enabled |
+| `#httpsEnable` | "Enable https" checkbox if play on grasscutter is enabled |
+| `#officialPlay` | Launch button |
+| `#serverLaunch` | Launch server button |
+| `#serverlaunchIcon` | Icon (SVG) of server launch button |
+| `#serverConfigContainer` | Main container of server configuration section |
+| `#serverLaunchContainer` | Main container of launch buttons (includes launch server) |
+| `#topBarContainer` | Main container of launcher TopBar (minimize, exit, settings...) |
+| `#title` | Title of the TopBar |
+| `#version` | Version of the launcher in TopBar |
+| `#topBarButtonContainer` | Container of launcher TopBar buttons only |
+| `#closeBtn` | Exit launcher button |
+| `#minBtn` | Minimize launcher button |
+| `#settingsBtn` | Settings button |
+| `#downloadsBtn` | Downloads button (grasscutter resources, grasscutter...) |
+| `#newsContainer` | Main container of the news section |
+| `#newsTabsContainer` | Container for news tabs |
+| `#commits` | News tabs container commits button |
+| `#latest_version` | News tabs for latest version button |
+| `#newsContent` | Content section of news container |
+| `#newsCommitsTable` | Commits table of news section |
+| `#downloadMenuContainerGCStable` | Grasscutter stable update container |
+| `#downloadMenuLabelGCStable` | Label for stable update button |
+| `#downloadMenuButtonGCStable` | Button container for stable update button |
+| `#grasscutterStableBtn` | "Update grasscutter stable" button |
+| `#downloadMenuContainerGCDev` | Grasscutter development update container |
+| `#downloadMenuLabelGCDev` | Label for latest update button |
+| `#downloadMenuButtonGCDev` | Button container for latest update button |
+| `grasscutterLatestBtn` | "Update grasscutter latest" button |
+| `#downloadMenuContainerGCStableData` | Grasscutter stable data update container |
+| `#downloadMenuLabelGCStableData` | Label for stable data update |
+| `#downloadMenuButtonGCStableData` | Button container for stable data update button |
+| `#grasscutterStableRepo` | "Update grasscutter stable data" button |
+| `#downloadMenuContainerGCDevData` | Grasscutter latest data update container |
+| `#downloadMenuLabelGCDevData` | Label for latest data update |
+| `#downloadMenuButtonGCDevData` | Button container for latest data update button |
+| `#grasscutterDevRepo` | "Update grasscutter latest data" button |
+| `#downloadMenuContainerResources` | Container for grasscutter resources download |
+| `#downloadMenuLabelResources` | label for resources download |
+| `#downloadMenuButtonResources` | Button container for resources download button |
+| `#resourcesBtn` | "Download grasscutter resources" button |
+| `#menuContainer` | Generic Popup modal like menu container |
+| `#menuContainerTop` | Top section of menu container |
+| `#menuHeading` | Menu title |
+| `#menuButtonCloseContainer` | Container for menu close button |
+| `#menuButtonCloseIcon` | Menu close icon (SVG) |
+| `#menuContent` | Content section of the menu |
+| `#menuOptionsContainerGameExec` | Container for game executable option section |
+| `#menuOptionsLabelGameExec` | Label for game executable option |
+| `#menuOptionsDirGameExec` | Set game executable file browser |
+| `#menuOptionsContainerGCJar` | Container for grasscutter jar option |
+| `#menuOptionsLabelGCJar` | Label for grasscutter jar option |
+| `#menuOptionsDirGCJar` | Set grasscutter jar file browser |
+| `#menuOptionsContainerToggleEnc` | Container for toggle encryption option |
+| `#menuOptionsLabelToggleEnc` | Label for toggle encryption option |
+| `#menuOptionsButtonToggleEnc` | Toggle encryption button container |
+| `#toggleEnc` | Toggle encryption button |
+| `#menuOptionsContainerGCWGame` | Container for "grasscutter with game" option |
+| `#menuOptionsLabelGCWDame` | Label for "grasscutter with game" option |
+| `#menuOptionsCheckboxGCWGame` | Container for "grasscutter with game" option checkbox |
+| `#gcWithGame` | Grasscutter with game checkbox |
+| `#menuOptionsContainerThemes` | Container for themes section |
+| `#menuOptionsLabelThemes` | Label for set themes option |
+| `#menuOptionsSelectThemes` | Container for themes select menu |
+| `#menuOptionsSelectMenuThemes` | Set theme select menu |
+| `#menuOptionsContainerJavaPath` | Container for Java Path option |
+| `#menuOptionsLabelJavaPath` | Label for Java path option |
+| `#menuOptionsDirJavaPath` | Container for java path file browser |
+| `#menuOptionsContainerBG` | Container for Background option |
+| `#menuOptionsLabelBG` | Label for background option |
+| `#menuOptionsDirBG` | Container for background url/local path option |
+| `#menuOptionsContainerLang` | Container for language change option |
+| `#menuOptionsLabelLang` | Label for language change option |
+| `#menuOptionsSelectLang` | Container for language change select menu |
+| `#menuOptionsSelectMenuLang` | Language select menu |
+| `#DownloadProgress` | Download progress container |
+| `#bottomSectionContainer` | Bottom section container |
+| `#miniDownloadContainer` | Container for mini download |
## Classes
+
This is not full list of all classes, rather its list of classes for commonly used components that can not be accessed using element id system.
-| .Class | Description |
-|-----------------------------|---------------------------------------------------------|
-| `.BigButton` | Class for all buttons |
-| `.BigButtonText` | Text inside a button | |
-| `.Checkbox` | Checkbox container |
-| `.CheckboxDisplay` | Content of checkbox |
-| `.DirInput` | Container for DirInput |
-| `.FileSelectIcon` | Icon of DirInput |
-| `.DownloadList` | List of all downloads |
-| `.DownloadSection` | Container for each download |
-| `.DownloadTitle` | Contains file download path and current status |
-| `.DownloadPath` | Path of a download |
-| `.DownloadStatus` | Status of a download |
-| `.DownloadSectionInner` | Contains progressbar of the download section |
-| `.HelpSection` | Container for help "?" circle button |
-| `.HelpButton` | HelpButton itself |
-| `.HelpContents` | Content of help button once expanded |
-| `.MainProgressBarWrapper` | Container for MainProgressBar |
-| `.ProgressBar` | ProgressBar (creativity left the brain) |
-| `.InnerProgress` | ProgressBar percentage |
-| `.MainProgressText` | Text for MainProgressBar |
-| `.ProgressBarWrapper` | Container for ProgressBar |
-| `.DownloadControls` | DownloadControls of ProgressBar |
-| `.downloadStop` | Container for download stop icon (SVG) |
-| `.ProgressText` | Text of the ProgressBar display current download status |
-| `.TextInputWrapper` | Container for TextInput |
-| `.TextClear` | Container for clear input content button |
-| `.TextInputClear` | TextInput clear button icon (SVG) |
-| `.Divider` | Container for line dividers |
-| `.DividerLine` | Divider line itself |
-| `.CommitAuthor` | Author of a commit |
-| `.CommitMessage` | Message of a commit |
\ No newline at end of file
+| .Class | Description |
+| ------------------------- | ------------------------------------------------------- | --- |
+| `.BigButton` | Class for all buttons |
+| `.BigButtonText` | Text inside a button | |
+| `.Checkbox` | Checkbox container |
+| `.CheckboxDisplay` | Content of checkbox |
+| `.DirInput` | Container for DirInput |
+| `.FileSelectIcon` | Icon of DirInput |
+| `.DownloadList` | List of all downloads |
+| `.DownloadSection` | Container for each download |
+| `.DownloadTitle` | Contains file download path and current status |
+| `.DownloadPath` | Path of a download |
+| `.DownloadStatus` | Status of a download |
+| `.DownloadSectionInner` | Contains progressbar of the download section |
+| `.HelpSection` | Container for help "?" circle button |
+| `.HelpButton` | HelpButton itself |
+| `.HelpContents` | Content of help button once expanded |
+| `.MainProgressBarWrapper` | Container for MainProgressBar |
+| `.ProgressBar` | ProgressBar (creativity left the brain) |
+| `.InnerProgress` | ProgressBar percentage |
+| `.MainProgressText` | Text for MainProgressBar |
+| `.ProgressBarWrapper` | Container for ProgressBar |
+| `.DownloadControls` | DownloadControls of ProgressBar |
+| `.downloadStop` | Container for download stop icon (SVG) |
+| `.ProgressText` | Text of the ProgressBar display current download status |
+| `.TextInputWrapper` | Container for TextInput |
+| `.TextClear` | Container for clear input content button |
+| `.TextInputClear` | TextInput clear button icon (SVG) |
+| `.Divider` | Container for line dividers |
+| `.DividerLine` | Divider line itself |
+| `.CommitAuthor` | Author of a commit |
+| `.CommitMessage` | Message of a commit |
diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md
index 7e0a38b..1ba8d22 100644
--- a/docs/troubleshooting.md
+++ b/docs/troubleshooting.md
@@ -1,15 +1,19 @@
# Troubleshooting
+
A guide dedicated for trying to troubleshoot Cultivation.
## The launcher doesn't appear to open.
+
Try running the launcher with **administrative privileges**.\
If this fixes your issue, you can force enable it in the **Compatability**\
tab for the launcher's executable.
## Unable to play on `localhost`.
+
Make sure your server is running with **encryption disabled** and `useInRouting` to **false**.\
Additionally, make sure Cultivation **is set to not use HTTPS**.
## "I can't do anything requiring the internet after closing Cultivation!"
+
You probably didn't close Cultivation properly.\
-Go to your *Windows Settings*, then *Network*, then *Proxy*, then disable it.
\ No newline at end of file
+Go to your _Windows Settings_, then _Network_, then _Proxy_, then disable it.
diff --git a/public/index.html b/public/index.html
index 030b8e7..900bdf1 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,10 +5,7 @@
-
+
Cultivation
diff --git a/src-tauri/lang/de.json b/src-tauri/lang/de.json
index 85b58b1..cbce7f5 100644
--- a/src-tauri/lang/de.json
+++ b/src-tauri/lang/de.json
@@ -1,61 +1,61 @@
-{
- "lang_name": "Deutsch",
- "main": {
- "title": "Cultivation",
- "launch_button": "Starten",
- "gc_enable": "Über Grasscutter verbinden",
- "https_enable": "HTTPS nutzen",
- "ip_placeholder": "Server Adresse...",
- "port_placeholder": "Port...",
- "files_downloading": "Herunterladen von Dateien: ",
- "files_extracting": "Extrahieren von Dateien: "
- },
- "options": {
- "enabled": "Aktiviert",
- "disabled": "Deaktiviert",
- "game_executable": "Spiel Datei auswählen",
- "grasscutter_jar": "Grasscuter JAR auswählen",
- "toggle_encryption": "Verschlüsselung umschalten",
- "java_path": "Benutzerdefinierten Java Pfad setzen",
- "grasscutter_with_game": "Grasscutter automatisch mit dem Spiel starten",
- "language": "Sprache auswählen",
- "background": "Benutzerdefinierten Hintergrund festlegen (link oder bild)",
- "theme": "Theme auswählen"
- },
- "downloads": {
- "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_latest": "Aktuellste Grasscutter Version herunterladen",
- "grasscutter_stable_update": "Stabile Grasscutter Version aktualisieren",
- "grasscutter_latest_update": "Aktuellste Grasscutter Version aktualisieren",
- "resources": "Grasscutter Ressourcen herunterladen"
- },
- "download_status": {
- "downloading": "Lädt herunter",
- "extracting": "Extrahiert",
- "error": "Fehler",
- "finished": "Fertig",
- "stopped": "Gestoppt"
- },
- "components": {
- "select_file": "Datei oder Ordner auswählen...",
- "select_folder": "Ordner auswählen...",
- "download": "Herunterladen"
- },
- "news": {
- "latest_commits": "Letzte Commits",
- "latest_version": "Letzte Version"
- },
- "help": {
- "port_help_text": "Vergewissern Sie sich, dass es sich um den Port des Dispatch-Servers handelt, nicht um den Port des Spiel-Servers. Dieser ist fast immer '443'.",
- "game_help_text": "Sie müssen keine separate Kopie verwenden, um mit Grasscutter zu spielen. Dies ist entweder für ein Downgrade auf die Version 2.6 oder wenn Sie das Spiel nicht installiert haben.",
- "gc_stable_jar": "Laden Sie den aktuellen stabilen Grasscutter-Build herunter, der eine Jar-Datei und Datendateien enthält.",
- "gc_dev_jar": "Laden Sie die neueste Grasscutter-Entwicklungsversion herunter, welche eine Jar-Datei und Datendateien enthält.",
- "gc_stable_data": "Laden Sie die stabilen Grasscutter Daten herunter, welche keine Jar-Datei enthalten. Dies ist nützlich zum Aktualisieren.",
- "gc_dev_data": "Laden Sie die neuesten Grasscutter-Entwicklungsdateien herunter, welche keine Jar-Datei enthält. Dies ist nützlich zum Aktualisieren.",
- "resources": "Diese werden auch benötigt, um einen Grasscutter-Server auszuführen. Diese Schaltfläche ist grau, wenn Sie einen bestehenden Ressourcenordner mit Inhalten haben"
- }
- }
\ No newline at end of file
+{
+ "lang_name": "Deutsch",
+ "main": {
+ "title": "Cultivation",
+ "launch_button": "Starten",
+ "gc_enable": "Über Grasscutter verbinden",
+ "https_enable": "HTTPS nutzen",
+ "ip_placeholder": "Server Adresse...",
+ "port_placeholder": "Port...",
+ "files_downloading": "Herunterladen von Dateien: ",
+ "files_extracting": "Extrahieren von Dateien: "
+ },
+ "options": {
+ "enabled": "Aktiviert",
+ "disabled": "Deaktiviert",
+ "game_executable": "Spiel Datei auswählen",
+ "grasscutter_jar": "Grasscuter JAR auswählen",
+ "toggle_encryption": "Verschlüsselung umschalten",
+ "java_path": "Benutzerdefinierten Java Pfad setzen",
+ "grasscutter_with_game": "Grasscutter automatisch mit dem Spiel starten",
+ "language": "Sprache auswählen",
+ "background": "Benutzerdefinierten Hintergrund festlegen (link oder bild)",
+ "theme": "Theme auswählen"
+ },
+ "downloads": {
+ "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_latest": "Aktuellste Grasscutter Version herunterladen",
+ "grasscutter_stable_update": "Stabile Grasscutter Version aktualisieren",
+ "grasscutter_latest_update": "Aktuellste Grasscutter Version aktualisieren",
+ "resources": "Grasscutter Ressourcen herunterladen"
+ },
+ "download_status": {
+ "downloading": "Lädt herunter",
+ "extracting": "Extrahiert",
+ "error": "Fehler",
+ "finished": "Fertig",
+ "stopped": "Gestoppt"
+ },
+ "components": {
+ "select_file": "Datei oder Ordner auswählen...",
+ "select_folder": "Ordner auswählen...",
+ "download": "Herunterladen"
+ },
+ "news": {
+ "latest_commits": "Letzte Commits",
+ "latest_version": "Letzte Version"
+ },
+ "help": {
+ "port_help_text": "Vergewissern Sie sich, dass es sich um den Port des Dispatch-Servers handelt, nicht um den Port des Spiel-Servers. Dieser ist fast immer '443'.",
+ "game_help_text": "Sie müssen keine separate Kopie verwenden, um mit Grasscutter zu spielen. Dies ist entweder für ein Downgrade auf die Version 2.6 oder wenn Sie das Spiel nicht installiert haben.",
+ "gc_stable_jar": "Laden Sie den aktuellen stabilen Grasscutter-Build herunter, der eine Jar-Datei und Datendateien enthält.",
+ "gc_dev_jar": "Laden Sie die neueste Grasscutter-Entwicklungsversion herunter, welche eine Jar-Datei und Datendateien enthält.",
+ "gc_stable_data": "Laden Sie die stabilen Grasscutter Daten herunter, welche keine Jar-Datei enthalten. Dies ist nützlich zum Aktualisieren.",
+ "gc_dev_data": "Laden Sie die neuesten Grasscutter-Entwicklungsdateien herunter, welche keine Jar-Datei enthält. Dies ist nützlich zum Aktualisieren.",
+ "resources": "Diese werden auch benötigt, um einen Grasscutter-Server auszuführen. Diese Schaltfläche ist grau, wenn Sie einen bestehenden Ressourcenordner mit Inhalten haben"
+ }
+}
diff --git a/src-tauri/lang/en.json b/src-tauri/lang/en.json
index d97ad77..4255dbd 100644
--- a/src-tauri/lang/en.json
+++ b/src-tauri/lang/en.json
@@ -69,4 +69,4 @@
"akebi": "Set Akebi Executable",
"migoto": "Set 3dMigoto Executable"
}
-}
\ No newline at end of file
+}
diff --git a/src-tauri/lang/es.json b/src-tauri/lang/es.json
index e75fe69..86e606d 100644
--- a/src-tauri/lang/es.json
+++ b/src-tauri/lang/es.json
@@ -66,4 +66,4 @@
"swag": {
"akebi": "Establecer el ejecutable de Akebi"
}
-}
\ No newline at end of file
+}
diff --git a/src-tauri/lang/id.json b/src-tauri/lang/id.json
index 25afcdf..faafe47 100644
--- a/src-tauri/lang/id.json
+++ b/src-tauri/lang/id.json
@@ -18,7 +18,7 @@
"background": "Atur Kustom Latar Belakang (link atau gambar file)",
"theme": "Atur Tema"
},
- "downloads": {
+ "downloads": {
"grasscutter_stable_data": "Sedang Mendownload Grasscutter Versi Stabil",
"grasscutter_latest_data": "Sedang Mendownload Grasscutter Data Terbaru",
"grasscutter_stable_data_update": "Memperbaharui Grasscutter Data Stabil",
@@ -54,4 +54,4 @@
"gc_dev_data": "Unduh file data Grasscutter Development saat ini, dimana Tidak Ada JAR file. Ini Berguna Untuk memperbarui.",
"resources": "Ini juga diperlukan untuk menjalankan server Grasscutter. Tombol ini akan berwarna abu-abu jika Anda memiliki folder Resource yang ada dengan File di dalamnya"
}
-}
\ No newline at end of file
+}
diff --git a/src-tauri/lang/ru.json b/src-tauri/lang/ru.json
index 6e21a89..2dbb2ad 100644
--- a/src-tauri/lang/ru.json
+++ b/src-tauri/lang/ru.json
@@ -1,61 +1,61 @@
-{
- "lang_name": "Русский",
- "main": {
- "title": "Cultivation",
- "launch_button": "Запустить",
- "gc_enable": "Подключиться с Grasscutter",
- "https_enable": "Исп. HTTPS",
- "ip_placeholder": "Айпи адрес...",
- "port_placeholder": "Порт...",
- "files_downloading": "Файлов скачано: ",
- "files_extracting": "Извлечено файлов: "
- },
- "options": {
- "enabled": "Включено",
- "disabled": "Выключено",
- "game_executable": "Установить исполняемый файл игры",
- "grasscutter_jar": "Установить Grasscutter JAR",
- "toggle_encryption": "Переключить шифрование",
- "java_path": "Установить пользовательский путь Java",
- "grasscutter_with_game": "Автоматически запускать Grasscutter вместе с игрой",
- "language": "Установить язык",
- "background": "Установить свой фон (ссылка или файл)",
- "theme": "Установить тему"
- },
- "downloads": {
- "grasscutter_stable_data": "Скачать стабильные данные Grasscutter",
- "grasscutter_latest_data": "Скачать последние данные Grasscutter",
- "grasscutter_stable_data_update": "Обновить стабильные данные Grasscutter",
- "grasscutter_latest_data_update": "Обновить последние данные Grasscutter",
- "grasscutter_stable": "Скачать стабильную версию Grasscutter",
- "grasscutter_latest": "Скачать последнюю версию Grasscutter",
- "grasscutter_stable_update": "Обновить стабильную версию Grasscutter",
- "grasscutter_latest_update": "Обновить последнюю версию Grasscutter",
- "resources": "Скачать ресурсы Grasscutter"
- },
- "download_status": {
- "downloading": "Скачивание",
- "extracting": "Извлечение",
- "error": "Ошибка",
- "finished": "Закончено",
- "stopped": "Остановлено"
- },
- "components": {
- "select_file": "Выберите файл или папку...",
- "select_folder": "Выберите папку...",
- "download": "Скачать"
- },
- "news": {
- "latest_commits": "Последние коммиты",
- "latest_version": "Последняя версия"
- },
- "help": {
- "port_help_text": "Убедитесь, что это порт Dispatch-сервера, не порт игрового сервера. Обычно это '443'.",
- "game_help_text": "Вам не нужно устанавливать еще одну копию, что бы играть с Grascutter. Это нужно или для версии 2.6, или если у Вас не установлена игра.",
- "gc_stable_jar": "Скачать последнюю стабильную версию Grasscutter, которая содержит jar файл и данные.",
- "gc_dev_jar": "Скачать последнюю версию для разработки Grasscutter, которая содержит jar файл и данные.",
- "gc_stable_data": "Скачать стабильные данные Grasscutter, в которой нету jar файла. Это полезно для обновления.",
- "gc_dev_data": "Скачать последнюю версию для разработки Grasscutter, в которой нету jar файла. Это полезно для обновления.",
- "resources": "Это необходимо для запуска сервера Grasscutter. Эта кнопка будет серой, если у Вас уже есть не пустая папка с ресурсами."
- }
-}
\ No newline at end of file
+{
+ "lang_name": "Русский",
+ "main": {
+ "title": "Cultivation",
+ "launch_button": "Запустить",
+ "gc_enable": "Подключиться с Grasscutter",
+ "https_enable": "Исп. HTTPS",
+ "ip_placeholder": "Айпи адрес...",
+ "port_placeholder": "Порт...",
+ "files_downloading": "Файлов скачано: ",
+ "files_extracting": "Извлечено файлов: "
+ },
+ "options": {
+ "enabled": "Включено",
+ "disabled": "Выключено",
+ "game_executable": "Установить исполняемый файл игры",
+ "grasscutter_jar": "Установить Grasscutter JAR",
+ "toggle_encryption": "Переключить шифрование",
+ "java_path": "Установить пользовательский путь Java",
+ "grasscutter_with_game": "Автоматически запускать Grasscutter вместе с игрой",
+ "language": "Установить язык",
+ "background": "Установить свой фон (ссылка или файл)",
+ "theme": "Установить тему"
+ },
+ "downloads": {
+ "grasscutter_stable_data": "Скачать стабильные данные Grasscutter",
+ "grasscutter_latest_data": "Скачать последние данные Grasscutter",
+ "grasscutter_stable_data_update": "Обновить стабильные данные Grasscutter",
+ "grasscutter_latest_data_update": "Обновить последние данные Grasscutter",
+ "grasscutter_stable": "Скачать стабильную версию Grasscutter",
+ "grasscutter_latest": "Скачать последнюю версию Grasscutter",
+ "grasscutter_stable_update": "Обновить стабильную версию Grasscutter",
+ "grasscutter_latest_update": "Обновить последнюю версию Grasscutter",
+ "resources": "Скачать ресурсы Grasscutter"
+ },
+ "download_status": {
+ "downloading": "Скачивание",
+ "extracting": "Извлечение",
+ "error": "Ошибка",
+ "finished": "Закончено",
+ "stopped": "Остановлено"
+ },
+ "components": {
+ "select_file": "Выберите файл или папку...",
+ "select_folder": "Выберите папку...",
+ "download": "Скачать"
+ },
+ "news": {
+ "latest_commits": "Последние коммиты",
+ "latest_version": "Последняя версия"
+ },
+ "help": {
+ "port_help_text": "Убедитесь, что это порт Dispatch-сервера, не порт игрового сервера. Обычно это '443'.",
+ "game_help_text": "Вам не нужно устанавливать еще одну копию, что бы играть с Grascutter. Это нужно или для версии 2.6, или если у Вас не установлена игра.",
+ "gc_stable_jar": "Скачать последнюю стабильную версию Grasscutter, которая содержит jar файл и данные.",
+ "gc_dev_jar": "Скачать последнюю версию для разработки Grasscutter, которая содержит jar файл и данные.",
+ "gc_stable_data": "Скачать стабильные данные Grasscutter, в которой нету jar файла. Это полезно для обновления.",
+ "gc_dev_data": "Скачать последнюю версию для разработки Grasscutter, в которой нету jar файла. Это полезно для обновления.",
+ "resources": "Это необходимо для запуска сервера Grasscutter. Эта кнопка будет серой, если у Вас уже есть не пустая папка с ресурсами."
+ }
+}
diff --git a/src-tauri/lang/vi.json b/src-tauri/lang/vi.json
index 6b1d3cd..443250b 100644
--- a/src-tauri/lang/vi.json
+++ b/src-tauri/lang/vi.json
@@ -58,4 +58,4 @@
"gc_dev_data": "Tải xuống bản phát triển mới nhất các tệp dữ liệu của Grasscutter, không bao gồm file jar. Phù hợp khi cập nhật.",
"resources": "Chúng được yêu cầu để chạy máy chủ Grasscutter. Nút này sẽ có màu xám nếu bạn có một thư mục tài nguyên có nội dung bên trong"
}
-}
\ No newline at end of file
+}
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 4bf076b..e5bc109 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -12,20 +12,12 @@
"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
},
@@ -37,13 +29,7 @@
"depends": []
},
"externalBin": [],
- "icon": [
- "icons/32x32.png",
- "icons/128x128.png",
- "icons/128x128@2x.png",
- "icons/icon.icns",
- "icons/icon.ico"
- ],
+ "icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
"identifier": "io.grasscutter",
"shortDescription": "A game launcher.",
"longDescription": "A launcher for a certain anime game that proxies all related game traffic to external servers.",
@@ -54,11 +40,7 @@
"providerShortName": null,
"signingIdentity": null
},
- "resources": [
- "lang/*.json",
- "keys/*",
- "./mhycrypto.dll"
- ],
+ "resources": ["lang/*.json", "keys/*", "./mhycrypto.dll"],
"targets": "all",
"windows": {
"allowDowngrades": false,
@@ -93,4 +75,4 @@
}
]
}
-}
\ No newline at end of file
+}
diff --git a/src/index.css b/src/index.css
index ec7b949..f7b32d2 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,13 +1,11 @@
body {
margin: 0;
- font-family: 'MiHoYo_SDK_Web', 'Helvetica Neue', BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
- sans-serif;
+ font-family: 'MiHoYo_SDK_Web', 'Helvetica Neue', BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
+ 'Cantarell', 'Fira Sans', 'Droid Sans', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
- monospace;
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}
diff --git a/src/index.tsx b/src/index.tsx
index e2b5cab..f2aff33 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -7,23 +7,15 @@ import Debug from './ui/Debug'
import { getConfigOption } from './utils/configuration'
-const root = ReactDOM.createRoot(
- document.getElementById('root') as HTMLElement
-)
+const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
-let isDebug = false;
+let isDebug = false
-(async() => {
+;async () => {
isDebug = await getConfigOption('debug_enabled')
-})
+}
-root.render(
-
- {
- isDebug ? :
- }
-
-)
+root.render({isDebug ? : })
import reportWebVitals from './utils/reportWebVitals'
-isDebug && reportWebVitals(console.log)
\ No newline at end of file
+isDebug && reportWebVitals(console.log)
diff --git a/src/ui/App.css b/src/ui/App.css
index 99074c7..d8eddae 100644
--- a/src/ui/App.css
+++ b/src/ui/App.css
@@ -22,7 +22,8 @@ select:focus {
border-bottom-color: #ffd326;
}
-#root, .App {
+#root,
+.App {
height: 100%;
}
@@ -64,8 +65,8 @@ select:focus {
}
.arrow-down {
- width: 0;
- height: 0;
+ width: 0;
+ height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 50px solid transparent;
@@ -82,28 +83,28 @@ select:focus {
.BottomSection {
position: absolute;
- bottom: 0%;
- left: 50%;
- transform: translate(-50%, 0%);
+ bottom: 0%;
+ left: 50%;
+ transform: translate(-50%, 0%);
- width: 100%;
- height: 160px;
+ width: 100%;
+ height: 160px;
backdrop-filter: blur(10px);
box-shadow: inset 0px 5px 12px -3px rgb(50 50 50 / 75%);
- margin: 0;
- padding: 0;
+ margin: 0;
+ padding: 0;
}
-@media(max-height: 580px) {
- .BottomSection {
- height: 150px;
- }
+@media (max-height: 580px) {
+ .BottomSection {
+ height: 150px;
+ }
}
-@media(max-height: 500px) {
- .BottomSection {
- height: 140px;
- }
-}
\ No newline at end of file
+@media (max-height: 500px) {
+ .BottomSection {
+ height: 140px;
+ }
+}
diff --git a/src/ui/App.tsx b/src/ui/App.tsx
index 6237880..da2ce7d 100644
--- a/src/ui/App.tsx
+++ b/src/ui/App.tsx
@@ -25,16 +25,16 @@ import { getTheme, loadTheme } from '../utils/themes'
import { unpatchGame } from '../utils/metadata'
interface IProps {
- [key: string]: never;
+ [key: string]: never
}
interface IState {
- isDownloading: boolean;
- optionsOpen: boolean;
- miniDownloadsOpen: boolean;
- downloadsOpen: boolean;
- gameDownloadsOpen: boolean;
- bgFile: string;
+ isDownloading: boolean
+ optionsOpen: boolean
+ miniDownloadsOpen: boolean
+ downloadsOpen: boolean
+ gameDownloadsOpen: boolean
+ bgFile: string
}
const DEFAULT_BG = 'https://api.grasscutter.io/cultivation/bgfile'
@@ -57,7 +57,7 @@ class App extends React.Component {
console.log(payload)
})
- listen('jar_extracted', ({ payload }: { payload: string}) => {
+ listen('jar_extracted', ({ payload }: { payload: string }) => {
setConfigOption('grasscutter_path', payload)
})
@@ -69,9 +69,11 @@ class App extends React.Component {
const unpatched = await unpatchGame()
console.log(`unpatched game? ${unpatched}`)
-
+
if (!unpatched) {
- alert(`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`)
+ alert(
+ `Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`
+ )
}
}
})
@@ -108,45 +110,55 @@ class App extends React.Component {
// Get custom bg AFTER theme is loaded !! important !!
const custom_bg = await getConfigOption('customBackground')
- if(!custom_bg || !/png|jpg|jpeg$/.test(custom_bg)) {
- if(game_path) {
+ if (!custom_bg || !/png|jpg|jpeg$/.test(custom_bg)) {
+ if (game_path) {
// Get the bg by invoking, then set the background to that bg.
const bgLoc: string = await invoke('get_bg_file', {
bgPath: root_path,
- appdata: await dataDir()
+ appdata: await dataDir(),
})
- bgLoc && this.setState({
- bgFile: bgLoc
- }, this.forceUpdate)
+ bgLoc &&
+ this.setState(
+ {
+ bgFile: bgLoc,
+ },
+ this.forceUpdate
+ )
}
} else {
const isUrl = /^http(s)?:\/\//gm.test(custom_bg)
if (!isUrl) {
const isValid = await invoke('dir_exists', {
- path: custom_bg
+ path: custom_bg,
})
- this.setState({
- bgFile: isValid ? convertFileSrc(custom_bg) : DEFAULT_BG
- }, this.forceUpdate)
+ this.setState(
+ {
+ bgFile: isValid ? convertFileSrc(custom_bg) : DEFAULT_BG,
+ },
+ this.forceUpdate
+ )
} else {
// Check if URL returns a valid image.
const isValid = await invoke('valid_url', {
- url: custom_bg
+ url: custom_bg,
})
- this.setState({
- bgFile: isValid ? custom_bg : DEFAULT_BG
- }, this.forceUpdate)
+ this.setState(
+ {
+ bgFile: isValid ? custom_bg : DEFAULT_BG,
+ },
+ this.forceUpdate
+ )
}
}
if (!cert_generated) {
// Generate the certificate
await invoke('generate_ca_files', {
- path: await dataDir() + 'cultivation'
+ path: (await dataDir()) + 'cultivation',
})
await setConfigOption('cert_generated', true)
@@ -155,18 +167,23 @@ class App extends React.Component {
// Period check to only show progress bar when downloading files
setInterval(() => {
this.setState({
- isDownloading: downloadHandler.getDownloads().filter(d => d.status !== 'finished')?.length > 0
+ isDownloading: downloadHandler.getDownloads().filter((d) => d.status !== 'finished')?.length > 0,
})
}, 1000)
}
render() {
return (
-
+ {/**
+ * HEY YOU
+ *
+ * If you're looking at the source code to find the swag mode thing, that's okay! If you're not, move along...
+ * Just do me a favor and don't go telling everyone about how you found it. If you are just helping someone who
+ * for some reason needs it, that's fine, but not EVERYONE needs it, which is why it exists in the first place.
+ */}
+
+ ?
- {
- /**
- * HEY YOU
- *
- * If you're looking at the source code to find the swag mode thing, that's okay! If you're not, move along...
- * Just do me a favor and don't go telling everyone about how you found it. If you are just helping someone who
- * for some reason needs it, that's fine, but not EVERYONE needs it, which is why it exists in the first place.
- */
- }
-