Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Nov 8, 2024
2 parents 0cb020f + 8d860f4 commit 411e3d9
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 85 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"@hyperplay/check-disk-space": "^3.5.2",
"@hyperplay/quests-ui": "^0.0.28",
"@hyperplay/ui": "^1.8.9",
"@hyperplay/utils": "^0.3.3",
"@hyperplay/utils": "^0.3.4",
"@mantine/carousel": "^7.12.0",
"@mantine/core": "^7.12.0",
"@mantine/dropzone": "^7.12.0",
Expand Down
5 changes: 4 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,6 @@
"retrying": "Retrying"
},
"On first launch Steam will download the necessary files and will take a few minutes to finish and the login screen to appear;": "On first launch Steam will download the necessary files and will take a few minutes to finish and the login screen to appear;",
"Open": "Open",
"options": {
"advanced": {
"key": "Variable Name",
Expand Down Expand Up @@ -806,9 +805,13 @@
"finished": "Nothing downloaded",
"queue": "Nothing to download"
},
"launch": "Launch Game",
"pause": "Pause download",
"remove": "Remove from Downloads",
"resume": "Resume download",
"retry-install": "Retry Install",
"retry-update": "Retry Update",
"stop": "Stop Download",
"timeElapsed": "Time Elapsed: {{elapsed}}"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import libraryState from 'frontend/state/libraryState'
import { hasStatus } from 'frontend/hooks/hasStatus'
import { Images } from '@hyperplay/ui'
import styles from './index.module.scss'
const { PauseIcon, PlayIcon, XCircle, DownloadIcon } = Images
const { PauseIcon, PlayIcon, XCircle, DownloadIcon, Refresh } = Images

type Props = {
element?: DMQueueElement
Expand Down Expand Up @@ -130,6 +130,7 @@ const DownloadManagerItem = observer(({ element, current, state }: Props) => {
const finished = status === 'done'
const canceled = status === 'error' || (status === 'abort' && !current)
const isExtracting = gameProgressStatus === 'extracting'
const isUpdate = type === 'update'
const isPatching = gameProgressStatus === 'patching'

const goToGamePage = (action?: GamePageActions) => {
Expand All @@ -144,7 +145,15 @@ const DownloadManagerItem = observer(({ element, current, state }: Props) => {
// using one element for the different states so it doesn't
// lose focus from the button when using a game controller
const handleMainActionClick = async () => {
const action = finished ? 'launch' : 'install'
let action: GamePageActions | undefined = 'launch'
if (!finished) {
if (isUpdate) {
action = 'update'
} else {
action = 'install'
}
}

if (finished || canceled) {
return goToGamePage(action)
}
Expand Down Expand Up @@ -174,6 +183,9 @@ const DownloadManagerItem = observer(({ element, current, state }: Props) => {
}

if (canceled) {
if (isUpdate) {
return <Refresh className={styles.downloadIcon} />
}
return <DownloadIcon className={styles.downloadIcon} />
}

Expand Down Expand Up @@ -205,11 +217,18 @@ const DownloadManagerItem = observer(({ element, current, state }: Props) => {
const mainIconTitle = () => {
const { status } = element
if (status === 'done' || status === 'error') {
return t('Open')
return t('queue.label.launch', 'Launch Game')
}

if (canceled) {
if (isUpdate) {
return t('queue.label.retry-update', 'Retry Update')
}
return t('queue.label.retry-install', 'Retry Install')
}

return current
? t('button.cancel', 'Cancel')
? t('queue.label.stop', 'Stop Download')
: t('queue.label.remove', 'Remove from Downloads')
}

Expand Down
24 changes: 15 additions & 9 deletions src/frontend/screens/Game/GamePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,25 @@ export default observer(function GamePage(): JSX.Element | null {

const hasRun = useRef(false)
useEffect(() => {
if (!action || hasRun.current) return
hasRun.current = true
const mainAction = async () => {
if (!action || hasRun.current) return
hasRun.current = true

if (action === 'install') {
return setShowModal({ game: appName, show: true })
}
if (action === 'launch') {
if (isBrowserGame || gameInfo.is_installed) {
handlePlay()()
} else {
if (action === 'update') {
return updateGame(gameInfo)
}
if (action === 'install') {
return setShowModal({ game: appName, show: true })
}
if (action === 'launch') {
if (isBrowserGame || gameInfo.is_installed) {
handlePlay()()
} else {
return setShowModal({ game: appName, show: true })
}
}
}
mainAction()
}, [action])

// Track the screen view once each time the appName, gameInfo or runner changes
Expand Down
83 changes: 13 additions & 70 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz#31ab07ca6a06358c5de4d295d4711b675006163f"
integrity sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw==

"@fortawesome/fontawesome-svg-core@^6.1.1", "@fortawesome/fontawesome-svg-core@^6.4.0":
"@fortawesome/fontawesome-svg-core@^6.1.1":
version "6.6.0"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz#2a24c32ef92136e98eae2ff334a27145188295ff"
integrity sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg==
Expand All @@ -1172,21 +1172,21 @@
dependencies:
"@fortawesome/fontawesome-common-types" "6.6.0"

"@fortawesome/free-regular-svg-icons@^6.4.0", "@fortawesome/free-regular-svg-icons@^6.6.0":
"@fortawesome/free-regular-svg-icons@^6.6.0":
version "6.6.0"
resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz#fc49a947ac8dfd20403c9ea5f37f0919425bdf04"
integrity sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ==
dependencies:
"@fortawesome/fontawesome-common-types" "6.6.0"

"@fortawesome/free-solid-svg-icons@^6.4.0", "@fortawesome/free-solid-svg-icons@^6.6.0":
"@fortawesome/free-solid-svg-icons@^6.6.0":
version "6.6.0"
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz#061751ca43be4c4d814f0adbda8f006164ec9f3b"
integrity sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA==
dependencies:
"@fortawesome/fontawesome-common-types" "6.6.0"

"@fortawesome/react-fontawesome@^0.2.0", "@fortawesome/react-fontawesome@^0.2.2":
"@fortawesome/react-fontawesome@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz#68b058f9132b46c8599875f6a636dad231af78d4"
integrity sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g==
Expand Down Expand Up @@ -1240,13 +1240,6 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3"
integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==

"@hyperplay/chains@^0.2.9":
version "0.2.10"
resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.2.10.tgz#6c9d4e175146d79e4556039db487c182d60c533d"
integrity sha512-TUe9vJo9jXx23pb5QlGuW6xo6JmXYjqXKJSma//aUPZ99HU8I/lATlyqdXwozPfQ2qGsAYn58FCTo2kbF+J+8w==
dependencies:
axios "^1.4.0"

"@hyperplay/chains@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.3.0.tgz#f0cc73e1fde33678328249e40bf0d02bccd14625"
Expand Down Expand Up @@ -1358,10 +1351,10 @@
dependencies:
bignumber.js "^9.1.2"

"@hyperplay/utils@^0.3.1":
version "0.3.3"
resolved "https://registry.yarnpkg.com/@hyperplay/utils/-/utils-0.3.3.tgz#9d594a29012ae5a172138878208d6d4edb6412f2"
integrity sha512-t8XB7oFWJU4S1ULxVBURt9BhpgaZAq5C131Ch5wShxuMTjxxGEhTAAcppsH+VYd7lwtp4se9myzhc6u21rUNgQ==
"@hyperplay/utils@^0.3.4":
version "0.3.4"
resolved "https://registry.yarnpkg.com/@hyperplay/utils/-/utils-0.3.4.tgz#71d4abe910ec8550c865418118eb1c07df3b399d"
integrity sha512-ndkDnp+iV9BlLCKpbq0XVuuc/ORzaZ+69wFvVvAftdU6mbwbk4EfxAwTOpmXWkLaiGp0MZaybYMa5zYZkxkW5w==
dependencies:
bignumber.js "^9.1.2"

Expand Down Expand Up @@ -3000,19 +2993,6 @@
dependencies:
defer-to-connect "^2.0.0"

"@tabler/icons-react@^2.46.0":
version "2.47.0"
resolved "https://registry.yarnpkg.com/@tabler/icons-react/-/icons-react-2.47.0.tgz#b704e7ae98f95be8bd6e938b4b2e84cd20b0cf31"
integrity sha512-iqly2FvCF/qUbgmvS8E40rVeYY7laltc5GUjRxQj59DuX0x/6CpKHTXt86YlI2whg4czvd/c8Ce8YR08uEku0g==
dependencies:
"@tabler/icons" "2.47.0"
prop-types "^15.7.2"

"@tabler/[email protected]":
version "2.47.0"
resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-2.47.0.tgz#c41c680d1947e3ab2d60af3febc4132287c60596"
integrity sha512-4w5evLh+7FUUiA1GucvGj2ReX2TvOjEr4ejXdwL/bsjoSkof6r1gQmzqI+VHrE2CpJpB3al7bCTulOkFa/RcyA==

"@tanstack/[email protected]":
version "5.52.2"
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.52.2.tgz#a023864a892fda9858b724d667eb19cd84ce054a"
Expand Down Expand Up @@ -3791,7 +3771,7 @@
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==

"@valist/sdk@^2.10.5", "@valist/sdk@^2.9.1":
"@valist/sdk@^2.10.5":
version "2.10.5"
resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.10.5.tgz#e43cafc101d42097c6191ae2ac0f426b62603520"
integrity sha512-2m95VJfljJQXaSUfqfVwfHsaVcgynY4yy6wKjIsACYgiKkzck2XqjyAOtLhRESyzvuNvBA/ypj0mP+JxdmCtOw==
Expand Down Expand Up @@ -7098,13 +7078,6 @@ eth-rpc-errors@^4.0.2, eth-rpc-errors@^4.0.3:
dependencies:
fast-safe-stringify "^2.0.6"

ethereum-blockies-base64@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/ethereum-blockies-base64/-/ethereum-blockies-base64-1.0.2.tgz#4aebca52142bf4d16a3144e6e2b59303e39ed2b3"
integrity sha512-Vg2HTm7slcWNKaRhCUl/L3b4KrB8ohQXdd5Pu3OI897EcR6tVRvUqdTwAyx+dnmoDzj8e2bwBLDQ50ByFmcz6w==
dependencies:
pnglib "0.0.1"

ethereum-cryptography@^2.0.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf"
Expand Down Expand Up @@ -11324,11 +11297,6 @@ pngjs@^5.0.0:
resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb"
integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==

[email protected]:
version "0.0.1"
resolved "https://registry.yarnpkg.com/pnglib/-/pnglib-0.0.1.tgz#f9ab6f9c688f4a9d579ad8be28878a716e30c096"
integrity sha512-95ChzOoYLOPIyVmL+Y6X+abKGXUJlvOVLkB1QQkyXl7Uczc6FElUy/x01NS7r2GX6GRezloO/ecCX9h4U9KadA==

pony-cause@^2.1.10:
version "2.1.11"
resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.11.tgz#d69a20aaccdb3bdb8f74dd59e5c68d8e6772e4bd"
Expand Down Expand Up @@ -11478,7 +11446,7 @@ prompts@^2.0.1:
kleur "^3.0.3"
sisteransi "^1.0.5"

prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1:
prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
Expand Down Expand Up @@ -12755,16 +12723,7 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -12858,14 +12817,7 @@ stringify-entities@^4.0.0:
character-entities-html4 "^2.0.0"
character-entities-legacy "^3.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -14120,7 +14072,7 @@ word-wrap@^1.2.5:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -14138,15 +14090,6 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit 411e3d9

Please sign in to comment.