Skip to content

[TF2] Allow "Inspect Item" from Backpack for Sappers, Construction PDA, Disguise Kit - #1987

Open
Piogre wants to merge 1 commit into
ValveSoftware:masterfrom
Piogre:inspect-sappers-pdas
Open

[TF2] Allow "Inspect Item" from Backpack for Sappers, Construction PDA, Disguise Kit#1987
Piogre wants to merge 1 commit into
ValveSoftware:masterfrom
Piogre:inspect-sappers-pdas

Conversation

@Piogre

@Piogre Piogre commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Currently, the "Inspect Item" option in the Backpack right-click menu only appears for weapons if they are Primary, Secondary, or Melee weapons. This means the option is NOT available for any of Spy's Sappers, nor the Construction PDA nor Disguise Kit.

This PR addresses this issue, enabling this option for the five Sapper variants and the Construction/Disguise PDAs.

A few notes regarding this PR:

-First, the right-click menu in the Inventory is disabled entirely by default in the SDK, via a single return statement at the top of CBackpackPanel::OpenContextMenu() in src\game\client\econ\backpack_panel.cpp -- testing this code change within the SDK requires commenting out that line.

-Second, this change enables this option for items classed as "building" or "pda" -- it intentionally excludes "pda2" which includes the Spy Watches and the Destruction PDA. None of the Spy Watches have proper standalone models (they all use ONLY v_models) so including them would be mostly pointless, however if that were to change they could be included as well by appending an additional line to the added block specifying LOADOUT_POSITION_PDA2

-Third, these items need some minor tweaks to appear properly:

-Add "inspect_panel_dist" "25" to the item schema definition for the Construction PDA ("737")
-Add "inspect_panel_dist" "13" to the item schema definition for the Disguise Kit ("27")

-Add a "pedestal_0" attachment to the QC script for the Construction PDA base weapon model:
    models/weapons/c_models/c_builder/c_builder.mdl
    |
    $attachment "pedestal_0" "weapon_bone" 0.00 2.37 0.04 rotate -45 -90 0

-Add "pedestal_0" attachments to the QC scripts for the Disguise Kit and Sappers base weapon models:
    models/weapons/w_models/w_cigarette_case.mdl
    models/weapons/c_models/c_sapper/c_sapper.mdl
    models/weapons/c_models/c_sapper/c_sapper_xmas.mdl
    models/weapons/c_models/c_p2rec/c_p2rec.mdl
    models/weapons/c_models/c_breadmonster_sapper/c_breadmonster_sapper.mdl
    models/workshop_partner/weapons/c_models/c_sd_sapper/c_sd_sapper.mdl
    |
    $attachment "pedestal_0" "weapon_bone" 0.00 0.00 0.00 rotate -90 -90 0
    
    Some of the sapper models already have a "pedestal_0" attachment,
    but they should be replaced with the above across the board for uniformity and better visibility
menu build cigcase sapper festsapper apsap snack redtape

Fixes ValveSoftware/Source-1-Games#2907 (partially, see comment on that issue)

…-click menu

Currently, whether right click -> inspect in the backpack works for a weapon depends on whether it passes BCanPreviewPaintKit, which currently only passes for primary, secondary, and melee weapon slots due to calling IsValidPickupWeaponSlot.  BCanPreviewPaintKit can be modified to directly check those slots plus pda1 and building, allowing inspect of sappers and the construction PDA and disguise kit.  The other uses of BCanPreviewPaintKit should be unaffected by this.

it's possible to allow inspect of spy watches and the destruction PDA by adding a line for LOADOUT_POSITION_PDA2, however the watches do not have proper models (v_models only) so this has been omitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TF2] Sapper, Invis Watch and Robot Arm (Gunslinger) weapons are missing "Inspect Item" option in backpack

1 participant