mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 15:44:35 +01:00
Better default config
Resources update Try to actually show news on startup
This commit is contained in:
@@ -120,7 +120,8 @@ pub fn unzip(
|
|||||||
res_hash.insert("file", zipfile.to_string());
|
res_hash.insert("file", zipfile.to_string());
|
||||||
res_hash.insert("new_folder", new_dir);
|
res_hash.insert("new_folder", new_dir);
|
||||||
|
|
||||||
window.emit("extract_end", &res_hash).unwrap();
|
// Testing fix
|
||||||
|
//window.emit("extract_end", &res_hash).unwrap();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +151,8 @@ fn extract_rar(rarfile: &str, _f: &File, full_path: &path::Path, _top_level: boo
|
|||||||
fn extract_zip(_zipfile: &str, f: &File, full_path: &path::Path, top_level: bool) -> bool {
|
fn extract_zip(_zipfile: &str, f: &File, full_path: &path::Path, top_level: bool) -> bool {
|
||||||
match zip_extract::extract(f, full_path, top_level) {
|
match zip_extract::extract(f, full_path, top_level) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
// Notify extract end when extract is actually complete
|
||||||
|
window.emit("extract_end", &res_hash).unwrap();
|
||||||
println!(
|
println!(
|
||||||
"Extracted zip file to: {}",
|
"Extracted zip file to: {}",
|
||||||
full_path.to_str().unwrap_or("Error")
|
full_path.to_str().unwrap_or("Error")
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const STABLE_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archiv
|
|||||||
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 STABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/stable/Grasscutter.zip'
|
const STABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/stable/Grasscutter.zip'
|
||||||
const DEV_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/development/Grasscutter.zip'
|
const DEV_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/development/Grasscutter.zip'
|
||||||
const RESOURCES_DOWNLOAD = 'https://git.crepe.moe/grasscutters/Grasscutter_Resources/-/blob/main/Grasscutter_Resources-3.3.zip'
|
const RESOURCES_DOWNLOAD = 'https://gitlab.com/YuukiPS/GC-Resources/-/archive/3.4/GC-Resources-3.4.zip' // Use Yuuki res as grasscutter crepe res are broken
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
closeFn: () => void
|
closeFn: () => void
|
||||||
|
|||||||
@@ -60,7 +60,10 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
|||||||
|
|
||||||
async showLatestCommits() {
|
async showLatestCommits() {
|
||||||
if (!this.state.commitList) {
|
if (!this.state.commitList) {
|
||||||
const response: string = await invoke('req_get', { url: 'https://api.grasscutter.io/cultivation/query' })
|
// Just use official API
|
||||||
|
const response: string = await invoke('req_get', {
|
||||||
|
url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits',
|
||||||
|
})
|
||||||
let grasscutterApiResponse: GrasscutterAPIResponse | null = null
|
let grasscutterApiResponse: GrasscutterAPIResponse | null = null
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -71,7 +74,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
|||||||
|
|
||||||
let commits: CommitResponse[]
|
let commits: CommitResponse[]
|
||||||
if (grasscutterApiResponse?.commits == null) {
|
if (grasscutterApiResponse?.commits == null) {
|
||||||
// If it didn't work, use official API
|
// If it didn't work, try again anyways
|
||||||
const response: string = await invoke('req_get', {
|
const response: string = await invoke('req_get', {
|
||||||
url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits',
|
url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ let configFilePath: string
|
|||||||
let defaultConfig: Configuration
|
let defaultConfig: Configuration
|
||||||
;(async () => {
|
;(async () => {
|
||||||
defaultConfig = {
|
defaultConfig = {
|
||||||
toggle_grasscutter: false,
|
toggle_grasscutter: true,
|
||||||
game_install_path: 'C:\\Program Files\\Genshin Impact\\Genshin Impact game\\GenshinImpact.exe',
|
game_install_path: 'C:\\Program Files\\Genshin Impact\\Genshin Impact game\\GenshinImpact.exe',
|
||||||
grasscutter_with_game: false,
|
grasscutter_with_game: false,
|
||||||
grasscutter_path: '',
|
grasscutter_path: '',
|
||||||
@@ -20,7 +20,7 @@ let defaultConfig: Configuration
|
|||||||
theme: 'default',
|
theme: 'default',
|
||||||
https_enabled: false,
|
https_enabled: false,
|
||||||
debug_enabled: false,
|
debug_enabled: false,
|
||||||
patch_metadata: true,
|
patch_metadata: false,
|
||||||
use_internal_proxy: true,
|
use_internal_proxy: true,
|
||||||
wipe_login: false,
|
wipe_login: false,
|
||||||
horny_mode: false,
|
horny_mode: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user