Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ No UI text below 11px. Counts and numbers use tabular figures. Folder paths in t
- Proton builds: one row per build, by a readable name where the folder name allows ("Proton-CachyOS 11.0 (v3)", `protonName` in `format.ts`), with an accent "in use" tag on the build games run with, a "Steam" tag on Steam's, its size once measured, and Remove with an inline confirm for Guild's own only. The last row, Install another build, folds out one panel with a GE-Proton / Proton-CachyOS segmented control and that source's releases, each with Install (its percent while it runs) or Installed.
- Prefixes: the heading carries the count and total size on the right. One row per game prefix with its name (the copy key and "Game no longer in your library" once the game is gone), its size once measured, and a ⋯ menu with Open folder, winecfg, winetricks (disabled when neither the system nor any Proton build has it; a note under the group says why) and Remove…, which asks in the row that saves in it are lost unless cloud saves are on, with focus on Cancel.
- Rows in these two lists are one height, with or without a button.
- **Game page:** covers the content area while the library stays mounted underneath, so its scroll position survives. A column up to 1360px: the 300px hero, a tab row (Overview, DLC, Saves, Launch options, Installation); on Linux, Launch options adds a Proton menu chip (Default follows Settings), also for added games, where it is the only row, and never for a native Linux GOG build. A Windows game's first launch on Linux shows Setting up… in the busy pill, the card badge and Continue until its program runs. Once a Windows game has run on Linux, Installation gets a Wine prefix row with Open, winecfg and winetricks (disabled with the same reason as in Settings); never for a native Linux build, and never Remove, which stays in Settings and the uninstall confirm. Its uninstall confirm offers an Also remove its Wine prefix checkbox, off by default, then three fact tiles and an About / Details grid (1.7fr / 1fr).
- **Game page:** covers the content area while the library stays mounted underneath, so its scroll position survives. A column up to 1360px: the 300px hero, a tab row (Overview, DLC, Saves, Launch options, Installation); on Linux, Launch options adds a Proton menu chip (Default follows Settings), also for added games, where it is the only row, and never for a native Linux GOG build. A Windows game's first launch on Linux shows Setting up… in the busy pill, the card badge and Continue until its program runs, with the percent while its Play downloads umu-launcher or GE-Proton first. Once a Windows game has run on Linux, Installation gets a Wine prefix row with Open, winecfg and winetricks (disabled with the same reason as in Settings); never for a native Linux build, and never Remove, which stays in Settings and the uninstall confirm. Its uninstall confirm offers an Also remove its Wine prefix checkbox, off by default, then three fact tiles and an About / Details grid (1.7fr / 1fr).

