Skip to content

Commit

Permalink
Merge branch 'main' into ux/overlay_improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettCleary authored Oct 26, 2023
2 parents b2f7ea5 + c5bec09 commit f619140
Show file tree
Hide file tree
Showing 36 changed files with 967 additions and 362 deletions.
46 changes: 23 additions & 23 deletions e2e/__specs__/hpStoreApi.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ test.describe('hp store api tests', function () {

const pauseDownload = async () => {
await page.evaluate(async () => {
window.api.pauseCurrentDownload()
return window.api.pauseCurrentDownload()
})
await wait(2000)

//check if download is actually paused
const downloadDirSize = await dirSize(tempFolder)
await wait(1000)
Expand Down Expand Up @@ -218,25 +218,25 @@ test.describe('hp store api tests', function () {
await cancelDownload(true)
})

// test('hp store: download, pause, resume, cancel and do not keep files', async () => {
// // download then pause
// console.log('installing')
// await withTimeout(installPartialTimeout, installPartial(appName), false)
// console.log('pausing')
// await pauseDownload()
// console.log('resuming')
// await resumeDownload()
// console.log('canceling')
// await cancelDownload(true)
// })

// test('hp store: download, pause, cancel and do not keep files', async () => {
// // download then pause
// console.log('installing')
// await withTimeout(installPartialTimeout, installPartial(appName), false)
// console.log('pausing')
// await pauseDownload()
// console.log('canceling')
// await cancelDownload(true)
// })
test('hp store: download, pause, resume, cancel and do not keep files', async () => {
// download then pause
console.log('installing')
await withTimeout(installPartialTimeout, installPartial(appName), false)
console.log('pausing')
await pauseDownload()
console.log('resuming')
await resumeDownload()
console.log('canceling')
await cancelDownload(true)
})

test('hp store: download, pause, cancel and do not keep files', async () => {
// download then pause
console.log('installing')
await withTimeout(installPartialTimeout, installPartial(appName), false)
console.log('pausing')
await pauseDownload()
console.log('canceling')
await cancelDownload(true)
})
})
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hyperplay",
"version": "0.7.1",
"version": "0.8.1",
"private": true,
"main": "build/electron/main.js",
"homepage": "./",
Expand Down Expand Up @@ -171,6 +171,7 @@
"@types/bn.js": "^5.1.1",
"@types/express": "^4.17.13",
"@types/jsdom": "^20.0.0",
"@types/mime": "^3.0.2",
"@types/qrcode": "^1.5.0",
"@types/react-blockies": "^1.4.1",
"@types/unzipper": "^0.10.6",
Expand Down Expand Up @@ -199,7 +200,6 @@
"fs-extra": "^10.1.0",
"fuse.js": "^6.6.2",
"graceful-fs": "^4.2.10",
"hp-easydl": "^1.1.0",
"i18next": "^22.4.10",
"i18next-fs-backend": "^1.1.4",
"i18next-http-backend": "^1.4.0",
Expand All @@ -208,6 +208,7 @@
"jsdom": "^20.0.0",
"json5": "^2.2.3",
"lokijs": "^1.5.12",
"mime": "^3.0.0",
"mobx": "^6.9.0",
"mobx-react-lite": "^3.4.0",
"plist": "^3.0.5",
Expand Down Expand Up @@ -322,7 +323,7 @@
"sass": "^1.55.0",
"supertest": "^6.2.4",
"tmp": "^0.2.1",
"ts-jest": "^28.0.7",
"ts-jest": "^29.1.1",
"type-fest": "^3.2.0",
"typescript": "^4.8.4",
"vite": "^3.2.7",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/en/gamepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"options": "Launch Options..."
},
"not_logged_in": {
"amazon": "You are not logged in with an Amazon account in Heroic. Don't use the store page to login, click the following button instead:",
"amazon": "You are not logged in with an Amazon account in Hyperplay. Don't use the store page to login, click the following button instead:",
"epic": "You are not logged in with an Epic account in HyperPlay. Don't use the store page to login, click the following button instead:",
"gog": "You are not logged in with a GOG account in HyperPlay. Don't use the store page to login, click the following button instead:",
"login": "Log in",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@
"default-install-path": "Default Installation Path",
"default-steam-path": "Default Steam path",
"defaultWinePrefix": "Set Folder for new Wine Prefixes",
"disable_controller": "Disable Heroic navigation using controller",
"disable_controller": "Disable Hyperplay navigation using controller",
"disable_logs": "Disable Logs",
"discordRPC": "Enable Discord Rich Presence",
"download-no-https": "Download games without HTTPS (useful for CDNs e.g. LanCache)",
Expand Down
7 changes: 5 additions & 2 deletions public/locales/es/gamepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
"epic": "You are not logged in with an Epic account in HyperPlay. Don't use the store page to login, click the following button instead:",
"gog": "You are not logged in with a GOG account in HyperPlay. Don't use the store page to login, click the following button instead:",
"login": "Log in",
"title": "You are NOT logged in"
"title": "You are NOT logged in",
"amazon": "No has iniciado sesión con una cuenta de Amazon en Heroic. No utilices la página de la tienda para iniciar sesión, haz clic en el siguiente botón en su lugar:"
},
"report_problem": "Reportar un problema ejecutando este juego",
"sdl": {
Expand Down Expand Up @@ -206,7 +207,9 @@
"moving-files": "Moviendo el archivo '{{file}}': {{percent}} ",
"playing": "Reproduciendo",
"downloading": "Descargando",
"extracting": "Extrayendo"
"extracting": "Extrayendo",
"gog-goodie": "Este juego no parece ser instalable. Comprueba el contenido descargable en https://gog.com/account",
"goodie": "No se puede instalar"
},
"submenu": {
"addShortcut": "Añadir acceso directo",
Expand Down
27 changes: 20 additions & 7 deletions public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"title": "¡Ocurrió un error!"
},
"update": {
"title": "Error al actualizar"
"title": "Error al actualizar",
"message": "¡Algo ha ido mal con la actualización! Por favor, desinstala manualmente y vuelve a instalar HyperPlay."
},
"wine-not-found": {
"invalid": "The selected wine version was not found. Install it or select a different version in the game's settings{{newline}}Version: {{version}}{{newline}}Path: {{path}}",
Expand All @@ -76,7 +77,8 @@
"winetricks": {
"message": "Winetricks returned the following error during execution:{{newLine}}{{error}}",
"title": "Winetricks error"
}
},
"moving": "Error al Mover el Juego {{error}}"
},
"info": {
"update": {
Expand Down Expand Up @@ -139,10 +141,14 @@
"install": "Los servidores de Epic están teniendo una gran interrupción en este momento. ¡El juego no se puede instalar!",
"update": "Los servidores de Epic están teniendo una gran interrupción en este momento. ¡El juego no se puede actualizar!"
},
"title": "Advertencia"
"title": "Advertencia",
"wine-change": {
"message": "No hemos podido encontrar la versión de vino seleccionada para ejecutar este título ({{selectedWine}}). {{newline}} Hemos encontrado otra, ¿deseas continuar utilizando {{foundWine}}?"
}
},
"wineprefix": "Elige la ruta del prefijo de Wine",
"yes": ""
"yes": "",
"dontShowAgain": "No volver a mostrar"
},
"button": {
"cancel": "Cancel",
Expand Down Expand Up @@ -534,7 +540,8 @@
"steamruntime": "Usar Steam Runtime",
"winecrossoverbottle": "CrossOver Bottle",
"wineprefix": "Carpeta de Prefijo de Wine",
"wineversion": "Versión de Wine"
"wineversion": "Versión de Wine",
"disable_logs": "Desactivar los registros"
},
"settings": {
"battlEyeRuntime": {
Expand Down Expand Up @@ -586,7 +593,8 @@
"status": {
"installing": "Instalando",
"logging": "Iniciando sesión…",
"processing": "Procesando los archivos, por favor espere"
"processing": "Procesando los archivos, por favor espere",
"preparing_login": "Preparando el inicio de sesión... "
},
"store": "Tienda de Epic",
"stores": "Tiendas",
Expand Down Expand Up @@ -639,5 +647,10 @@
},
"release": "Fecha de lanzamiento",
"size": "Tamaño"
}
},
"accounts": "cuentas",
"Amazon": "Amazon",
"ALL": "TODO",
"analytics": "Análisis",
"Amazon Games": "Amazon Games"
}
2 changes: 1 addition & 1 deletion public/locales/pt/gamepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"cloud_save_unsupported": "Unsupported",
"disabled": "Desabilitado",
"dlc": {
"installDlcs": "Instalar todas as DLCs"
"installDlcs": "Instalar todos os DLCs"
},
"enabled": "Habilitado",
"game": {
Expand Down
68 changes: 63 additions & 5 deletions public/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@
"install": "Epic Servers are having major outage right now, the game cannot be installed!",
"update": "Epic Servers are having major outage right now, the game cannot be updated!"
},
"title": "Warning"
"title": "Warning",
"wine-change": {
"message": "Não foi possível encontrar a versão selecionada do Wine ({{selectedWine}}. {{newline}} Encontramos outra versão, deseja continuar usando {{foundWine}} ?",
"title": "Wine não encontrado!"
}
},
"wineprefix": "Escolha a pasta com o Prefixo Wine",
"yes": "SIM",
Expand All @@ -153,7 +157,9 @@
"login": "Entrar",
"sync": "Sincronizar",
"syncing": "Sincronizando",
"unsync": "Dessincronizar"
"unsync": "Dessincronizar",
"download": "Download",
"continue": "Continuar"
},
"controller": {
"hints": {
Expand Down Expand Up @@ -192,7 +198,8 @@
"start-time": "Started at",
"type": "Type"
},
"title": "Downloads"
"title": "Downloads",
"ETA": "Tempo Estimado"
},
"epic": {
"offline-notification-body": "Serviços online talvez não funcionem completamente enquanto os servidores Epic Games estão offline!",
Expand Down Expand Up @@ -264,7 +271,9 @@
"wine": {
"part1": "HyperPlay procura versões de Wine, Proton e CrossOver nas seguintes pastas:",
"part2": "Para outros lugares, crie um link simbólico até uma dessas pastas"
}
},
"disable_logs": "Habilitar essa opção faz com que a maioria dos registros (informações críticas) sejam desabilitadas. Desabilite essa opção antes de reportar erros no app.",
"dxvkfpslimit": "Limita o número de quadros em jogos que usam DXVK"
},
"info": {
"hyperplay": {
Expand Down Expand Up @@ -645,5 +654,54 @@
},
"analytics": "análise",
"accounts": "contas",
"ALL": "TUDO"
"ALL": "TUDO",
"externalLink": {
"dontAskAgain": "Não perguntar novamente",
"warning": "Isso abrirá um link externo."
},
"dlc": {
"installDlcs": "Instalar todos os DLCs",
"actions": "Ações",
"size": "Tamanho",
"title": "Título",
"noDlcFound": "Nenhum DLC encontrado"
},
"hyperplay": {
"accesscodes": {
"success": {
"validation": "Sucesso! Código de acesso válido"
},
"error": {
"validation": "Código de Acesso Inválido"
}
},
"onboarding": {
"analytics": {
"anonymized": "Enviar clicks anônimos e interações com games;",
"body": "HyperPlay gostaria de coletar dados afim de entender como nossos usuário interagem com a aplicação. Essa informação nos ajuda a entender como o o app é utilizado e a deixar o app ainda melhor para você."
}
},
"buttons": {
"noThanks": "Não, Obrigado",
"agree": "Eu concordo"
},
"analyticsOff": "A análise de dados está desligada",
"misc": "Nunca",
"currentWallet": "Carteira Atual",
"changeWallet": "Trocar Carteira",
"analyticsOn": "A análise de dados está ligada",
"copyUrl": "Copiar URL",
"discordApp": "Discord"
},
"gameRelease": {
"prototype": "Protótipo",
"demo": "Demo",
"beta": "Beta",
"alpha": "Alpha",
"main": "Estável"
},
"dlcs": {
"label": "Selecione os DLCs para instalar:"
},
"exit_game": "Sair do Jogo"
}
4 changes: 2 additions & 2 deletions src/backend/api/downloadmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ export const cancelDownload = (removeDownloaded: boolean) =>
export const resumeCurrentDownload = () =>
ipcRenderer.send('resumeCurrentDownload')

