Implement Quick Keys and Double Click for Inventory#8
Conversation
- 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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- 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>
Implemented user-requested features for the Tarkov-style inventory system:
+attackconsole commands with timed delays), and switches back to the previous weapon.PR created automatically by Jules for task 11404684974147515856 started by @Cautioncrazy