Skip to content

Implement Quick Keys and Double Click for Inventory#8

Open
Cautioncrazy wants to merge 7 commits into
mainfrom
tarkov-inventory-update-11404684974147515856
Open

Implement Quick Keys and Double Click for Inventory#8
Cautioncrazy wants to merge 7 commits into
mainfrom
tarkov-inventory-update-11404684974147515856

Conversation

@Cautioncrazy
Copy link
Copy Markdown
Owner

Implemented user-requested features for the Tarkov-style inventory system:

  1. Quick Keys (G & V): Added a client-side hook to detect G (Grenade) and V (Melee) keys. This triggers an automated sequence that switches to the weapon in the corresponding slot, performs an attack (simulated via +attack console commands with timed delays), and switches back to the previous weapon.
  2. Double-Click Interactions: Modified the inventory UI to detect double-clicks on items.
    • Inventory: Double-clicking equipment equips it; double-clicking consumables uses them.
    • Loot Cache: Double-clicking consumables uses them directly from the cache; double-clicking other items "takes" them (moves them to the inventory).

PR created automatically by Jules for task 11404684974147515856 started by @Cautioncrazy

- Implemented double-click logic in `CreateItemPanel` to handle Equip, Use, and Move actions based on item type and container.
- Added `PlayerButtonDown` hook for Quick Keys:
  - G Key: Quick throw grenade (Switch -> Attack -> Switch Back).
  - V Key: Quick melee attack (Switch -> Attack -> Switch Back).
- Verified compatibility with existing slot definitions ("Grenade", "Melee").

Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 6 commits January 27, 2026 00:02
- Updated `OpenInventory` UI layout in `sh_tarkov_inventory.lua` to match user specification:
  - Positioned "Melee" slot below the "Rig" slot (x=10, y=390, 80x80).
  - Positioned "Grenade" slot below the "Backpack" slot (x=210, y=390, 80x80).
- Implemented double-click interactions for items (Equip/Use/Take).
- Implemented Quick Keys (G for Grenade, V for Melee) with automated switch-attack-switch sequence.

Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
- Implemented `GetWeaponSlot` helper in `TarkovGenDynamicItems` hook.
- Enhanced detection logic to correctly identify "Melee" and "Grenade" weapons from addons (e.g., ArcCW, Arc9) by checking:
  - `HoldType` (knife, melee, grenade, slam, etc.)
  - `Base`, `Category`, and `PrintName` for keywords.
  - Specific ArcCW flags like `Throwing` and ammo types.
- Ensures addon weapons are assigned to the correct inventory slots instead of defaulting to Primary.

Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
- Updated `BuildLootPools` in `sv_tarkov_loot_bridge.lua` to explicitly include items with `Slot == "Melee"` or `Slot == "Grenade"` in the "weapons" pool.
- Ensures these items (which are now correctly identified by `sh_tarkov_inventory.lua`) will spawn in weapon caches.

Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
- Enhanced `GetWeaponSlot` in `sh_tarkov_inventory.lua` to correctly classify SMGs and Launchers as "Secondary" (Sidearms).
- Adjusted Quick Key (G/V) timers (0.5s deploy, 0.2s attack) to better support addon weapons with slower animations.
- Added (commented out) debug prints for Quick Key logic to assist with future troubleshooting.

Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
- Wrapped dynamic item registration in `pcall` within `sh_tarkov_inventory.lua` to prevent malformed addon weapons from crashing the script and breaking the inventory UI.
- Added safety check in `sv_tarkov_loot_bridge.lua` to prevent server errors if item registration fails.
- Confirmed "Melee" and "Grenade" items are correctly included in loot pools.
- Confirmed sidearm (SMG/Launcher) detection logic is robust.

Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
- Added `PlayerBindPress` hook in `sh_tarkov_inventory.lua` to block the "noclip" bind (usually V) if the player has a Melee weapon equipped in the inventory slot. This prevents Sandbox noclip from overriding the Quick Melee action.
- Enabled debug prints in `TarkovQuickKeys` to assist in diagnosing input issues.

Co-authored-by: Cautioncrazy <214953087+Cautioncrazy@users.noreply.github.com>
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.

1 participant