diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 4b005e4..2ed4cb3 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -13,7 +13,6 @@ use tauri::api::path::data_dir; use tauri::async_runtime::block_on; use std::thread; -use structs::APIQuery; use sysinfo::{System, SystemExt}; use crate::admin::reopen_as_admin; @@ -25,7 +24,6 @@ mod gamebanana; mod lang; mod metadata_patcher; mod proxy; -mod structs; mod system_helpers; mod unzip; mod web; @@ -87,7 +85,6 @@ fn main() { connect, disconnect, req_get, - get_bg_file, is_game_running, get_theme_list, system_helpers::run_command, @@ -251,8 +248,3 @@ async fn get_theme_list(data_dir: String) -> Vec> { themes } - -#[tauri::command] -async fn get_bg_file(bg_path: String, appdata: String) -> String { - return "".to_string(); // This is the greatest Cultivation update of all time. -} diff --git a/src-tauri/src/structs.rs b/src-tauri/src/structs.rs deleted file mode 100644 index 406083e..0000000 --- a/src-tauri/src/structs.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![allow(non_snake_case)] - -use serde::Deserialize; - -#[derive(Deserialize)] -pub(crate) struct APIQuery { - pub bg_file: String, -} diff --git a/src/ui/App.tsx b/src/ui/App.tsx index cfdd529..9e00a9b 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -5,7 +5,6 @@ import DownloadHandler from '../utils/download' import { getConfigOption } from '../utils/configuration' import { getTheme, loadTheme } from '../utils/themes' import { convertFileSrc, invoke } from '@tauri-apps/api/tauri' -import { dataDir } from '@tauri-apps/api/path' import { Main } from './Main' import { Mods } from './Mods' @@ -28,10 +27,6 @@ class App extends React.Component, IState> { } async componentDidMount() { - const game_exe = await getConfigOption('game_install_path') - const game_path = game_exe?.substring(0, game_exe.replace(/\\/g, '/').lastIndexOf('/')) || '' - const root_path = game_path?.substring(0, game_path.replace(/\\/g, '/').lastIndexOf('/')) || '' - // Load a theme if it exists const theme = await getConfigOption('theme') if (theme && theme !== 'default') { @@ -42,23 +37,7 @@ class App extends React.Component, IState> { // 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) { - // 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(), - }) - - bgLoc && - this.setState( - { - bgFile: bgLoc, - }, - this.forceUpdate - ) - } - } else { + if (custom_bg) { const isUrl = /^http(s)?:\/\//gm.test(custom_bg) if (!isUrl) { diff --git a/src/ui/components/mods/ModList.tsx b/src/ui/components/mods/ModList.tsx index e6bd2ae..76ecda1 100644 --- a/src/ui/components/mods/ModList.tsx +++ b/src/ui/components/mods/ModList.tsx @@ -83,7 +83,13 @@ export class ModList extends React.Component {
{this.props.mode === 'installed' ? this.state.installedList?.map((mod) => ( - + )) : this.state.modList?.map((mod: ModData) => (