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