From 6eec74f0f62fb7f90813b36854bda2c3b3bd9ead Mon Sep 17 00:00:00 2001 From: ddidderr Date: Fri, 14 Nov 2025 02:24:18 +0100 Subject: [PATCH] unavailable games red button --- crates/lanspread-tauri-deno-ts/src/App.css | 17 +++++++++++++++++ crates/lanspread-tauri-deno-ts/src/App.tsx | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/crates/lanspread-tauri-deno-ts/src/App.css b/crates/lanspread-tauri-deno-ts/src/App.css index df12a4a..2eabd48 100644 --- a/crates/lanspread-tauri-deno-ts/src/App.css +++ b/crates/lanspread-tauri-deno-ts/src/App.css @@ -110,6 +110,23 @@ h1.align-center { transform: translateY(-2px); } +.play-button.unavailable { + background: linear-gradient(45deg, #330000, #550000); + color: #ffb4b4; + border: 1px solid #550000; + box-shadow: none; + cursor: default; + pointer-events: none; +} + +.play-button.unavailable:hover { + background: linear-gradient(45deg, #330000, #550000); + box-shadow: none; + border: 1px solid #550000; + animation: none; + transform: none; +} + @keyframes flicker { 0% { opacity: 1; } 50% { opacity: 0.8; } diff --git a/crates/lanspread-tauri-deno-ts/src/App.tsx b/crates/lanspread-tauri-deno-ts/src/App.tsx index 0d846d3..05b63e4 100644 --- a/crates/lanspread-tauri-deno-ts/src/App.tsx +++ b/crates/lanspread-tauri-deno-ts/src/App.tsx @@ -433,12 +433,23 @@ const App = () => { } }; + const isUnavailable = (game: Game): boolean => { + return !game.installed + && !game.downloaded + && game.peer_count === 0 + && game.install_status === InstallStatus.NotInstalled; + }; + const getActionLabel = (game: Game): string => { const inProgress = getInProgressLabel(game); if (inProgress) { return inProgress; } + if (isUnavailable(game)) { + return 'Unavailable'; + } + if (!game.installed) { return game.downloaded ? 'Install' : 'Download'; } @@ -550,8 +561,13 @@ const App = () => { {item.description.slice(0, 10)} {(item.size / 1024 / 1024 / 1024).toFixed(1)} GB -
{ + if (isUnavailable(item)) { + return; + } + if (!item.installed) { installGame(item.id); } else if (needsUpdate(item)) {