File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,15 @@ export class AutoFill extends FloatElement {
272272 this . disableInventoryPicker ( ) ;
273273 }
274274
275+ if ( tradesToBuyer . length > 0 && g_ActiveInventory ?. appid !== AppId . CSGO ) {
276+ // Default to CS inventory
277+ try {
278+ ShowItemInventory ( AppId . CSGO , ContextId . PRIMARY ) ;
279+ } catch ( e ) {
280+ console . error ( e ) ;
281+ }
282+ }
283+
275284 return html `
276285 ${ this . showAutoFillInfoDialog ( tradesToBuyer ) } ${ this . showPermissionWarningDialog ( tradesToBuyer ) }
277286 ${ this . renderBulkAutoFillDialog ( tradesToBuyer ) } ${ tradesToBuyer . map ( ( e ) => this . renderAutoFillDialog ( e ) ) }
@@ -284,16 +293,16 @@ export class AutoFill extends FloatElement {
284293 return ;
285294 }
286295
287- const elem = document . getElementsByClassName ( 'trade_box_contents ') ;
288- if ( ! elem || elem . length === 0 ) {
296+ const elem = document . getElementById ( 'inventories ') ;
297+ if ( ! elem ) {
289298 return ;
290299 }
291300
292301 // @ts -ignore
293- elem . item ( 0 ) ?. style . opacity = '0.5' ;
302+ elem . style . opacity = '0.5' ;
294303
295304 // @ts -ignore
296- elem . item ( 0 ) ?. style . pointerEvents = 'none' ;
305+ elem . style . pointerEvents = 'none' ;
297306 }
298307
299308 autoFillAll ( trades : Trade [ ] ) {
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ export interface CInventory {
122122 m_owner ?: mOwner ;
123123 owner ?: mOwner ;
124124 selectedItem ?: InventoryAsset ;
125+ appid ?: number ;
125126}
126127
127128export interface CAjaxPagingControls {
@@ -182,6 +183,7 @@ export interface UserSomeone {
182183 } ;
183184 strSteamId : string ;
184185 findAsset : ( appId : AppId , contextId : ContextId , itemId : string ) => rgAsset ;
186+ ReloadInventory : ( appId : AppId , contextId : ContextId ) => void ;
185187}
186188
187189export interface CurrentTradeAsset {
@@ -245,6 +247,7 @@ declare global {
245247 ) => void ; // Only populated on create offer pages
246248 const MoveItemToTrade : ( el : HTMLElement ) => void ; // Only populated on create offer pages
247249 const g_rgCurrentTradeStatus : CurrentTradeStatus ;
250+ const ShowItemInventory : ( appID : AppId , contextID : ContextId , AssetID ?: number ) => void ;
248251}
249252
250253export { } ;
You can’t perform that action at this time.
0 commit comments