export const pauseCurrentDownload = () =>
ipcRenderer.send('pauseCurrentDownload')
export const pauseCurrentDownload = async () =>
ipcRenderer.invoke('pauseCurrentDownload')
2 changes: 1 addition & 1 deletion src/backend/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const wikiLink = 'https://github.com/G7DAO/HyperPlay/wiki'
const weblateUrl =
'https://hosted.weblate.org/projects/hyperplay-games-launcher'
const wineprefixFAQ = 'https://wiki.winehq.org/FAQ#Wineprefixes'
const hyperplaySite = 'https://docs.hyperplaygaming.com/faq'
const hyperplaySite = 'https://docs.hyperplay.xyz/faq'
const customThemesWikiLink =
'https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/wiki/Custom-Themes'
const eventsToCloseMetaMaskPopupOn = [
Expand Down
18 changes: 8 additions & 10 deletions src/backend/downloadmanager/downloadqueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { notify } from '../dialog/dialog'
import i18next from 'i18next'
import { configFolder } from 'backend/constants'
import { join } from 'path'
import { rmSync } from 'graceful-fs'
import { clean } from 'hp-easydl/dist/utils'

const downloadManager = new TypeCheckedStoreBackend('downloadManager', {
cwd: 'store',
Expand Down Expand Up @@ -203,8 +201,9 @@ function cancelCurrentDownload({ removeDownloaded = false }) {
}
removeFromQueue(currentElement.params.appName)

if (removeDownloaded) {
const { appName, runner, gameInfo, channelName } = currentElement!.params
const { runner } = currentElement!.params
if (runner === 'hyperplay' && removeDownloaded) {
const { appName, gameInfo, channelName } = currentElement!.params
const { folder_name } = gameInfo
if (gameInfo.channels === undefined || channelName === undefined) {
console.error(
Expand All @@ -214,12 +213,10 @@ function cancelCurrentDownload({ removeDownloaded = false }) {
}
const releaseMeta = gameInfo.channels[channelName].release_meta

if (runner === 'hyperplay' && releaseMeta) {
if (releaseMeta) {
const tempfolder = join(configFolder, 'hyperplay', '.temp', appName)
logInfo(`Removing ${tempfolder}...`, LogPrefix.DownloadManager)
clean(tempfolder).finally(() => {
rmSync(tempfolder, { recursive: true, force: true })
})
callAbortController(appName)
} else if (folder_name) {
removeFolder(currentElement.params.path, folder_name)
}
Expand All @@ -228,9 +225,10 @@ function cancelCurrentDownload({ removeDownloaded = false }) {
}
}

function pauseCurrentDownload() {
async function pauseCurrentDownload() {
if (currentElement) {
stopCurrentDownload()
const { appName, runner } = currentElement.params
await gameManagerMap[runner].pause(appName)
}
queueState = 'paused'
sendFrontendMessage(
Expand Down
4 changes: 1 addition & 3 deletions src/backend/downloadmanager/ipc_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ ipcMain.on('resumeCurrentDownload', () => {
resumeCurrentDownload()
})

ipcMain.on('pauseCurrentDownload', () => {
pauseCurrentDownload()
})
ipcMain.handle('pauseCurrentDownload', async () => pauseCurrentDownload())

ipcMain.on('cancelDownload', (e, removeDownloaded) => {
cancelCurrentDownload({ removeDownloaded })
Expand Down
Loading

0 comments on commit f619140

Please sign in to comment.