fix: proper language export and restyle of game path notification

This commit is contained in:
SpikeHD
2023-06-06 18:07:54 -07:00
parent fe974a1ae1
commit 044be37e9e
5 changed files with 18 additions and 39 deletions

View File

@@ -8,7 +8,8 @@
"ip_placeholder": "Server Address...", "ip_placeholder": "Server Address...",
"port_placeholder": "Port...", "port_placeholder": "Port...",
"files_downloading": "Files Downloading: ", "files_downloading": "Files Downloading: ",
"files_extracting": "Files Extracting: " "files_extracting": "Files Extracting: ",
"game_path_notify": "Game path not found, remember to set it in !"
}, },
"options": { "options": {
"enabled": "Enabled", "enabled": "Enabled",

View File

@@ -114,13 +114,13 @@ pub fn unzip(
} }
if zipfile.contains("GIMI") { if zipfile.contains("GIMI") {
window window
.emit( .emit(
"migoto_extracted", "migoto_extracted",
destpath.to_string() + "3DMigoto Loader.exe", destpath.to_string() + "3DMigoto Loader.exe",
) )
.unwrap(); .unwrap();
} }
// Delete zip file // Delete zip file
match std::fs::remove_file(&zipfile) { match std::fs::remove_file(&zipfile) {

View File

@@ -13,8 +13,7 @@ import { invoke } from '@tauri-apps/api'
import { listen } from '@tauri-apps/api/event' import { listen } from '@tauri-apps/api/event'
import HelpButton from '../common/HelpButton' 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_BUILD_DOWNLOAD = 'https://github.com/NotThorny/Grasscutter/releases/download/culti-aio/GrasscutterCulti.zip'
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 STABLE_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/stable.zip'
const DEV_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/development.zip' const DEV_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/development.zip'
const UNSTABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/unstable/Grasscutter.zip' const UNSTABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/unstable/Grasscutter.zip'
@@ -56,7 +55,6 @@ export default class Downloads extends React.Component<IProps, IState> {
this.getGrasscutterFolder = this.getGrasscutterFolder.bind(this) this.getGrasscutterFolder = this.getGrasscutterFolder.bind(this)
this.downloadGrasscutterFullBuild = this.downloadGrasscutterFullBuild.bind(this) this.downloadGrasscutterFullBuild = this.downloadGrasscutterFullBuild.bind(this)
this.downloadGrasscutterFullQuest = this.downloadGrasscutterFullQuest.bind(this)
this.downloadGrasscutterStableRepo = this.downloadGrasscutterStableRepo.bind(this) this.downloadGrasscutterStableRepo = this.downloadGrasscutterStableRepo.bind(this)
this.downloadGrasscutterDevRepo = this.downloadGrasscutterDevRepo.bind(this) this.downloadGrasscutterDevRepo = this.downloadGrasscutterDevRepo.bind(this)
this.downloadGrasscutterUnstable = this.downloadGrasscutterUnstable.bind(this) this.downloadGrasscutterUnstable = this.downloadGrasscutterUnstable.bind(this)
@@ -143,16 +141,6 @@ export default class Downloads extends React.Component<IProps, IState> {
this.toggleButtons() 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() { async downloadGrasscutterStableRepo() {
const folder = await this.getGrasscutterFolder() const folder = await this.getGrasscutterFolder()
this.props.downloadManager.addDownload(STABLE_REPO_DOWNLOAD, folder + '\\grasscutter_repo.zip', async () => { this.props.downloadManager.addDownload(STABLE_REPO_DOWNLOAD, folder + '\\grasscutter_repo.zip', async () => {
@@ -279,22 +267,6 @@ export default class Downloads extends React.Component<IProps, IState> {
</BigButton> </BigButton>
</div> </div>
</div> </div>
<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="downloadMenuButtonGCFullQuest">
<BigButton
disabled={this.state.grasscutter_downloading}
onClick={this.downloadGrasscutterFullQuest}
id="grasscutterFullBuildBtn"
>
<Tr text="components.download" />
</BigButton>
</div>
</div>
<Divider /> <Divider />
<div className="HeaderText" id="downloadMenuIndividualHeader"> <div className="HeaderText" id="downloadMenuIndividualHeader">

View File

@@ -5,6 +5,10 @@
color: white; color: white;
} }
.GameInstallNotify span {
padding: 10px 0;
}
#pointer { #pointer {
position: absolute; position: absolute;
right: 85px; right: 85px;

View File

@@ -1,12 +1,14 @@
import React from 'react' import React from 'react'
import './GamePathNotify.css' import './GamePathNotify.css'
import Tr from '../../../utils/language'
export default class GamePathNotify extends React.Component { export default class GamePathNotify extends React.Component {
render() { render() {
return ( return (
<div className="GameInstallNotify"> <div className="GameInstallNotify">
<span>You need to set your game path in the options!</span> <span>
<span id="pointer">here ^</span> <Tr text={'main.game_path_notify'} />
</span>
</div> </div>
) )
} }