change game to app

This commit is contained in:
olcxja 2026-09-25 17:33:42 +02:00
commit a8335a0e89
7 changed files with 30 additions and 32 deletions

4
.gitignore vendored
View file

@ -2,4 +2,6 @@
/dist/ /dist/
/.idea/ /.idea/
*.log *.log
renderer/dev-preview.html /renderer/dev-preview.html
/.freebuff/
/test/

View file

@ -7,15 +7,15 @@
"app.title": "PLGL", "app.title": "PLGL",
"app.subtitle": "Portable Linux Wine Launcher", "app.subtitle": "Portable Linux Wine Launcher",
"nav.library": "Library", "nav.library": "Apps",
"nav.prefixes": "Wine prefixes", "nav.prefixes": "Wine prefixes",
"nav.wines": "Wine versions", "nav.wines": "Wine versions",
"nav.settings": "Settings", "nav.settings": "Settings",
"library.title": "Game library", "library.title": "Apps Library",
"library.empty": "No games yet", "library.empty": "No apps yet",
"library.emptyHint": "Import a game to get started. The launcher can copy it into files/games to stay fully portable, or just remember where it lives.", "library.emptyHint": "Import an app to get started. The launcher can copy it into files/apps to stay fully portable, or just remember where it lives.",
"library.import": "Import game", "library.import": "Import app",
"library.play": "Play", "library.play": "Play",
"library.stop": "Stop", "library.stop": "Stop",
"library.running": "Running", "library.running": "Running",
@ -27,21 +27,21 @@
"library.portable": "Portable", "library.portable": "Portable",
"library.external": "External", "library.external": "External",
"library.removeConfirm": "Remove {0} from the launcher?{1}", "library.removeConfirm": "Remove {0} from the launcher?{1}",
"library.removeFilesNote": "\nIts imported files in files/games will also be deleted.", "library.removeFilesNote": "\nIts imported files in files/apps will also be deleted.",
"library.tools": "Wine tools", "library.tools": "Wine tools",
"library.viewLogs": "View logs", "library.viewLogs": "View logs",
"import.question": "Should the game files be brought into the launcher so it stays portable, or left where they are?", "import.question": "Should the app files be brought into the launcher so it stays portable, or left where they are?",
"import.mode.copy": "Copy into launcher (portable)", "import.mode.copy": "Copy into launcher (portable)",
"import.mode.move": "Move into launcher (portable)", "import.mode.move": "Move into launcher (portable)",
"import.mode.leave": "Leave in place", "import.mode.leave": "Leave in place",
"import.pickFolder": "Choose the game folder", "import.pickFolder": "Choose the app folder",
"import.progress": "Importing {0}…", "import.progress": "Importing {0}…",
"import.fileDone": "{0} files copied", "import.fileDone": "{0} files copied",
"import.done": "Import finished", "import.done": "Import finished",
"import.failed": "Import failed: {0}", "import.failed": "Import failed: {0}",
"config.title": "Game configuration", "config.title": "App configuration",
"config.name": "Name", "config.name": "Name",
"config.workdir": "Working directory", "config.workdir": "Working directory",
"config.exePath": "Executable", "config.exePath": "Executable",
@ -66,7 +66,7 @@
"config.launchFailed": "Failed to launch {0}", "config.launchFailed": "Failed to launch {0}",
"tools.title": "Wine tools", "tools.title": "Wine tools",
"tools.subtitle": "Run a tool inside this game's wine environment.", "tools.subtitle": "Run a tool inside this app's wine environment.",
"tools.winecfg": "winecfg", "tools.winecfg": "winecfg",
"tools.regedit": "regedit", "tools.regedit": "regedit",
"tools.taskmgr": "taskmgr", "tools.taskmgr": "taskmgr",

View file