## Elevation and shapes

Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You need [Node.js](https://nodejs.org) 24 or later, [Rust](https://rustup.rs) st
sudo apt install libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev libssl-dev patchelf build-essential
```

On Arch: `webkit2gtk-4.1 libayatana-appindicator librsvg xdotool base-devel`. At runtime Linux also needs `python3` (the Linux builds of Legendary and gogdl run on it), `xdg-open`, and a Secret Service provider such as GNOME Keyring or KWallet for the saved secrets. Windows games run through `umu-run` (from PATH, or downloaded in Settings) and a Proton build: GE-Proton in Steam's `compatibilitytools.d`, Steam's own Proton, or GE-Proton and Proton-CachyOS installed from Settings → Wine. Each game gets its own Wine prefix under `<data>/prefixes/<copy key>`; uninstalling a game keeps it unless the owner ticks the option to remove it, since its saves live there. Settings → Wine lists and removes prefixes. The pinned umu-launcher version and hash are in `src-tauri/src/wine.rs`.
On Arch: `webkit2gtk-4.1 libayatana-appindicator librsvg xdotool base-devel`. At runtime Linux also needs `python3` (the Linux builds of Legendary and gogdl run on it), `xdg-open`, and a Secret Service provider such as GNOME Keyring or KWallet for the saved secrets. Windows games run through `umu-run` (from PATH, or downloaded in Settings or by the first Play that needs it) and a Proton build: GE-Proton in Steam's `compatibilitytools.d`, Steam's own Proton, or GE-Proton and Proton-CachyOS installed from Settings → Wine; with none, Play installs the newest GE-Proton. Each game gets its own Wine prefix under `<data>/prefixes/<copy key>`; uninstalling a game keeps it unless the owner ticks the option to remove it, since its saves live there. Settings → Wine lists and removes prefixes. The pinned umu-launcher version and hash are in `src-tauri/src/wine.rs`.

```bash
npm install
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Your library, settings and play history stay on your computer, in `%LOCALAPPDATA
- GOG GamesDB, to match games across stores and for some covers
- the stores' image servers, for covers and screenshots
- IGDB and SteamGridDB, only if you add their keys
- GitHub, to check for Guild updates, and to download a store tool, umu-launcher or a Proton build when you ask for it
- GitHub, to check for Guild updates, and to download a store tool, umu-launcher or a Proton build when you ask for it, and umu-launcher and GE-Proton the first time you play a Windows game on Linux without them

Some of these connections aren't official and can break when a store changes something. When a store login stops working, a dot shows on the Settings button.

Expand Down
16 changes: 14 additions & 2 deletions src-tauri/src/commands/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,8 @@ pub struct Poll {
/// The running game is a Windows game on Linux whose first launch still sets up (umu fetching the Steam Linux
/// Runtime or making its prefix); it ends once the game's program runs.
setting_up: bool,
/// The running game's Play is downloading umu-launcher or Proton first: how far, in percent.
setup_percent: Option<u8>,
progress: HashMap<String, Progress>,
/// The library changed (a Steam download finished), so the UI should re-ask `library`.
changed: bool,
Expand Down Expand Up @@ -1341,9 +1343,18 @@ fn poll_blocking(app: &AppHandle) -> Poll {
// The session starts when the game does, not while umu sets it up.
w.since = Instant::now();
}
// A Play installing umu or Proton first shows as that game setting up, with the download's percent.
let preparing = crate::platform::preparing();
let running = steam_running
.or(watched)
.or(preparing.as_ref().map(|p| p.0.clone()));
let setup_percent = preparing
.filter(|p| running.as_ref() == Some(&p.0))
.map(|p| p.1);
Poll {
setting_up,
running: steam_running.or(watched),
setting_up: setting_up || setup_percent.is_some(),
setup_percent,
running,
progress,
changed,
queue,
Expand Down Expand Up @@ -1908,6 +1919,7 @@ mod tests {
let poll = Poll {
running: Some("steam-635320".into()),
setting_up: false,
setup_percent: None,
progress: HashMap::from([("epic-Pumpkin".to_string(), progress)]),
changed: false,
queue: crate::downloads::view(&queue, |key| titles.get(key).map(|t| t.to_string())),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ expression: poll
{
"running": "steam-635320",
"settingUp": false,
"setupPercent": null,
"progress": {
"epic-Pumpkin": {
"fraction": 0.5,
Expand Down
11 changes: 11 additions & 0 deletions src-tauri/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,17 @@ pub fn windows_game(
crate::wine::game_command(game, key, proton)
}

/// The copy whose Play installs umu-launcher or Proton first, and the download's percent; never on Windows.
#[cfg(windows)]
pub fn preparing() -> Option<(String, u8)> {
None
}

#[cfg(target_os = "linux")]
pub fn preparing() -> Option<(String, u8)> {
crate::wine::preparing()
}

/// Whether a launched game still waits on its first-run setup; never on Windows.
#[cfg(windows)]
pub fn setting_up(_key: &str) -> bool {
Expand Down
51 changes: 51 additions & 0 deletions src-tauri/src/wine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ fn wrap(game: &Command, key: &str, proton: Option<&str>) -> Result<(Command, Pro
/// A game's launch through `wrap`. When umu still has to fetch the Steam Linux Runtime or set the prefix up, the copy
/// counts as setting up (`setting_up`) until the game's own program runs.
pub fn game_command(game: Command, key: &str, proton: Option<&str>) -> Result<Command, Msg> {
install_runner(key)?;
let (mut command, proton) = wrap(&game, key, proton)?;
match fs_err::File::create(crate::log::game_output(key)) {
Ok(file) => _ = command.stderr(file.into_file()),
Expand All @@ -295,6 +296,56 @@ pub fn game_command(game: Command, key: &str, proton: Option<&str>) -> Result<Co
Ok(command)
}

/// Installs what a Windows game needs and isn't found: umu-launcher, and the newest GE-Proton when there is no Proton
/// build at all. Blocking; Plays take turns (`LAUNCHING`), so two never download at once. `preparing` reports it.
fn install_runner(key: &str) -> Result<(), Msg> {
let need_umu = umu().is_none();
let need_proton = protons().is_empty();
if !need_umu && !need_proton {
return Ok(());
}
let _preparing = Preparing::start(key);
if need_umu {
tauri::async_runtime::block_on(install_umu(Preparing::report))?;
}
if need_proton {
let newest = releases(ProtonKind::GeProton)
.and_then(|r| r.into_iter().next())
.ok_or(msg!(noProton))?;
let install = install_proton(ProtonKind::GeProton, newest.tag, Preparing::report);
tauri::async_runtime::block_on(install)?;
}
Ok(())
}

static PREPARING: Mutex<Option<(String, u8)>> = Mutex::new(None);

struct Preparing;

impl Preparing {
fn start(key: &str) -> Self {
*PREPARING.lock().unwrap_or_else(|e| e.into_inner()) = Some((key.to_owned(), 0));
Self
}

fn report(percent: u8) {
if let Some(p) = PREPARING.lock().unwrap_or_else(|e| e.into_inner()).as_mut() {
p.1 = percent;
}
}
}

impl Drop for Preparing {
fn drop(&mut self) {
*PREPARING.lock().unwrap_or_else(|e| e.into_inner()) = None;
}
}

/// The copy whose Play is installing umu or Proton, and the download's percent.
pub fn preparing() -> Option<(String, u8)> {
PREPARING.lock().unwrap_or_else(|e| e.into_inner()).clone()
}

/// A launch waiting on setup: the game's program file name and its prefix.
struct Setup {
exe: String,
Expand Down
5 changes: 5 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
let version = $state(0)
let running = $state<string | null>(null)
let settingUp = $state(false)
let setupPercent = $state<number | null>(null)
let progress = $state<Record<string, Progress>>({})
let queue = $state<QueueView>(api.emptyQueue)
let open = $state<string | null>(null)
Expand Down Expand Up @@ -373,6 +374,7 @@
const p = await commands.poll()
running = p.running
settingUp = p.settingUp
setupPercent = p.setupPercent
progress = p.progress
queue = p.queue
if (p.failed) error = api.message(p.failed)
Expand Down Expand Up @@ -584,6 +586,7 @@
{running}
{launching}
{settingUp}
{setupPercent}
{progress}
{queue}
onopen={openGame}
Expand All @@ -604,6 +607,7 @@
running={running !== null && featured.copyKeys.includes(running)}
launching={launching.has(featured.chosen)}
{settingUp}
{setupPercent}
onplay={(key) => act('play', key)}
onopen={openGame}
/>
Expand Down Expand Up @@ -669,6 +673,7 @@
gameKey={open}
runningKey={running}
{settingUp}
{setupPercent}
progressByKey={progress}
{queue}
oncancel={cancelDownload}
Expand Down
6 changes: 5 additions & 1 deletion src/lib/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { cover, prefetch, type QueueState } from './api'
import type { Card, Cover, Progress } from './bindings'
import { t } from './i18n'
import { settingUpLabel } from './format'

let {
game,
Expand All @@ -12,6 +13,7 @@
running,
launching = false,
settingUp = false,
setupPercent = null,
progress,
queued,
onopen,
Expand All @@ -32,6 +34,8 @@
launching?: boolean
/** Running, but its first launch on Linux still sets up. */
settingUp?: boolean
/** Its Play is downloading umu or Proton first. */
setupPercent?: number | null
progress: Progress | undefined
/** Where this game is in the download queue; null when it isn't. */
queued: QueueState | null
Expand Down Expand Up @@ -154,7 +158,7 @@
</span>

{#if running}
<span class="badge" id={statusId}>{settingUp ? t('busy.settingUp') : t('play.playing')}</span>
<span class="badge" id={statusId}>{settingUp ? settingUpLabel(setupPercent) : t('play.playing')}</span>
{:else if waiting}
<span class="chip" id={statusId}>{waiting.state === 'paused' ? t('downloads.paused') : t('card.queued')}</span>
{:else if progress}
Expand Down
10 changes: 8 additions & 2 deletions src/lib/Continue.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<script lang="ts">
import type { Featured } from './bindings'
import { t } from './i18n'
import { settingUpLabel } from './format'

let {
featured,
running,
launching = false,
settingUp = false,
setupPercent = null,
onplay,
onopen,
}: {
Expand All @@ -16,6 +18,8 @@
launching?: boolean
/** Running, but its first launch on Linux still sets up. */
settingUp?: boolean
/** Its Play is downloading umu or Proton first. */
setupPercent?: number | null
onplay: (key: string) => void
onopen: (key: string) => void
} = $props()
Expand All @@ -32,10 +36,12 @@
<small>{t('continue.title')}</small>
<h2>{featured.title}</h2>
<button class="pill" disabled={running} aria-disabled={launching} onclick={() => launching || onplay(featured.chosen)}>
{#if launching}
{#if running && setupPercent !== null}
{settingUpLabel(setupPercent)}
{:else if launching}
{t('busy.play')}
{:else if running}
{settingUp ? t('busy.settingUp') : t('play.playing')}
{settingUp ? settingUpLabel(setupPercent) : t('play.playing')}
{:else}
<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true"><path d="M7 4.5v15l12.5-7.5z" /></svg>
{t('play.play')}
Expand Down
7 changes: 5 additions & 2 deletions src/lib/Detail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@
import ChoiceMenu from './ChoiceMenu.svelte'
import StoreIcon, { storeNames } from './StoreIcon.svelte'
import Tip from './Tip.svelte'
import { lastPlayedLabel, playtimeLabel, progressLong, sizeLabel, syncedLabel, ttbLabel } from './format'
import { lastPlayedLabel, playtimeLabel, progressLong, settingUpLabel, sizeLabel, syncedLabel, ttbLabel } from './format'

let {
gameKey,
runningKey,
settingUp = false,
setupPercent = null,
progressByKey,
queue,
oncancel,
Expand All @@ -89,6 +90,8 @@
runningKey: string | null
/** The running game's first launch on Linux still sets up (`poll`'s `settingUp`). */
settingUp?: boolean
/** Its Play is downloading umu or Proton first. */
setupPercent?: number | null
progressByKey: Record<string, Progress>
/** The Epic, GOG and Amazon download queue; this game's job in it decides the busy pill. */
queue: QueueView
Expand Down Expand Up @@ -633,7 +636,7 @@
copies={game.copies}
chosen={chosenKey}
{running}
busy={shown ?? (running && settingUp ? t('busy.settingUp') : null)}
busy={running && setupPercent !== null ? settingUpLabel(setupPercent) : (shown ?? (running && settingUp ? settingUpLabel() : null))}
onchoose={(key) => (chosenKey = key)}
onplay={() => act('play')}
onupdate={() => act('update')}
Expand Down
4 changes: 4 additions & 0 deletions src/lib/Grid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
running,
launching,
settingUp = false,
setupPercent = null,
progress,
queue,
onopen,
Expand All @@ -39,6 +40,8 @@
launching: ReadonlySet<string>
/** The running game still sets up (`poll`'s `settingUp`). */
settingUp?: boolean
/** Its Play is downloading umu or Proton first (`poll`'s `setupPercent`). */
setupPercent?: number | null
progress: Record<string, Progress>
queue: QueueView
onopen: (key: string) => void
Expand Down Expand Up @@ -177,6 +180,7 @@
running={running !== null && game.copyKeys.includes(running)}
launching={launching.has(game.chosen)}
{settingUp}
{setupPercent}
progress={game.copyKeys.map((k) => progress[k]).find(Boolean)}
queued={queue.jobs.length ? queueState(queue, game.copyKeys) : null}
{onopen}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,8 @@ export type Poll = {
* Runtime or making its prefix); it ends once the game's program runs.
*/
settingUp: boolean,
/** The running game's Play is downloading umu-launcher or Proton first: how far, in percent. */
setupPercent: number | null,
progress: { [key in string]: Progress },
/** The library changed (a Steam download finished), so the UI should re-ask `library`. */
changed: boolean,
Expand Down
4 changes: 4 additions & 0 deletions src/lib/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import type { Progress } from './bindings.ts'
export type { Progress }

/** `id` is a group id from Rust's `view::group`, in its order per sort, and `favorites` and `allGames` from `view::favorites_first`. */
/** A running game's first launch that still sets up, with the umu or Proton download's percent while its Play fetches one. */
export const settingUpLabel = (percent: number | null = null) =>
percent === null ? t('busy.settingUp') : t('busy.settingUpPercent', { percent: `${percent}%` })

export const groupLabel = (id: string) => t(`group.${id}`)

const KB = 1024
Expand Down
1 change: 1 addition & 0 deletions src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@
"msg.protonInUse": "A game is still running with this Proton build. Close it first.",
"msg.noWinetricks": "winetricks isn't installed, and this game's Proton build doesn't include it.",
"busy.settingUp": "Setting up…",
"busy.settingUpPercent": "Setting up… {percent}",
"detail.removePrefix": "Also remove its Wine prefix",
"settings.protonNow": "Proton: {name}",
"settings.protonFor": "Proton for Windows games",
Expand Down
1 change: 1 addition & 0 deletions src/lib/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@
"msg.protonInUse": "Er draait nog een game met deze Proton-versie. Sluit die eerst.",
"msg.noWinetricks": "winetricks is niet geïnstalleerd en zit niet in de Proton-versie van deze game.",
"busy.settingUp": "Instellen…",
"busy.settingUpPercent": "Instellen… {percent}",
"detail.removePrefix": "Ook de Wine-prefix verwijderen",
"settings.protonNow": "Proton: {name}",
"settings.protonFor": "Proton voor Windows-games",
Expand Down
Loading