Compare commits

...
Author SHA1 Message Date
Lncvrt fde145f071 Remove updater 2026-04-19 12:54:15 -07:00
Lncvrt 846fcc0af7 wow that was easy 2026-04-17 06:43:27 -07:00
Lncvrt 4601628a55 Start working on transparency 2026-04-17 06:39:42 -07:00
18 changed files with 37 additions and 256 deletions

No files matched your search

+1 -1
View File
@@ -37,13 +37,13 @@ tauri-plugin-http = "2.5.8"
dashmap = "6.1.0" dashmap = "6.1.0"
tauri-plugin-store = "2.4.2" tauri-plugin-store = "2.4.2"
hex = "0.4.3" hex = "0.4.3"
window-vibrancy = "0.7.1"
[target.'cfg(any(target_os = "windows", target_os = "linux"))'.dependencies] [target.'cfg(any(target_os = "windows", target_os = "linux"))'.dependencies]
sysinfo = "0.38.4" sysinfo = "0.38.4"
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-single-instance = "2.4.1" tauri-plugin-single-instance = "2.4.1"
tauri-plugin-updater = "2.10.1"
tauri-plugin-window-state = "2.4.1" tauri-plugin-window-state = "2.4.1"
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]
+3 -12
View File
@@ -1,15 +1,6 @@
{ {
"identifier": "desktop-capability", "identifier": "desktop-capability",
"platforms": [ "platforms": ["macOS", "windows", "linux"],
"macOS", "windows": ["main"],
"windows", "permissions": ["window-state:default"]
"linux"
],
"windows": [
"main"
],
"permissions": [
"window-state:default",
"updater:default"
]
} }
+6 -78
View File
@@ -21,6 +21,8 @@ use tauri_plugin_os::platform;
use tauri_plugin_prevent_default::Flags; use tauri_plugin_prevent_default::Flags;
use tokio::io::AsyncReadExt; use tokio::io::AsyncReadExt;
use tokio::{io::AsyncWriteExt, time::timeout}; use tokio::{io::AsyncWriteExt, time::timeout};
#[cfg(target_os = "macos")]
use window_vibrancy::{NSVisualEffectMaterial, apply_vibrancy};
use zip::ZipArchive; use zip::ZipArchive;
use zip::result::ZipError; use zip::result::ZipError;
@@ -30,9 +32,6 @@ use sysinfo::System;
#[cfg(unix)] #[cfg(unix)]
use std::os::unix::fs::PermissionsExt; use std::os::unix::fs::PermissionsExt;
#[cfg(not(debug_assertions))]
use tauri_plugin_updater::UpdaterExt;
struct AppState { struct AppState {
custom_data_dir: RwLock<Option<PathBuf>>, custom_data_dir: RwLock<Option<PathBuf>>,
} }
@@ -683,7 +682,6 @@ fn open_new_window(
pub fn run() { pub fn run() {
#[allow(unused_variables)] #[allow(unused_variables)]
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_store::Builder::new().build()) .plugin(tauri_plugin_store::Builder::new().build())
.plugin(tauri_plugin_http::init()) .plugin(tauri_plugin_http::init())
.plugin( .plugin(
@@ -749,6 +747,10 @@ pub fn run() {
let window = app.get_webview_window("main").unwrap(); let window = app.get_webview_window("main").unwrap();
#[cfg(target_os = "macos")]
apply_vibrancy(&window, NSVisualEffectMaterial::HudWindow, None, None)
.expect("Unable to apply window blur");
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
use tauri_plugin_decorum::WebviewWindowExt; use tauri_plugin_decorum::WebviewWindowExt;
@@ -756,83 +758,9 @@ pub fn run() {
eprintln!("Failed to create overlay titlebar: {:?}", e); eprintln!("Failed to create overlay titlebar: {:?}", e);
} }
} }
#[cfg(not(debug_assertions))]
{
let handle = app.handle().clone();
tauri::async_runtime::spawn(async move {
update(handle, window.clone()).await.unwrap();
});
}
#[cfg(debug_assertions)]
{
let mut new_url = app.config().build.dev_url.clone().unwrap();
new_url.set_path("/main");
window.navigate(new_url).unwrap();
}
Ok(()) Ok(())
}) })
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("error while running tauri application"); .expect("error while running tauri application");
} }
#[cfg(not(debug_assertions))]
async fn update(
app: tauri::AppHandle,
window: tauri::WebviewWindow,
) -> tauri_plugin_updater::Result<()> {
let target = {
#[cfg(target_os = "linux")]
{
if std::path::Path::new("/etc/debian_version").exists() {
"linux-debian"
} else if std::path::Path::new("/etc/redhat-release").exists() {
"linux-fedora"
} else {
let mut new_url = window.url().unwrap();
new_url.set_path("/update/outdated");
window.navigate(new_url).unwrap();
return Ok(());
}
}
#[cfg(not(target_os = "linux"))]
{
tauri_plugin_updater::target().unwrap_or("unknown".to_string())
}
};
if let Some(update) = app
.updater_builder()
.target(target)
.build()?
.check()
.await?
{
let mut new_url = window.url().unwrap();
new_url.set_path("/update/updating");
window.navigate(new_url).unwrap();
let mut downloaded = 0;
update
.download_and_install(
|chunk_length, content_length| {
downloaded += chunk_length;
println!("downloaded {downloaded} from {content_length:?}");
},
|| {
println!("download finished");
},
)
.await?;
println!("update installed");
app.restart();
}
let mut new_url = window.url().unwrap();
new_url.set_path("/main");
window.navigate(new_url).unwrap();
Ok(())
}
+1 -1
View File
@@ -13,7 +13,7 @@
"windows": [ "windows": [
{ {
"title": "Lncvrt Games Launcher", "title": "Lncvrt Games Launcher",
"url": "/update/checking", "url": "/main",
"width": 1000, "width": 1000,
"height": 600, "height": 600,
"minWidth": 1000, "minWidth": 1000,
+3 -2
View File
@@ -14,13 +14,14 @@
"windows": [ "windows": [
{ {
"title": "Lncvrt Games Launcher", "title": "Lncvrt Games Launcher",
"url": "/update/checking", "url": "/main",
"width": 1000, "width": 1000,
"height": 600, "height": 600,
"minWidth": 1000, "minWidth": 1000,
"minHeight": 500, "minHeight": 500,
"titleBarStyle": "Overlay", "titleBarStyle": "Overlay",
"hiddenTitle": true "hiddenTitle": true,
"transparent": true
} }
], ],
"security": { "security": {
+1 -1
View File
@@ -14,7 +14,7 @@
"windows": [ "windows": [
{ {
"title": "Lncvrt Games Launcher", "title": "Lncvrt Games Launcher",
"url": "/update/checking", "url": "/main",
"width": 1000, "width": 1000,
"height": 632, "height": 632,
"minWidth": 1000, "minWidth": 1000,
+2 -2
View File
@@ -5,9 +5,9 @@
} }
.downloads-scroll { .downloads-scroll {
@apply bg-(--col1) border border-(--col3) rounded-lg overflow-y-auto w-full; @apply bg-(--col1)/50 border border-(--col3)/50 rounded-lg overflow-y-auto w-full;
} }
.downloads-entry { .downloads-entry {
@apply flex justify-between items-center m-2 p-2 rounded-lg text-gray-200 text-lg transition-colors bg-(--col2) hover:bg-(--col3) border border-(--col4) hover:border-(--col5) cursor-pointer; @apply flex justify-between items-center m-2 p-2 rounded-lg text-gray-200 text-lg transition-colors bg-(--col2)/50 hover:bg-(--col3)/50 border border-(--col4)/50 hover:border-(--col5)/50 cursor-pointer;
} }
@@ -1,13 +1,13 @@
@import "tailwindcss"; @import "tailwindcss";
.box { .box {
@apply bg-(--col1) border border-(--col3) rounded-lg w-auto p-1; @apply bg-(--col1)/50 border border-(--col3)/50 rounded-lg w-auto p-1;
} }
.leaderboard-button { .leaderboard-button {
@apply bg-(--col2) hover:bg-(--col4) border border-(--col4) hover:border-(--col6) rounded-lg px-4 py-2 inline-block transition-all duration-200 cursor-pointer; @apply bg-(--col2)/50 hover:bg-(--col4)/50 border border-(--col4)/50 hover:border-(--col6)/50 rounded-lg px-4 py-2 inline-block transition-all duration-200 cursor-pointer;
} }
.leaderboard-entry { .leaderboard-entry {
@apply rounded-lg text-gray-200 text-lg px-1 py-0.5 transition-colors bg-(--col2) hover:bg-(--col3) border border-(--col4) hover:border-(--col5) cursor-pointer; @apply rounded-lg text-gray-200 text-lg px-1 py-0.5 transition-colors bg-(--col2)/50 hover:bg-(--col3)/50 border border-(--col4)/50 hover:border-(--col5)/50 cursor-pointer;
} }
+1 -4
View File
@@ -88,7 +88,6 @@ export default function RootLayout ({
const [linuxUseWine, setLinuxUseWine] = useState<boolean>(false) const [linuxUseWine, setLinuxUseWine] = useState<boolean>(false)
const [linuxWineCommand, setLinuxWineCommand] = const [linuxWineCommand, setLinuxWineCommand] =
useState<string>('wine %path%') useState<string>('wine %path%')
const [theme, setTheme] = useState<string>('dark')
const [customDataLocation, setCustomDataLocation] = useState<string>('') const [customDataLocation, setCustomDataLocation] = useState<string>('')
const [versionsList, setVersionsList] = useState<Record<string, number>>({}) const [versionsList, setVersionsList] = useState<Record<string, number>>({})
@@ -675,7 +674,6 @@ export default function RootLayout ({
unlisteners.push(versions!.onKeyChange<T>(key, fn)) unlisteners.push(versions!.onKeyChange<T>(key, fn))
} }
watchSettings<string>('theme', v => setTheme(v ?? 'dark'))
watchSettings<boolean>('notificationsAllowed', v => watchSettings<boolean>('notificationsAllowed', v =>
setNotificationsAllowed(v ?? true) setNotificationsAllowed(v ?? true)
) )
@@ -703,7 +701,7 @@ export default function RootLayout ({
return ( return (
<> <>
<html lang='en' className={roboto.className}> <html lang='en' className={roboto.className}>
<body className={theme + '-theme'}> <body>
{loading ? ( {loading ? (
<> <>
<div <div
@@ -756,7 +754,6 @@ export default function RootLayout ({
sidebarAlwaysShowGames, sidebarAlwaysShowGames,
linuxUseWine, linuxUseWine,
linuxWineCommand, linuxWineCommand,
theme,
customDataLocation, customDataLocation,
versionsList, versionsList,
modsList, modsList,
+1 -23
View File
@@ -6,7 +6,6 @@ import { copyToClipboard } from '@/lib/clipboard'
import { platform } from '@tauri-apps/plugin-os' import { platform } from '@tauri-apps/plugin-os'
import { open } from '@tauri-apps/plugin-dialog' import { open } from '@tauri-apps/plugin-dialog'
import { invoke } from '@tauri-apps/api/core' import { invoke } from '@tauri-apps/api/core'
import Dropdown from '@/components/Dropdown'
export default function Settings () { export default function Settings () {
const { const {
@@ -16,7 +15,6 @@ export default function Settings () {
sidebarAlwaysShowGames, sidebarAlwaysShowGames,
linuxUseWine, linuxUseWine,
linuxWineCommand, linuxWineCommand,
theme,
customDataLocation, customDataLocation,
downloadProgress, downloadProgress,
setMovingData setMovingData
@@ -25,7 +23,7 @@ export default function Settings () {
return ( return (
<> <>
<p className='text-3xl ml-4 mt-4'>Settings</p> <p className='text-3xl ml-4 mt-4'>Settings</p>
<div className='ml-4 mt-4 bg-(--col1) border border-(--col3) rounded-lg p-4 w-fit h-fit'> <div className='ml-4 mt-4 bg-(--col1)/50 border border-(--col3)/50 rounded-lg p-4 w-fit h-fit'>
<Setting <Setting
label='Allow sending notifications' label='Allow sending notifications'
value={notificationsAllowed} value={notificationsAllowed}
@@ -102,26 +100,6 @@ export default function Settings () {
{customDataLocation} {customDataLocation}
</p> </p>
)} )}
<div className='flex flex-row gap-2 items-center'>
<p
title='The theme you want the launcher to use.'
className='text-lg'
>
Theme:
</p>
<Dropdown
value={theme}
options={[
{ label: 'Dark', value: 'dark' },
{ label: 'Red', value: 'red' },
{ label: 'Blue', value: 'blue' },
{ label: 'Purple', value: 'purple' }
]}
onChange={async val => {
await settings?.set('theme', val)
}}
/>
</div>
</div> </div>
<p <p
className='fixed bottom-1.5 right-1.5 rounded-md cursor-pointer px-1 border z-100 transition-colors btntheme1' className='fixed bottom-1.5 right-1.5 rounded-md cursor-pointer px-1 border z-100 transition-colors btntheme1'
-5
View File
@@ -1,5 +0,0 @@
'use client'
export default function UpdateCheckingPage () {
return <p className='text-5xl text-center'>Checking for updates</p>
}
-42
View File
@@ -1,42 +0,0 @@
'use client'
import '@/styles/globals.css'
import { platform } from '@tauri-apps/plugin-os'
import { Roboto } from 'next/font/google'
import { useEffect, useState } from 'react'
const roboto = Roboto({
subsets: ['latin']
})
export default function RootLayout ({
children
}: {
children: React.ReactNode
}) {
const [platformName, setPlatformName] = useState<string | null>(null)
useEffect(() => {
setTimeout(() => setPlatformName(platform()), 0)
}, [])
return (
<>
<html lang='en' className={roboto.className}>
<body className='dark-theme'>
<div
className='relative z-2 w-screen border-b border-b-(--col3) h-8.25 bg-(--col1)'
hidden={platformName != 'windows'}
/>
<div
className={`w-screen ${
platformName == 'windows' ? 'h-[calc(100vh-64px)]' : 'h-screen'
} flex items-center justify-center`}
>
{children}
</div>
</body>
</html>
</>
)
}
-20
View File
@@ -1,20 +0,0 @@
'use client'
import { openUrl } from '@tauri-apps/plugin-opener'
export default function UpdateCheckingPage () {
return (
<div className='text-center'>
<p className='text-6xl mb-4'>Outdated Launcher!</p>
<p className='text-2xl mb-4'>
Please update to the latest version to continue.
</p>
<button
className='button btntheme1'
onClick={() => openUrl('https://games.lncvrt.xyz/download')}
>
Download latest version!
</button>
</div>
)
}
-5
View File
@@ -1,5 +0,0 @@
'use client'
export default function UpdateCheckingPage () {
return <p className='text-5xl text-center'>Updating launcher</p>
}
-1
View File
@@ -56,7 +56,6 @@ type GlobalCtxType = {
sidebarAlwaysShowGames: boolean sidebarAlwaysShowGames: boolean
linuxUseWine: boolean linuxUseWine: boolean
linuxWineCommand: string linuxWineCommand: string
theme: string
customDataLocation: string customDataLocation: string
versionsList: Record<string, number> versionsList: Record<string, number>
modsList: Record<string, Record<string, number>> modsList: Record<string, Record<string, number>>
+8 -49
View File
@@ -5,10 +5,8 @@ html {
} }
body { body {
@apply bg-(--col0) text-white select-none; @apply bg-transparent text-white select-none;
}
.dark-theme {
--col0: rgb(8, 8, 8); --col0: rgb(8, 8, 8);
--col1: rgb(16, 16, 16); --col1: rgb(16, 16, 16);
--col2: rgb(32, 32, 32); --col2: rgb(32, 32, 32);
@@ -21,63 +19,24 @@ body {
--col9: rgb(144, 144, 144); --col9: rgb(144, 144, 144);
} }
.red-theme {
--col0: rgb(32, 8, 8);
--col1: rgb(40, 16, 16);
--col2: rgb(56, 32, 32);
--col3: rgb(72, 48, 48);
--col4: rgb(88, 64, 64);
--col5: rgb(104, 80, 80);
--col6: rgb(120, 96, 96);
--col7: rgb(136, 112, 112);
--col8: rgb(152, 128, 128);
--col9: rgb(168, 144, 144);
}
.blue-theme {
--col0: rgb(8, 8, 32);
--col1: rgb(16, 16, 40);
--col2: rgb(32, 32, 56);
--col3: rgb(48, 48, 72);
--col4: rgb(64, 64, 88);
--col5: rgb(80, 80, 104);
--col6: rgb(96, 96, 120);
--col7: rgb(112, 112, 136);
--col8: rgb(128, 128, 152);
--col9: rgb(144, 144, 168);
}
.purple-theme {
--col0: rgb(20, 8, 32);
--col1: rgb(28, 16, 40);
--col2: rgb(44, 32, 56);
--col3: rgb(60, 48, 72);
--col4: rgb(76, 64, 88);
--col5: rgb(92, 80, 104);
--col6: rgb(108, 96, 120);
--col7: rgb(124, 112, 136);
--col8: rgb(140, 128, 152);
--col9: rgb(156, 144, 168);
}
.button { .button {
@apply rounded-md cursor-pointer text-[16px] py-1 px-2 transition-colors border; @apply rounded-md cursor-pointer text-[16px] py-1 px-2 transition-colors border;
} }
.btntheme1 { .btntheme1 {
@apply bg-(--col2) border-(--col4) hover:bg-(--col4) hover:border-(--col6) disabled:text-gray-300 disabled:bg-(--col1) disabled:border-(--col5) disabled:hover:text-gray-100 disabled:hover:bg-(--col2) disabled:hover:border-(--col6); @apply bg-(--col2)/50 border-(--col4)/50 hover:bg-(--col4)/50 hover:border-(--col6)/50 disabled:text-gray-300 disabled:bg-(--col1)/50 disabled:border-(--col5)/50 disabled:hover:text-gray-100 disabled:hover:bg-(--col2) disabled:hover:border-(--col6);
} }
.btntheme2, .btntheme2,
.downloads-entry .entry-info-item, .downloads-entry .entry-info-item,
.downloads-entry .button { .downloads-entry .button {
@apply bg-(--col3) border-(--col5) hover:bg-(--col5) hover:border-(--col7) disabled:text-gray-300 disabled:bg-(--col2) disabled:border-(--col6) disabled:hover:text-gray-100 disabled:hover:bg-(--col3) disabled:hover:border-(--col7); @apply bg-(--col3)/50 border-(--col5)/50 hover:bg-(--col5)/50 hover:border-(--col7)/50 disabled:text-gray-300 disabled:bg-(--col2)/50 disabled:border-(--col6)/50 disabled:hover:text-gray-100 disabled:hover:bg-(--col3) disabled:hover:border-(--col7);
} }
.btntheme3, .btntheme3,
.downloads-entry:hover .entry-info-item, .downloads-entry:hover .entry-info-item,
.downloads-entry:hover .button { .downloads-entry:hover .button {
@apply bg-(--col4) border-(--col6) hover:bg-(--col6) hover:border-(--col8) disabled:text-gray-300 disabled:bg-(--col2) disabled:border-(--col7) disabled:hover:text-gray-100 disabled:hover:bg-(--col4) disabled:hover:border-(--col8); @apply bg-(--col4)/50 border-(--col6)/50 hover:bg-(--col6)/50 hover:border-(--col8)/50 disabled:text-gray-300 disabled:bg-(--col2)/50 disabled:border-(--col7)/50 disabled:hover:text-gray-100 disabled:hover:bg-(--col4) disabled:hover:border-(--col8);
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
@@ -119,15 +78,15 @@ body {
} }
.popup-box { .popup-box {
@apply relative w-150 h-120 rounded-lg bg-(--col1) border border-(--col3) flex flex-col p-6; @apply relative w-150 h-120 rounded-lg bg-(--col1)/50 border border-(--col3)/50 flex flex-col p-6;
} }
.popup-content { .popup-content {
@apply flex-1 overflow-auto bg-(--col2) border border-(--col4) rounded-lg mt-4; @apply flex-1 overflow-auto bg-(--col2)/50 border border-(--col4)/50 rounded-lg mt-4;
} }
.popup-entry { .popup-entry {
@apply relative h-fit bg-(--col3) m-2 p-2 rounded-lg border border-(--col5); @apply relative h-fit bg-(--col3)/50 m-2 p-2 rounded-lg border border-(--col5)/50;
} }
.popup-entry button { .popup-entry button {
@@ -143,7 +102,7 @@ body {
} }
.input-field { .input-field {
@apply border-2 border-(--col4) rounded-md bg-(--col2) py-1 px-2 focus:bg-(--col3) focus:border-(--col6) transition-colors w-full; @apply border-2 border-(--col4)/50 rounded-md bg-(--col2)/50 py-1 px-2 focus:bg-(--col3)/50 focus:border-(--col6)/50 transition-colors w-full;
} }
.entry-info-item { .entry-info-item {
+2 -2
View File
@@ -5,11 +5,11 @@
} }
.setting-checkbox { .setting-checkbox {
@apply appearance-none w-full h-full border-2 border-(--col4) rounded-md bg-(--col2) transition-colors cursor-pointer; @apply appearance-none w-full h-full border-2 border-(--col4)/50 rounded-md bg-(--col2)/50 transition-colors cursor-pointer;
} }
.setting-checkbox:checked { .setting-checkbox:checked {
@apply bg-(--col4) border-(--col6); @apply bg-(--col4)/50 border-(--col6)/50;
} }
.fa-check-icon { .fa-check-icon {
+5 -5
View File
@@ -1,16 +1,16 @@
@import "tailwindcss"; @import "tailwindcss";
.sidebar { .sidebar {
@apply fixed top-0 left-0 w-60 h-screen bg-(--col1) flex flex-col border-e border-(--col2) z-1; @apply fixed top-0 left-0 w-60 h-screen bg-(--col1)/50 flex flex-col border-e border-(--col2)/50 z-1;
} }
.sidebar-downloads { .sidebar-downloads {
@apply text-[#bdbdbd] fixed bottom-2 left-2 bg-(--col2) rounded-lg border border-(--col3) px-4 py-3 text-xl cursor-pointer transition-colors duration-[0.25s] opacity-75; @apply text-[#bdbdbd] fixed bottom-2 left-2 bg-(--col2)/50 rounded-lg border border-(--col3)/50 px-4 py-3 text-xl cursor-pointer transition-colors duration-[0.25s] opacity-75;
} }
.sidebar-downloads:hover { .sidebar-downloads:hover {
@apply text-white opacity-100; @apply text-white opacity-100;
@apply bg-(--col3) border-(--col4); @apply bg-(--col3)/50 border-(--col4)/50;
} }
.nav-links { .nav-links {
@@ -22,7 +22,7 @@
} }
.link.active { .link.active {
@apply bg-(--col2) border-(--col3); @apply bg-(--col2)/50 border-(--col3)/50;
} }
.link.active, .link.active,
@@ -31,7 +31,7 @@
} }
.link.active:hover { .link.active:hover {
@apply bg-(--col3) border-(--col4); @apply bg-(--col3)/50 border-(--col4)/50;
} }
.sidebar ::-webkit-scrollbar { .sidebar ::-webkit-scrollbar {