@ -7,15 +7,15 @@
"app.title": "PLGL", "app.title": "PLGL",
"app.subtitle": "Przenośny launcher Wine dla Linuksa", "app.subtitle": "Przenośny launcher Wine dla Linuksa",
"nav.library": "Biblioteka", "nav.library": "Aplikacje",
"nav.prefixes": "Prefiksy Wine", "nav.prefixes": "Prefiksy Wine",
"nav.wines": "Wersje Wine", "nav.wines": "Wersje Wine",
"nav.settings": "Ustawienia", "nav.settings": "Ustawienia",
"library.title": "Biblioteka gier", "library.title": "Biblioteka aplikacji",
"library.empty": "Brak gier", "library.empty": "Brak aplikacji",
"library.emptyHint": "Zaimportuj grę, aby zacząć. Launcher może skopiować ją do files/games, żeby być w pełni przenośny, albo po prostu zapamiętać, gdzie się znajduje.", "library.emptyHint": "Zaimportuj aplikację, aby zacząć. Launcher może skopiować ją do files/apps, żeby być w pełni przenośny, albo po prostu zapamiętać, gdzie się znajduje.",
"library.import": "Importuj grę", "library.import": "Importuj aplikację",
"library.play": "Graj", "library.play": "Graj",
"library.stop": "Zatrzymaj", "library.stop": "Zatrzymaj",
"library.running": "Uruchomiona", "library.running": "Uruchomiona",
@ -27,21 +27,21 @@
"library.portable": "Przenośna", "library.portable": "Przenośna",
"library.external": "Zewnętrzna", "library.external": "Zewnętrzna",
"library.removeConfirm": "Usunąć {0} z launchera?{1}", "library.removeConfirm": "Usunąć {0} z launchera?{1}",
"library.removeFilesNote": "\nJej zaimportowane pliki w files/games również zostaną usunięte.", "library.removeFilesNote": "\nJej zaimportowane pliki w files/apps również zostaną usunięte.",
"library.tools": "Narzędzia Wine", "library.tools": "Narzędzia Wine",
"library.viewLogs": "Podejrzyj logi", "library.viewLogs": "Podejrzyj logi",
"import.question": "Czy pliki gry mają trafić do launchera, aby był przenośny, czy mają zostać tam, gdzie są?", "import.question": "Czy pliki aplikacji mają trafić do launchera, aby był przenośny, czy mają zostać tam, gdzie są?",
"import.mode.copy": "Skopiuj do launchera (przenośne)", "import.mode.copy": "Skopiuj do launchera (przenośne)",
"import.mode.move": "Przenieś do launchera (przenośne)", "import.mode.move": "Przenieś do launchera (przenośne)",
"import.mode.leave": "Zostaw w miejscu", "import.mode.leave": "Zostaw w miejscu",
"import.pickFolder": "Wybierz folder gry", "import.pickFolder": "Wybierz folder aplikacji",
"import.progress": "Importowanie {0}…", "import.progress": "Importowanie {0}…",
"import.fileDone": "Skopiowane pliki: {0}", "import.fileDone": "Skopiowane pliki: {0}",
"import.done": "Import zakończony", "import.done": "Import zakończony",
"import.failed": "Import nie powiódł się: {0}", "import.failed": "Import nie powiódł się: {0}",
"config.title": "Konfiguracja gry", "config.title": "Konfiguracja aplikacji",
"config.name": "Nazwa", "config.name": "Nazwa",
"config.workdir": "Katalog roboczy", "config.workdir": "Katalog roboczy",
"config.exePath": "Plik wykonywalny", "config.exePath": "Plik wykonywalny",
@ -66,7 +66,7 @@
"config.launchFailed": "Nie udało się uruchomić {0}", "config.launchFailed": "Nie udało się uruchomić {0}",
"tools.title": "Narzędzia Wine", "tools.title": "Narzędzia Wine",
"tools.subtitle": "Uruchom narzędzie w środowisku wine tej gry.", "tools.subtitle": "Uruchom narzędzie w środowisku wine tej aplikacji.",
"tools.winecfg": "winecfg", "tools.winecfg": "winecfg",
"tools.regedit": "regedit", "tools.regedit": "regedit",
"tools.taskmgr": "taskmgr", "tools.taskmgr": "taskmgr",

View file

