Skip to content

Commit

Permalink
fix: grids now get applied correctly for manual games
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Sep 22, 2024
1 parent 7badecb commit e69f41a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/core/games/GameEntry.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
$: isHidden = $hiddenGameIds.includes(game.appid);
$: originalLogoPos = $originalLogoPositions[game.appid]?.logoPosition;
$: steamLogoPos = $steamLogoPositions[game.appid]?.logoPosition;
$: canDiscard = (($currentPlatform === Platforms.STEAM && $appLibraryCache[game.appid]) ? $appLibraryCache[game.appid][$gridType] !== $originalAppLibraryCache[game.appid][$gridType] : false)
|| (steamLogoPos ? (steamLogoPos.nHeightPct !== originalLogoPos?.nHeightPct || steamLogoPos.nWidthPct !== originalLogoPos?.nWidthPct || steamLogoPos.pinnedPosition !== originalLogoPos?.pinnedPosition) : false);
$: hasCustomArt = ($currentPlatform === Platforms.STEAM && $unfilteredLibraryCache[game.appid]) ? $appLibraryCache[game.appid][$gridType] !== $unfilteredLibraryCache[game.appid][$gridType] : false;
$: hasCustomName = !!$customGameNames[game.appid];
$: gridChanged = ($currentPlatform === Platforms.STEAM && $appLibraryCache[game.appid]) ?
(!!$appLibraryCache[game.appid] && !$originalAppLibraryCache[game.appid]) || ($appLibraryCache[game.appid][$gridType] !== $originalAppLibraryCache[game.appid][$gridType]) :
false;
$: logoPosChanged = steamLogoPos ? (steamLogoPos.nHeightPct !== originalLogoPos?.nHeightPct || steamLogoPos.nWidthPct !== originalLogoPos?.nWidthPct || steamLogoPos.pinnedPosition !== originalLogoPos?.pinnedPosition) : false;
$: canDiscard = gridChanged || logoPosChanged;
/**
* Selects this game.
Expand Down Expand Up @@ -78,8 +82,8 @@
showImage = true;
const unfiltered = $unfilteredLibraryCache[game.appid.toString()];
const unfilteredCache = unfiltered[type];
const unfilteredCacheIcon = unfiltered.Icon;
const unfilteredCache = unfiltered ? unfiltered[type] : null;
const unfilteredCacheIcon = unfiltered ? unfiltered.Icon : null;
const filteredCacheIcon = libraryCache[game.appid.toString()].Icon;
if (filteredCache === "REMOVE") {
Expand All @@ -91,6 +95,9 @@
}
showIcon = !!libraryCache[game.appid].Icon;
} else {
imagePath = "";
iconPath = "";
}
}
Expand Down

0 comments on commit e69f41a

Please sign in to comment.