mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 00:24:45 +01:00
cleanup
This commit is contained in:
@@ -1,45 +1,23 @@
|
||||
import React from 'react'
|
||||
import { invoke } from '@tauri-apps/api/tauri'
|
||||
import './App.css'
|
||||
import './custom.css'
|
||||
|
||||
/* FOR TESTING */
|
||||
import DownloadHandler from '../utils/download'
|
||||
|
||||
// Config
|
||||
import { getConfig, saveConfig } from '../utils/configuration'
|
||||
|
||||
// Major Components
|
||||
import Topbar from './components/TopBar'
|
||||
import BigButton from './components/common/BigButton'
|
||||
import Checkbox from './components/common/Checkbox'
|
||||
import ServerLaunchSection from './components/ServerLaunchSection'
|
||||
import ProgressBar from './components/common/ProgressBar'
|
||||
|
||||
const downloadHandler = new DownloadHandler()
|
||||
|
||||
async function playGame() {
|
||||
const config = await getConfig()
|
||||
|
||||
if (!config.game_path) return
|
||||
|
||||
// Launch the program
|
||||
await invoke('run_program', { path: config.game_path })
|
||||
}
|
||||
|
||||
async function download() {
|
||||
const path = 'S:/Cultivation/grassclipper.zip'
|
||||
const url = 'https://github.com/Grasscutters/GrassClipper/releases/download/v0.9.7/GrassClipper.zip'
|
||||
downloadHandler.addDownload(url, path)
|
||||
}
|
||||
|
||||
async function toggleGrasscutter() {
|
||||
const config = await getConfig()
|
||||
|
||||
config.toggle_grasscutter = !config.toggle_grasscutter
|
||||
|
||||
await saveConfig(config)
|
||||
}
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div className="App">
|
||||
@@ -47,12 +25,7 @@ function App() {
|
||||
|
||||
<button onClick={download}>download file test</button>
|
||||
|
||||
<div id="playButton">
|
||||
<div id="serverControls">
|
||||
<Checkbox label="Connect via Grasscutter" onChange={toggleGrasscutter} />
|
||||
</div>
|
||||
<BigButton text="PLAY DA GAME :D" onClick={playGame} id="officialPlay" />
|
||||
</div>
|
||||
<ServerLaunchSection />
|
||||
|
||||
<div id="downloadProgress" style={{
|
||||
position: 'absolute',
|
||||
|
||||
Reference in New Issue
Block a user