Skip to content

Commit

Permalink
Add steamhunters logoAppId
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Nov 21, 2024
1 parent 9c21d65 commit c66746b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions scripts/community/achievements.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ function InitAchievements( items, isPersonal )
gameGroup.append( summary );

const dlcAppId = update.dlcAppId || appid;
const logoAppId = update.logoAppId || dlcAppId;

const summaryGameLogo = document.createElement( 'a' );
summaryGameLogo.className = 'steamdb_achievements_game_logo_contain';
Expand All @@ -819,9 +820,9 @@ function InitAchievements( items, isPersonal )
{
summaryGameLogo.style.viewTransitionName = 'steamdb-gamelogo';
}
else if( dlcAppId !== appid )
else if( logoAppId !== appid )
{
summaryGameLogoImg.dataset.appid = dlcAppId;
summaryGameLogoImg.dataset.appid = logoAppId;
}

const summaryName = document.createElement( 'div' );
Expand Down Expand Up @@ -1078,20 +1079,23 @@ async function FetchDlcCapsules( applicationConfig, appid, achievementUpdates )

for( const update of achievementUpdates )
{
if( update.dlcAppId && update.dlcAppId !== appid && !uniqueAppIds.has( update.dlcAppId ) )
const dlcAppId = update.dlcAppId;
const logoAppId = update.logoAppId || dlcAppId;

if( logoAppId && logoAppId !== appid && !uniqueAppIds.has( logoAppId ) )
{
uniqueAppIds.add( update.dlcAppId );
uniqueAppIds.add( logoAppId );

const knownCapsule = SessionStorageGet( `steamdb_capsule_${update.dlcAppId}` );
const knownCapsule = SessionStorageGet( `steamdb_capsule_${logoAppId}` );

if( knownCapsule )
{
images.set( update.dlcAppId, knownCapsule );
images.set( logoAppId, knownCapsule );
continue;
}

dlcAppIds.push( {
appid: update.dlcAppId
appid: logoAppId
} );
}
}
Expand Down

0 comments on commit c66746b

Please sign in to comment.