diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 2c1f964..7fb70ba 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -519,6 +519,31 @@ async fn cancel_download(name: String) { cancel_map().insert(name.clone(), true); } +#[tauri::command] +fn open_new_window( + app: tauri::AppHandle, + title: String, + name: String, + url: String, + width: f64, + height: f64, +) { + if let Some(window) = app.get_webview_window(&name) { + let _ = window.show(); + return; + }; + + tauri::WebviewWindowBuilder::new( + &app, + name, + tauri::WebviewUrl::External(url.parse().unwrap()), + ) + .inner_size(width, height) + .title(title) + .build() + .unwrap(); +} + #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { #[allow(unused_variables)] @@ -560,7 +585,8 @@ pub fn run() { launch_game, folder_size, verify_signature, - cancel_download + cancel_download, + open_new_window ]) .setup(|app| { let window = app.get_webview_window("main").unwrap(); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 068ac7a..110fe35 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -10,15 +10,7 @@ "frontendDist": "../out" }, "app": { - "windows": [ - { - "title": "Lncvrt Games Launcher", - "width": 1000, - "height": 600, - "minWidth": 875, - "minHeight": 500 - } - ], + "windows": [], "security": { "csp": null } diff --git a/src/app/main/game/page.tsx b/src/app/main/game/page.tsx index d245cfe..f36871c 100644 --- a/src/app/main/game/page.tsx +++ b/src/app/main/game/page.tsx @@ -64,7 +64,7 @@ export default function Installs () { className={`text-3xl truncate ${ category != -1 ? 'w-[calc(100vw-495px)]' - : game.id == 1 + : game.id == 1 || game.id == 9 ? 'w-[calc(100vw-560px)]' : 'w-[calc(100vw-440px)]' }`} @@ -82,6 +82,22 @@ export default function Installs () { > Leaderboards +