diff --git a/src/ui/App.css b/src/ui/App.css index 3e502b0..21d1f5c 100644 --- a/src/ui/App.css +++ b/src/ui/App.css @@ -27,11 +27,11 @@ select:focus { } .App { - /*background: url("https://webstatic.hoyoverse.com/upload/event/2020/11/04/7fd661b5184e1734f91f628b6f89a31f_7367318474207189623.png") no-repeat center center fixed; */ + background-repeat: no-repeat; + background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; - background-size: cover; } .TopButton { diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 7446667..7312d53 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -75,21 +75,24 @@ class App extends React.Component { async componentDidMount() { const cert_generated = await getConfigOption('cert_generated') const game_exe = await getConfigOption('game_install_path') + const custom_bg = await getConfigOption('customBackground') const game_path = game_exe.substring(0, game_exe.lastIndexOf('\\')) const root_path = game_path.substring(0, game_path.lastIndexOf('\\')) - 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, - }) + if(!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 + }) - if (bgLoc) { - this.setState({ + bgLoc && this.setState({ bgFile: bgLoc }) } - } + } else this.setState({ + bgFile: custom_bg + }) if (!cert_generated) { // Generate the certificate @@ -106,13 +109,15 @@ class App extends React.Component { isDownloading: downloadHandler.getDownloads().filter(d => d.status !== 'finished')?.length > 0 }) }, 1000) + + console.log('mounting app component with background: ' + this.state.bgFile) } render() { return (