mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 08:04:52 +01:00
Merge branch 'main' of https://github.com/Grasscutters/Cultivation into main
This commit is contained in:
@@ -18,7 +18,7 @@ import Game from './components/menu/Game'
|
||||
import RightBar from './components/RightBar'
|
||||
import { getConfigOption, setConfigOption } from '../utils/configuration'
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
import { appDir, dataDir } from '@tauri-apps/api/path'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import { appWindow } from '@tauri-apps/api/window'
|
||||
import { convertFileSrc } from '@tauri-apps/api/tauri'
|
||||
import { getTheme, loadTheme } from '../utils/themes'
|
||||
@@ -87,7 +87,7 @@ class App extends React.Component<IProps, IState> {
|
||||
const theme = await getConfigOption('theme')
|
||||
if (theme && theme !== 'default') {
|
||||
const themeObj = await getTheme(theme)
|
||||
loadTheme(themeObj, document)
|
||||
await loadTheme(themeObj, document)
|
||||
}
|
||||
|
||||
if(!custom_bg || !/png|jpg|jpeg$/.test(custom_bg)) {
|
||||
@@ -103,7 +103,7 @@ class App extends React.Component<IProps, IState> {
|
||||
}, this.forceUpdate)
|
||||
}
|
||||
} else {
|
||||
const isUrl = /^(?:http(s)?:\/\/)/gm.test(custom_bg)
|
||||
const isUrl = /^http(s)?:\/\//gm.test(custom_bg)
|
||||
|
||||
if (!isUrl) {
|
||||
const isValid = await invoke('dir_exists', {
|
||||
|
||||
@@ -18,11 +18,19 @@ async function generateCertificates() {
|
||||
await invoke('generate_ca_files', { path: await dataDir() + '\\cultivation' })
|
||||
}
|
||||
|
||||
async function generateCertInfo() {
|
||||
console.log({
|
||||
certificatePath: await dataDir() + '\\cultivation\\ca',
|
||||
isAdmin: await invoke('is_elevated')
|
||||
})
|
||||
alert('check your dev console and send that in #cultivation')
|
||||
}
|
||||
|
||||
function none() {
|
||||
alert('none')
|
||||
}
|
||||
|
||||
class Test extends React.Component<any, any>{
|
||||
class Debug extends React.Component<any, any>{
|
||||
render() {
|
||||
return (
|
||||
<div className="App">
|
||||
@@ -30,9 +38,10 @@ class Test extends React.Component<any, any>{
|
||||
<button onClick={startProxy}>start proxy</button>
|
||||
<button onClick={stopProxy}>stop proxy</button>
|
||||
<button onClick={generateCertificates}>generate certificates</button>
|
||||
<button onClick={generateCertInfo}>generate certificate info</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Test
|
||||
export default Debug
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#playButton .BigButton {
|
||||
height: 100%;
|
||||
box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 5px 3px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#serverControls {
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#serverControls .CheckboxDisplay {
|
||||
margin-right: 6px;
|
||||
box-shadow: 0px 0px 5px 4px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 5px 4px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#serverControls .Checkbox label {
|
||||
@@ -80,7 +80,7 @@
|
||||
border-radius: 6px;
|
||||
height: 18px;
|
||||
|
||||
box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 5px 3px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.ServerConfig .TextInputWrapper {
|
||||
|
||||
@@ -39,7 +39,7 @@ const defaultTheme = {
|
||||
export async function getThemeList() {
|
||||
// Do some invoke to backend to get the theme list
|
||||
const themes = await invoke('get_theme_list', {
|
||||
dataDir: `${await dataDir()}/cultivation`
|
||||
data_dir: `${await dataDir()}/cultivation`
|
||||
}) as BackendThemeList[]
|
||||
const list: ThemeList[] = [
|
||||
// ALWAYS include default theme
|
||||
|
||||
Reference in New Issue
Block a user