Fixes
This commit is contained in:
@@ -17,7 +17,7 @@ export default function VersionChangelog () {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p className='text-xl text-center'>
|
<p className='text-xl text-center'>
|
||||||
Viewing changelog for {gameInfo?.name} v{versionInfo?.versionName}
|
Viewing changelog for {versionInfo?.displayName}
|
||||||
</p>
|
</p>
|
||||||
<div className='popup-content text-center p-2'>
|
<div className='popup-content text-center p-2'>
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default function VersionInfo () {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p className='text-xl text-center'>
|
<p className='text-xl text-center'>
|
||||||
Viewing info for {gameInfo?.name} v{versionInfo?.versionName}
|
Viewing info for {versionInfo?.displayName}
|
||||||
</p>
|
</p>
|
||||||
<div className='popup-content flex flex-col items-center justify-center gap-2 h-full'>
|
<div className='popup-content flex flex-col items-center justify-center gap-2 h-full'>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default function Installs () {
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{category == -1 &&
|
{category == -1 &&
|
||||||
Object.entries(game.subcategoryNames).map(([key, value]) => {
|
Object.entries(game.categoryNames).map(([key, value]) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={crypto.randomUUID()}
|
key={crypto.randomUUID()}
|
||||||
@@ -117,8 +117,7 @@ export default function Installs () {
|
|||||||
)
|
)
|
||||||
return false
|
return false
|
||||||
return (
|
return (
|
||||||
info.game === id &&
|
info.game === id && info.category == Number(key)
|
||||||
info.subcategory == Number(key)
|
|
||||||
)
|
)
|
||||||
}).length ?? 0
|
}).length ?? 0
|
||||||
return `${count} install${count === 1 ? '' : 's'}`
|
return `${count} install${count === 1 ? '' : 's'}`
|
||||||
@@ -162,8 +161,8 @@ export default function Installs () {
|
|||||||
return (
|
return (
|
||||||
info.game === id &&
|
info.game === id &&
|
||||||
(category == -1
|
(category == -1
|
||||||
? info.subcategory == -1
|
? info.category == -1
|
||||||
: info.subcategory == category)
|
: info.category == category)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.map((entry, i) => (
|
.map((entry, i) => (
|
||||||
@@ -188,7 +187,7 @@ export default function Installs () {
|
|||||||
invoke('launch_game', {
|
invoke('launch_game', {
|
||||||
name: verInfo.id,
|
name: verInfo.id,
|
||||||
executable: verInfo.executable,
|
executable: verInfo.executable,
|
||||||
displayName: `${gameInfo.name} v${verInfo.versionName}`,
|
displayName: verInfo.displayName,
|
||||||
useWine: !!(
|
useWine: !!(
|
||||||
platform() === 'linux' &&
|
platform() === 'linux' &&
|
||||||
verInfo.wine &&
|
verInfo.wine &&
|
||||||
@@ -209,8 +208,7 @@ export default function Installs () {
|
|||||||
>
|
>
|
||||||
<div className='h-18 w-screen relative'>
|
<div className='h-18 w-screen relative'>
|
||||||
<p className='text-2xl'>
|
<p className='text-2xl'>
|
||||||
{getGameInfo(getVersionInfo(entry)?.game)?.name} v
|
{getVersionInfo(entry)?.displayName}
|
||||||
{getVersionInfo(entry)?.versionName}
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className='flex gap-2 absolute left-0 bottom-0'>
|
<div className='flex gap-2 absolute left-0 bottom-0'>
|
||||||
|
|||||||
@@ -192,14 +192,14 @@ export default function RootLayout ({
|
|||||||
let unlistenProgress: (() => void) | null = null
|
let unlistenProgress: (() => void) | null = null
|
||||||
|
|
||||||
listen<string>('download-progress', event => {
|
listen<string>('download-progress', event => {
|
||||||
const [versionName, progStr, totalSizeStr, speedStr, etaSecsStr] =
|
const [displayName, progStr, totalSizeStr, speedStr, etaSecsStr] =
|
||||||
event.payload.split(':')
|
event.payload.split(':')
|
||||||
const prog = Number(progStr)
|
const prog = Number(progStr)
|
||||||
const progBytes = Number(totalSizeStr)
|
const progBytes = Number(totalSizeStr)
|
||||||
const speed = Number(speedStr)
|
const speed = Number(speedStr)
|
||||||
const etaSecs = Number(etaSecsStr)
|
const etaSecs = Number(etaSecsStr)
|
||||||
setDownloadProgress(prev => {
|
setDownloadProgress(prev => {
|
||||||
const i = prev.findIndex(d => d.version === versionName)
|
const i = prev.findIndex(d => d.version === displayName)
|
||||||
if (i === -1) return prev
|
if (i === -1) return prev
|
||||||
const copy = [...prev]
|
const copy = [...prev]
|
||||||
copy[i] = {
|
copy[i] = {
|
||||||
@@ -214,9 +214,9 @@ export default function RootLayout ({
|
|||||||
}).then(f => (unlistenProgress = f))
|
}).then(f => (unlistenProgress = f))
|
||||||
|
|
||||||
listen<string>('download-hash-checking', event => {
|
listen<string>('download-hash-checking', event => {
|
||||||
const versionName = event.payload
|
const displayName = event.payload
|
||||||
setDownloadProgress(prev => {
|
setDownloadProgress(prev => {
|
||||||
const i = prev.findIndex(d => d.version === versionName)
|
const i = prev.findIndex(d => d.version === displayName)
|
||||||
if (i === -1) return prev
|
if (i === -1) return prev
|
||||||
const copy = [...prev]
|
const copy = [...prev]
|
||||||
copy[i] = { ...copy[i], hash_checking: true }
|
copy[i] = { ...copy[i], hash_checking: true }
|
||||||
@@ -225,9 +225,9 @@ export default function RootLayout ({
|
|||||||
}).then(f => (unlistenProgress = f))
|
}).then(f => (unlistenProgress = f))
|
||||||
|
|
||||||
listen<string>('download-finishing', event => {
|
listen<string>('download-finishing', event => {
|
||||||
const versionName = event.payload
|
const displayName = event.payload
|
||||||
setDownloadProgress(prev => {
|
setDownloadProgress(prev => {
|
||||||
const i = prev.findIndex(d => d.version === versionName)
|
const i = prev.findIndex(d => d.version === displayName)
|
||||||
if (i === -1) return prev
|
if (i === -1) return prev
|
||||||
const copy = [...prev]
|
const copy = [...prev]
|
||||||
copy[i] = { ...copy[i], hash_checking: false, finishing: true }
|
copy[i] = { ...copy[i], hash_checking: false, finishing: true }
|
||||||
@@ -353,7 +353,7 @@ export default function RootLayout ({
|
|||||||
if (normalConfig?.settings.allowNotifications)
|
if (normalConfig?.settings.allowNotifications)
|
||||||
await notifyUser(
|
await notifyUser(
|
||||||
'Download Failed',
|
'Download Failed',
|
||||||
`The download for version ${gameInfo.name} v${info.versionName} has failed.`
|
`The download for version ${info.displayName} has failed.`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -496,8 +496,7 @@ export default function RootLayout ({
|
|||||||
: 'max-w-91.5'
|
: 'max-w-91.5'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{getGameInfo(v.game)?.name} v
|
{v.displayName}
|
||||||
{v.versionName}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
@@ -635,11 +634,7 @@ export default function RootLayout ({
|
|||||||
className='popup-entry flex flex-col justify-between'
|
className='popup-entry flex flex-col justify-between'
|
||||||
>
|
>
|
||||||
<p className='text-2xl text-center'>
|
<p className='text-2xl text-center'>
|
||||||
{
|
{getVersionInfo(v.version)?.displayName}
|
||||||
getGameInfo(getVersionInfo(v.version)?.game)
|
|
||||||
?.name
|
|
||||||
}{' '}
|
|
||||||
v{getVersionInfo(v.version)?.versionName}
|
|
||||||
</p>
|
</p>
|
||||||
<div className='mt-6.25 flex items-center justify-between'>
|
<div className='mt-6.25 flex items-center justify-between'>
|
||||||
{v.failed ? (
|
{v.failed ? (
|
||||||
@@ -719,12 +714,7 @@ export default function RootLayout ({
|
|||||||
<>
|
<>
|
||||||
<p className='text-xl text-center'>
|
<p className='text-xl text-center'>
|
||||||
Manage{' '}
|
Manage{' '}
|
||||||
{
|
{getVersionInfo(managingVersion)?.displayName}
|
||||||
getGameInfo(
|
|
||||||
getVersionInfo(managingVersion)?.game
|
|
||||||
)?.name
|
|
||||||
}{' '}
|
|
||||||
v{getVersionInfo(managingVersion)?.versionName}
|
|
||||||
</p>
|
</p>
|
||||||
<div className='popup-content flex flex-col items-center justify-center gap-2 h-full'>
|
<div className='popup-content flex flex-col items-center justify-center gap-2 h-full'>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ export interface Game {
|
|||||||
official: boolean
|
official: boolean
|
||||||
verified: boolean
|
verified: boolean
|
||||||
developer: string | null
|
developer: string | null
|
||||||
subcategoryNames: Record<string, string>
|
categoryNames: Record<string, string>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export interface GameVersion {
|
export interface GameVersion {
|
||||||
id: string
|
id: string
|
||||||
versionName: string
|
displayName: string
|
||||||
releaseDate: number
|
releaseDate: number
|
||||||
game: number
|
game: number
|
||||||
downloadUrl: string
|
downloadUrl: string
|
||||||
@@ -10,6 +10,6 @@ export interface GameVersion {
|
|||||||
place: number
|
place: number
|
||||||
changelog: string
|
changelog: string
|
||||||
wine: number | undefined
|
wine: number | undefined
|
||||||
subcategory: number
|
category: number
|
||||||
lastRevision: number
|
lastRevision: number
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user