@ -58,11 +58,11 @@ async function importGame(srcDir, mode, onProgress) {
const name = path.basename(srcDir) const name = path.basename(srcDir)
let workdir = srcDir let workdir = srcDir
if (mode === 'copy') { if (mode === 'copy') {
const dst = dedupeName(DIRS.GAMES, name) const dst = dedupeName(DIRS.APPS, name)
await copyRecursive(srcDir, dst, onProgress) await copyRecursive(srcDir, dst, onProgress)
workdir = dst workdir = dst
} else if (mode === 'move') { } else if (mode === 'move') {
const dst = dedupeName(DIRS.GAMES, name) const dst = dedupeName(DIRS.APPS, name)
await moveFolder(srcDir, dst, onProgress) await moveFolder(srcDir, dst, onProgress)
workdir = dst workdir = dst
} }

View file

@ -4,7 +4,7 @@ const path = require('path')
const { DIRS, readJson, writeJson } = require('./paths') const { DIRS, readJson, writeJson } = require('./paths')
const { prefixPath } = require('./prefixes') const { prefixPath } = require('./prefixes')
const REGISTRY = path.join(DIRS.DATA, 'games.json') const REGISTRY = path.join(DIRS.DATA, 'apps.json')
const SETTINGS = path.join(DIRS.DATA, 'settings.json') const SETTINGS = path.join(DIRS.DATA, 'settings.json')
function loadGames() { function loadGames() {
@ -40,7 +40,7 @@ function removeGame(id) {
const idx = games.findIndex(g => g.id === id) const idx = games.findIndex(g => g.id === id)
if (idx === -1) return false if (idx === -1) return false
const g = games[idx] const g = games[idx]
if (g.imported && g.path && g.path.startsWith(DIRS.GAMES)) { if (g.imported && g.path && g.path.startsWith(DIRS.APPS)) {
try { try {
require('fs').rmSync(g.path, { recursive: true, force: true }) require('fs').rmSync(g.path, { recursive: true, force: true })
} catch {} } catch {}

View file

@ -18,18 +18,14 @@ const DIRS = {
DATA, DATA,
WINES: path.join(FILES, 'wines'), WINES: path.join(FILES, 'wines'),
PREFIXES: path.join(FILES, 'wineprefixes'), PREFIXES: path.join(FILES, 'wineprefixes'),
GAMES: path.join(FILES, 'games'), APPS: path.join(FILES, 'apps'),
TRANSLATIONS: path.join(FILES, 'translations'), TRANSLATIONS: path.join(FILES, 'translations'),
BUNDLED_TRANSLATIONS: path.join(BUNDLED, 'translations'), BUNDLED_TRANSLATIONS: path.join(BUNDLED, 'translations'),
FAKE_STEAM: path.join(DATA, 'fake-steam') FAKE_STEAM: path.join(DATA, 'fake-steam')
} }
function ensureDirs() { function ensureDirs() {
const legacy = path.join(FILES, 'wine prefixes') for (const dir of [FILES, DATA, DIRS.WINES, DIRS.PREFIXES, DIRS.APPS, DIRS.TRANSLATIONS, DIRS.FAKE_STEAM]) {
try {
if (fs.existsSync(legacy) && !fs.existsSync(DIRS.PREFIXES)) fs.renameSync(legacy, DIRS.PREFIXES)
} catch {}
for (const dir of [FILES, DATA, DIRS.WINES, DIRS.PREFIXES, DIRS.GAMES, DIRS.TRANSLATIONS, DIRS.FAKE_STEAM]) {
fs.mkdirSync(dir, { recursive: true }) fs.mkdirSync(dir, { recursive: true })
} }
if (DIRS.TRANSLATIONS !== DIRS.BUNDLED_TRANSLATIONS) { if (DIRS.TRANSLATIONS !== DIRS.BUNDLED_TRANSLATIONS) {

View file

@ -41,7 +41,7 @@ window.plgl = {
prefixesDelete: async n => n === 'Main' ? ({ ok: false, error: 'isMain' }) : ({ ok: true }), prefixesDelete: async n => n === 'Main' ? ({ ok: false, error: 'isMain' }) : ({ ok: true }),
prefixesSetDefault: async () => ({ ok: true }), prefixesSetDefault: async () => ({ ok: true }),
gamesList: async () => [ gamesList: async () => [
{ id: 'g1', name: 'Cyberpunk 2077', mode: 'copy', wine: 'proton-ge-proton9-20', prefix: '', args: '--launcher-skip', env: { 'DXVK_HUD': '0' }, dllOverrides: [{ dll: 'dinput8', setting: 'native' }], workdir: '/home/user/PLGL/files/games/Cyberpunk 2077/bin/x64', exePath: '/home/user/PLGL/files/games/Cyberpunk 2077/bin/x64/Cyberpunk2077.exe', created: 1, lastPlayed: Date.now() - 86400000 }, { id: 'g1', name: 'Cyberpunk 2077', mode: 'copy', wine: 'proton-ge-proton9-20', prefix: '', args: '--launcher-skip', env: { 'DXVK_HUD': '0' }, dllOverrides: [{ dll: 'dinput8', setting: 'native' }], workdir: '/home/user/PLGL/files/apps/Cyberpunk 2077/bin/x64', exePath: '/home/user/PLGL/files/apps/Cyberpunk 2077/bin/x64/Cyberpunk2077.exe', created: 1, lastPlayed: Date.now() - 86400000 },
{ id: 'g2', name: 'Heroes of Might and Magic III', mode: 'leave', wine: 'system', prefix: 'gaming', args: '', env: {}, dllOverrides: [], workdir: '/mnt/games/HoMM3', exePath: '/mnt/games/HoMM3/h3game.exe', created: 2, lastPlayed: 0 } { id: 'g2', name: 'Heroes of Might and Magic III', mode: 'leave', wine: 'system', prefix: 'gaming', args: '', env: {}, dllOverrides: [], workdir: '/mnt/games/HoMM3', exePath: '/mnt/games/HoMM3/h3game.exe', created: 2, lastPlayed: 0 }
], ],
gamesGet: async () => null, gamesGet: async () => null,