11import { FloatElement } from '../custom' ;
22import { CustomElement , InjectBefore , InjectionMode } from '../injectors' ;
3- import { css , html , HTMLTemplateResult } from 'lit' ;
3+ import { css , html , HTMLTemplateResult , nothing } from 'lit' ;
4+ import { state } from 'lit/decorators.js' ;
45import '../common/ui/steam-button' ;
56import './page_size' ;
67import './sort_listings' ;
78import '../filter/filter_container' ;
9+ import { Observe } from '../../utils/observers' ;
10+ import { isBuggedSkin } from '../../utils/skin' ;
11+ import { AppId , ContextId } from '../../types/steam_constants' ;
812
913@CustomElement ( )
1014@InjectBefore ( '#searchResultsRows' , InjectionMode . ONCE )
1115export class UtilityBelt extends FloatElement {
16+ @state ( )
17+ private buggedSkinCount = 0 ;
18+
1219 get marketHashName ( ) : string {
1320 return ( document . querySelector ( '.market_listing_nav a:nth-child(2)' ) as HTMLElement ) . innerText ;
1421 }
@@ -31,6 +38,16 @@ export class UtilityBelt extends FloatElement {
3138 text-decoration: underline;
3239 font-family: 'Motiva Sans', sans-serif;
3340 }
41+
42+ .bugged-skin-warning {
43+ padding: 8px 12px;
44+ margin-top: 10px;
45+ background-color: rgba(255, 152, 0, 0.15);
46+ border: 1px solid rgba(255, 152, 0, 0.4);
47+ border-radius: 4px;
48+ color: #ffb74d;
49+ font-size: 13px;
50+ }
3451 ` ,
3552 ] ;
3653
@@ -45,12 +62,53 @@ export class UtilityBelt extends FloatElement {
4562 ?hidden ="${ ! this . marketHashName } "
4663 .key ="${ this . marketHashName } "
4764 > </ csfloat-filter-container >
65+ ${ this . renderBuggedSkinWarning ( ) }
4866 </ div >
4967 < csfloat-ad-banner > </ csfloat-ad-banner >
5068 ` ;
5169 }
5270
71+ private countBuggedSkins ( ) : number {
72+ try {
73+ const assets = g_rgAssets ?. [ AppId . CSGO ] ?. [ ContextId . PRIMARY ] ;
74+ if ( ! assets ) return 0 ;
75+
76+ return Object . values ( assets ) . filter ( ( asset ) => isBuggedSkin ( asset ) ) . length ;
77+ } catch {
78+ return 0 ;
79+ }
80+ }
81+
82+ private renderBuggedSkinWarning ( ) : HTMLTemplateResult | typeof nothing {
83+ if ( this . buggedSkinCount === 0 ) {
84+ return nothing ;
85+ }
86+
87+ return html `
88+ < div class ="bugged-skin-warning ">
89+ < b > ${ this . buggedSkinCount } skin${ this . buggedSkinCount > 1 ? 's' : '' } </ b > on this page
90+ cannot display float data since they're not inspectable in-game (March 4, 2026 update). Valve pls fix.
91+ </ div >
92+ ` ;
93+ }
94+
5395 async connectedCallback ( ) {
5496 super . connectedCallback ( ) ;
97+
98+ this . buggedSkinCount = this . countBuggedSkins ( ) ;
99+
100+ Observe (
101+ ( ) => {
102+ try {
103+ return Object . keys ( g_rgAssets ?. [ AppId . CSGO ] ?. [ ContextId . PRIMARY ] || { } ) . join ( ',' ) ;
104+ } catch {
105+ return '' ;
106+ }
107+ } ,
108+ ( ) => {
109+ this . buggedSkinCount = this . countBuggedSkins ( ) ;
110+ } ,
111+ 100
112+ ) ;
55113 }
56114}
0 commit comments