Skip to content

[TF2] Fix duplicate loadout panels - #2081

Open
SanyaKor wants to merge 1 commit into
ValveSoftware:masterfrom
SanyaKor:loadout-input-fix
Open

SanyaKor wants to merge 1 commit into
ValveSoftware:masterfrom
SanyaKor:loadout-input-fix

Conversation

@SanyaKor

Copy link
Copy Markdown

Summary

Fix item selection panel duplication in the class loadout.

Problem

The class loadout can open two item selection panels when Enter and the left mouse button are pressed at nearly the same time.

Both input handlers invoke a change<N> command, such as change0 or change1:

  • Enter is handled by CClassLoadoutPanel::OnKeyCodePressed.
  • Mouse input is handled by CClassLoadoutPanel::OnItemPanelMouseReleased.

Each command reaches CClassLoadoutPanel::OnCommand and creates a new selection panel without checking whether one is already open.

The line responsible for creating another panel is:

m_pSelectionPanel = new CEquipSlotItemSelectionPanel( this, m_iCurrentClassIndex, iSlot );

When both input events are processed, this line runs twice. The second call overwrites m_pSelectionPanel, while the first selection panel remains open.

Video

Watch the reproduction video

Loadout UI duplication

The video also demonstrates another visual symptom of this issue: two items can display the Equipped label for the same loadout slot.

To reproduce it:

  1. Launch TF2 through Steam.
  2. Open two item selection panels by pressing Enter and the left mouse button simultaneously.
  3. Select an item in one of the selection panels.
  4. Force quit TF2 after reproducing the item selection panel duplication, without leaving the loadout screen.
  5. Launch the TF2 SDK and open the affected loadout slot.

The SDK may display the Equipped label on two items, although only one item is actually equipped. This incorrect state is only visible in the SDK.

Note

This is a UI issue. It is not possible to equip two weapons in the same loadout slot.

@SanyaKor SanyaKor changed the title Fix duplicate loadout panels [TF2] Fix duplicate loadout panels Sep 14, 2026
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