Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
"view_on_pcgamingwiki": {
"message": "View on PCGamingWiki"
},
"view_on_protondb": {
"message": "View on ProtonDB"
},
"view_your_achievements": {
"message": "Personal achievements"
},
Expand Down Expand Up @@ -553,6 +556,9 @@
"options_button_pcgw": {
"message": "Display PCGamingWiki button on product pages"
},
"options_button_protondb": {
"message": "Display ProtonDB button on product pages"
},
"options_button_sub": {
"message": "Display a button on package pages"
},
Expand Down
6 changes: 6 additions & 0 deletions _locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"view_on_pcgamingwiki": {
"message": "Voir sur PCGamingWiki"
},
"view_on_protondb": {
"message": "Voir sur ProtonDB"
},
"view_your_achievements": {
"message": "Succès personnels"
},
Expand Down Expand Up @@ -531,6 +534,9 @@
"options_button_pcgw": {
"message": "Afficher le bouton PCGamingWiki sur les pages des produits"
},
"options_button_protondb": {
"message": "Afficher le bouton ProtonDB sur les pages des produits"
},
"options_button_sub": {
"message": "Afficher un bouton sur les pages des packages"
},
Expand Down
42 changes: 42 additions & 0 deletions icons/protondb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

"icons/white.svg",
"icons/pcgamingwiki.svg",
"icons/protondb.svg",
"icons/steamhunters.svg",
"icons/image.svg",
"icons/achievements_completed.svg",
Expand Down
4 changes: 4 additions & 0 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ <h3 data-msg="options_header_buttons_and_links"></h3>
<input type="checkbox" class="option-check" data-option="button-pcgw" checked>
<div data-msg="options_button_pcgw"></div>
</label>
<label class="checkbox">
<input type="checkbox" class="option-check" data-option="button-protondb" checked>
<div data-msg="options_button_protondb"></div>
</label>
<label class="checkbox">
<input type="checkbox" class="option-check" data-option="button-sub" checked>
<div data-msg="options_button_sub"></div>
Expand Down
30 changes: 30 additions & 0 deletions scripts/community/gamehub.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
GetOption( {
'button-gamehub': true,
'button-pcgw': true,
'button-protondb': true,
}, ( items ) =>
{
const container = document.querySelector( '.apphub_OtherSiteInfo' );
Expand Down Expand Up @@ -93,5 +94,34 @@ GetOption( {
responsiveMenu.append( link.cloneNode( true ) );
}
}

if( items[ 'button-protondb' ] )
{
const link = document.createElement( 'a' );
link.className = 'btnv6_blue_hoverfade btn_medium btn_steamdb';
link.href = 'https://www.protondb.com/app/' + GetCurrentAppID() + '?utm_source=SteamDB';

const element = document.createElement( 'span' );
element.dataset.tooltipText = _t( 'view_on_protondb' );
link.appendChild( element );

const image = document.createElement( 'img' );
image.className = 'ico16';
image.src = GetLocalResource( 'icons/protondb.svg' );

element.appendChild( image );

container.insertBefore( link, container.firstChild );

container.insertBefore( document.createTextNode( ' ' ), link.nextSibling );

const responsiveMenu = document.querySelector( '.apphub_ResponsiveMenuCtn' );

if( responsiveMenu )
{
responsiveMenu.append( document.createTextNode( ' ' ) );
responsiveMenu.append( link.cloneNode( true ) );
}
}
}
} );
59 changes: 59 additions & 0 deletions scripts/store/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ else
GetOption( {
'button-app': true,
'button-pcgw': true,
'button-protondb': true,
'link-subid': true,
'online-stats': true,
'steamdb-lowest-price': true,
Expand Down Expand Up @@ -185,6 +186,64 @@ else
}
}

if( items[ 'button-protondb' ] )
{
let container = document.querySelector( '.apphub_OtherSiteInfo' );

if( !container )
{
// Steam China has no community hub
const headerStandardTop = document.querySelector( '.apphub_HeaderStandardTop' );

if( headerStandardTop )
{
container = document.createElement( 'div' );
container.className = 'apphub_OtherSiteInfo';
headerStandardTop.prepend( container );
}
}

if( container )
{
const link = document.createElement( 'a' );
link.className = 'btnv6_blue_hoverfade btn_medium btn_steamdb';
link.href = 'https://www.protondb.com/app/' + GetCurrentAppID() + '?utm_source=SteamDB';

const element = document.createElement( 'span' );
element.dataset.tooltipText = _t( 'view_on_protondb' );
link.appendChild( element );

const image = document.createElement( 'img' );
image.className = 'ico16';
image.src = GetLocalResource( 'icons/protondb.svg' );

element.appendChild( image );

container.insertBefore( link, container.firstChild );
container.insertBefore( document.createTextNode( ' ' ), link.nextSibling );
}

const lastLinkBar = document.querySelector( '#appDetailsUnderlinedLinks .linkbar:last-child' );

if( lastLinkBar )
{
const link = document.createElement( 'a' );
link.className = 'linkbar linkbar_steamdb';
link.href = 'https://www.protondb.com/app/' + GetCurrentAppID() + '?utm_source=SteamDB';

const image = document.createElement( 'img' );
image.src = GetLocalResource( 'icons/protondb.svg' );
link.append( image );

const span = document.createElement( 'span' );
span.className = 'social_account';
span.textContent = _t( 'view_on_protondb' );
link.append( span );

lastLinkBar.insertAdjacentElement( 'afterend', link );
}
}

if( items[ 'link-subid' ] )
{
// Find each "add to cart" button
Expand Down