Skip to content

Commit 0b2cafc

Browse files
committed
Steam inventory update quick fix
1 parent d5da7e0 commit 0b2cafc

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/cs2/items/assets/inventory_asset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ export default class InventoryAsset extends Asset {
207207
async BuildSelectedUI() {
208208
// Add UI elements to the currently selected item in the inventory
209209
const selectedItem = unsafeWindow.iActiveSelectView;
210-
const descriptionsElement = unsafeWindow.document.getElementById(`iteminfo${selectedItem}_item_descriptors`);
210+
const descriptionsElement = unsafeWindow.document.getElementById(`iteminfo${selectedItem}`).children[0].children[0].children[0].children[0].children[0].children[4];
211211
const stickerElements = descriptionsElement.getElementsBySelector("#sticker_info img");
212212
const charmElements = descriptionsElement.getElementsBySelector("#keychain_info img");
213-
const ownerActionsElement = unsafeWindow.document.getElementById(`iteminfo${selectedItem}_item_owner_actions`);
213+
const ownerActionsElement = unsafeWindow.document.getElementById(`iteminfo${selectedItem}`).children[0].children[0].children[0].children[0].children[0].children[5];
214214

215215
if (this.ShouldInspect() && GetSetting(SETTING_INSPECT_ITEMS)) {
216216
// Weapon skins

src/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
top: 0;
5454
right: 2px;
5555
left: 2px;
56-
height: 4px;
56+
height: 1px;
5757
border-radius: 4px;
5858
opacity: 85%;
5959
}

src/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,10 @@ import style from '@css/style.css';
298298

299299
{ // Add elements to the selected inventory item
300300
const handleSelectedAsset = (asset) => {
301-
const inventoryAsset = new InventoryAsset(asset);
302-
inventoryAsset.BuildSelectedUI();
301+
requestAnimationFrame(() => {
302+
const inventoryAsset = new InventoryAsset(asset);
303+
inventoryAsset.BuildSelectedUI();
304+
});
303305
};
304306

305307
const originalSelectItem = unsafeWindow.CInventory.prototype.SelectItem;

0 commit comments

Comments
 (0)