Skip to content

Fix drag-and-drop equipping and inventory UI lag#2

Draft
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
fix-tarkov-inventory-drag-lag-4834565500949481724
Draft

Fix drag-and-drop equipping and inventory UI lag#2
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
fix-tarkov-inventory-drag-lag-4834565500949481724

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This PR addresses two issues in the Tarkov Inventory system:

  1. Drag-and-Drop Equipping: Previously, dragging an item to an equipment slot did not work; users could only right-click to equip. I added a drop handler to the equipment slots that verifies the item type and sends the equip command to the server.
  2. Inventory Lag: Equipping items that modified inventory size (like backpacks) caused significant lag due to the entire UI being destroyed and recreated. I refactored OpenInventory to reuse the main frame and the expensive Player Model panel, only refreshing the item slots. This also fixes a memory leak involving the backpack preview model.

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

- Implemented drag-and-drop support for equipment slots by adding a `Receiver` handler to the slot panels.
- Optimized `OpenInventory` to reuse the existing `DFrame` and `DModelPanel` instead of rebuilding them on every update, eliminating lag spikes when equipping items.
- Fixed a memory leak where `ClientsideModel` (backpack visual) was not being removed when the player model panel was destroyed.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 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.

- **Fix Lag:** Optimized `OpenInventory` to reuse the main `DFrame` and the expensive 3D player model panel instead of destroying/recreating them on every update. Fixed a memory leak with the backpack visual.
- **Drag-and-Drop:**
    - Enabled dragging items *to* equipment slots to equip them.
    - Enabled dragging items *from* equipment slots *to* inventory containers to unequip them to a specific slot (added `unequip_to` server action).
- **Shortcuts:**
    - Added `Ctrl+Left-Click` support for quick actions:
        - Auto-looting items from cache to inventory.
        - Auto-equipping gear from inventory to slots.
        - Unequipping items from slots to inventory.
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.

0 participants