|
14 | 14 | GetOption( { |
15 | 15 | 'button-app': true, |
16 | 16 | 'button-pcgw': true, |
| 17 | + 'button-protondb': true, |
17 | 18 | 'link-subid': true, |
18 | 19 | 'online-stats': true, |
19 | 20 | 'steamdb-lowest-price': true, |
@@ -185,6 +186,64 @@ else |
185 | 186 | } |
186 | 187 | } |
187 | 188 |
|
| 189 | + if( items[ 'button-protondb' ] ) |
| 190 | + { |
| 191 | + let container = document.querySelector( '.apphub_OtherSiteInfo' ); |
| 192 | + |
| 193 | + if( !container ) |
| 194 | + { |
| 195 | + // Steam China has no community hub |
| 196 | + const headerStandardTop = document.querySelector( '.apphub_HeaderStandardTop' ); |
| 197 | + |
| 198 | + if( headerStandardTop ) |
| 199 | + { |
| 200 | + container = document.createElement( 'div' ); |
| 201 | + container.className = 'apphub_OtherSiteInfo'; |
| 202 | + headerStandardTop.prepend( container ); |
| 203 | + } |
| 204 | + } |
| 205 | + |
| 206 | + if( container ) |
| 207 | + { |
| 208 | + const link = document.createElement( 'a' ); |
| 209 | + link.className = 'btnv6_blue_hoverfade btn_medium btn_steamdb'; |
| 210 | + link.href = 'https://www.protondb.com/app/' + GetCurrentAppID() + '?utm_source=SteamDB'; |
| 211 | + |
| 212 | + const element = document.createElement( 'span' ); |
| 213 | + element.dataset.tooltipText = _t( 'view_on_protondb' ); |
| 214 | + link.appendChild( element ); |
| 215 | + |
| 216 | + const image = document.createElement( 'img' ); |
| 217 | + image.className = 'ico16'; |
| 218 | + image.src = GetLocalResource( 'icons/protondb.svg' ); |
| 219 | + |
| 220 | + element.appendChild( image ); |
| 221 | + |
| 222 | + container.insertBefore( link, container.firstChild ); |
| 223 | + container.insertBefore( document.createTextNode( ' ' ), link.nextSibling ); |
| 224 | + } |
| 225 | + |
| 226 | + const lastLinkBar = document.querySelector( '#appDetailsUnderlinedLinks .linkbar:last-child' ); |
| 227 | + |
| 228 | + if( lastLinkBar ) |
| 229 | + { |
| 230 | + const link = document.createElement( 'a' ); |
| 231 | + link.className = 'linkbar linkbar_steamdb'; |
| 232 | + link.href = 'https://www.protondb.com/app/' + GetCurrentAppID() + '?utm_source=SteamDB'; |
| 233 | + |
| 234 | + const image = document.createElement( 'img' ); |
| 235 | + image.src = GetLocalResource( 'icons/protondb.svg' ); |
| 236 | + link.append( image ); |
| 237 | + |
| 238 | + const span = document.createElement( 'span' ); |
| 239 | + span.className = 'social_account'; |
| 240 | + span.textContent = _t( 'view_on_protondb' ); |
| 241 | + link.append( span ); |
| 242 | + |
| 243 | + lastLinkBar.insertAdjacentElement( 'afterend', link ); |
| 244 | + } |
| 245 | + } |
| 246 | + |
188 | 247 | if( items[ 'link-subid' ] ) |
189 | 248 | { |
190 | 249 | // Find each "add to cart" button |
|
0 commit comments