Skip to content

Commit

Permalink
[Other]: Sync latest stable changes with main (#2269)
Browse files Browse the repository at this point in the history
* [Download Manager] Some images fixes (#2267)

Some fixes for download manager images

* [Fix] Prevent default settings env variables corruption (#2262)

Copy env variables instead of using array reference

* [Fix] Ignore remove from steam notification only if no errors (#2260)

Move condition after checking errors when removing from steam

* [OTHER] Stop logging all controller interactions (#2261)

Stop logging controller buttons

* [FIX] Game status detection when uninstalling/running games (#2257)

Better game status updates

* [Tech] Update GOGDL to v0.6 (#2276)

* [Tech] Only parse english on `yarn i18n` (#2271)

* Only parse english on i18n

* prettier fix

* Review suggestions

Co-authored-by: Ariel Juodziukynas <[email protected]>
Co-authored-by: Flávio F Lima <[email protected]>
Co-authored-by: Niklas <[email protected]>
  • Loading branch information
4 people authored Dec 30, 2022
1 parent a4754d6 commit d9f46f1
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 74 deletions.
42 changes: 1 addition & 41 deletions i18next-parser.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,47 +53,7 @@ module.exports = {
lineEnding: 'auto',
// Control the line ending. See options at https://github.com/ryanve/eol

locales: [
'ar',
'az',
'be',
'bg',
'bs',
'ca',
'cs',
'de',
'el',
'en',
'es',
'et',
'eu',
'fa',
'fi',
'fr',
'gl',
'hr',
'hu',
'ja',
'ko',
'id',
'it',
'ml',
'nb_NO',
'nl',
'pl',
'pt',
'pt_BR',
'ro',
'ru',
'sk',
'sv',
'ta',
'tr',
'uk',
'vi',
'zh_Hans',
'zh_Hant'
],
locales: ['en'],
// An array of the locales in your applications

namespaceSeparator: ':',
Expand Down
Binary file modified public/bin/darwin/gogdl
Binary file not shown.
Binary file modified public/bin/linux/gogdl
Binary file not shown.
Binary file modified public/bin/win32/gogdl.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/backend/game_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class GameConfigV0 extends GameConfig {
launcherArgs,
nvidiaPrime,
offlineMode,
enviromentOptions: enviromentOptions,
enviromentOptions: [...enviromentOptions],
wrapperOptions,
savesPath,
showFps,
Expand Down
2 changes: 2 additions & 0 deletions src/backend/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ if (!gotTheLock) {
loadPath: path.join(publicDir, 'locales', '{{lng}}', '{{ns}}.json')
},
debug: false,
returnEmptyString: false,
returnNull: false,
fallbackLng: 'en',
lng: language,
supportedLngs: [
Expand Down
12 changes: 6 additions & 6 deletions src/backend/shortcuts/nonesteamgame/nonesteamgame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,13 @@ async function removeNonSteamGame(props: {
})
}

// game was not on any steam shortcut
// nothing to notify
if (!removed) {
return
}

if (errors.length === 0) {
// game was not on any steam shortcut
// nothing to notify
if (!removed) {
return
}

logInfo(`${props.gameInfo.title} was successfully removed from Steam.`, {
prefix: LogPrefix.Shortcuts
})
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/components/UI/UninstallModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface UninstallModalProps {
}

const UninstallModal: React.FC<UninstallModalProps> = function (props) {
const { platform } = useContext(ContextProvider)
const { platform, refreshLibrary } = useContext(ContextProvider)
const [isWindowsOnLinux, setIsWindowsOnLinux] = useState(false)
const [winePrefix, setWinePrefix] = useState('')
const [checkboxChecked, setCheckboxChecked] = useState(false)
Expand Down Expand Up @@ -73,6 +73,7 @@ const UninstallModal: React.FC<UninstallModalProps> = function (props) {
navigate('/')
}
storage.removeItem(props.appName)
refreshLibrary({ fullRefresh: true, checkForUpdates: false })
}

return (
Expand Down
40 changes: 20 additions & 20 deletions src/frontend/helpers/gamepad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const initGamepad = () => {
}

if (!wasActive || shouldRepeat) {
console.log(`Action: ${action}`)
// console.log(`Action: ${action}`)

// set last triggeredAt timestamp, used for repeater
data.triggeredAt[controllerIndex] = now
Expand Down Expand Up @@ -307,7 +307,7 @@ export const initGamepad = () => {
const controller = gamepads[index]
if (!controller) return

logState(index)
// logState(index)

const buttons = controller.buttons
const axes = controller.axes
Expand All @@ -334,24 +334,24 @@ export const initGamepad = () => {
requestAnimationFrame(updateStatus)
}

function logState(index: number) {
const controller = navigator.getGamepads()[index]
if (!controller) return

const buttons = controller.buttons
const axes = controller.axes

for (const button in buttons) {
if (buttons[button].pressed)
console.log(`button ${button} pressed ${buttons[button].value}`)
}
for (const axis in axes) {
if (axes[axis] < -0.2 && axes[axis] >= -1)
console.log(`axis ${axis} activated negative`)
if (axes[axis] > 0.2 && axes[axis] <= 1)
console.log(`axis ${axis} activated positive`)
}
}
// function logState(index: number) {
// const controller = navigator.getGamepads()[index]
// if (!controller) return

// const buttons = controller.buttons
// const axes = controller.axes

// for (const button in buttons) {
// if (buttons[button].pressed)
// console.log(`button ${button} pressed ${buttons[button].value}`)
// }
// for (const axis in axes) {
// if (axes[axis] < -0.2 && axes[axis] >= -1)
// console.log(`axis ${axis} activated negative`)
// if (axes[axis] > 0.2 && axes[axis] <= 1)
// console.log(`axis ${axis} activated positive`)
// }
// }

function connecthandler(e: GamepadEvent) {
addgamepad(e.gamepad)
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ i18next
// learn more: https://github.com/i18next/i18next-browser-languageDetector
.use(initReactI18next)
.init({
returnEmptyString: false,
returnNull: false,
fallbackLng: 'en',
interpolation: {
escapeValue: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,8 @@
.downloadManagerListItem span:nth-child(3) {
text-transform: capitalize;
}

.downloadManagerTitleList > img {
aspect-ratio: 16/9;
object-fit: cover;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const DownloadManagerItem = ({ element, current }: Props) => {
}
}
getNewInfo()
}, [])
}, [element])

const { art_cover, art_square } = gameInfo || {}

Expand Down
8 changes: 6 additions & 2 deletions src/frontend/screens/DownloadManager/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ export default React.memo(function DownloadManager(): JSX.Element | null {
<div className="dmItemList">
<DownloadManagerHeader time="queued" />
{plannendElements.length > 0 ? (
plannendElements.map((el, key) => (
<DownloadManagerItem key={key} element={el} current={false} />
plannendElements.map((el) => (
<DownloadManagerItem
key={el.params.appName}
element={el}
current={false}
/>
))
) : (
<DownloadManagerItem current={false} />
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/screens/Library/components/GameCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const GameCard = ({
cloud_save_enabled: hasCloudSave,
install: gameInstallInfo,
thirdPartyManagedApp
} = gameInfo
} = gameInfoFromProps

// if the game supports cloud saves, check the config
const [autoSyncSaves, setAutoSyncSaves] = useState(hasCloudSave)
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/state/GlobalState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ export class GlobalState extends PureComponent<Props> {
}

// if the app is done installing or errored
if (['error', 'done'].includes(status)) {
if (['error', 'done', 'playing'].includes(status)) {
// if the app was updating, remove from the available game updates
newLibraryStatus = libraryStatus.filter(
(game) => game.appName !== appName
Expand Down

0 comments on commit d9f46f1

Please sign in to comment.