[TF2] Allow "Inspect Item" from Backpack for Sappers, Construction PDA, Disguise Kit - #1987
Open
Piogre wants to merge 1 commit into
Open
[TF2] Allow "Inspect Item" from Backpack for Sappers, Construction PDA, Disguise Kit#1987Piogre wants to merge 1 commit into
Piogre wants to merge 1 commit into
Conversation
…-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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Fixes ValveSoftware/Source-1-Games#2907 (partially, see comment on that issue)