Skip to content

Rebinding UI elements should work #1236

@Rainyan

Description

@Rainyan

Build Info

0658b63

Description

The Neo UI elements are only bound once inside CNeoRoot::OnRelayedKeyCodeTyped, on the case where m_ns.keys.bcConsole is not bound:

void CNeoRoot::OnRelayedKeyCodeTyped(vgui::KeyCode code)
{
if (m_ns.keys.bcConsole <= KEY_NONE)
{
m_ns.keys.bcConsole = gameuifuncs->GetButtonCodeForBind("neo_toggleconsole");
m_ns.keys.bcMP3Player = gameuifuncs->GetButtonCodeForBind("neo_mp3");
m_ns.keys.bcTeamMenu = gameuifuncs->GetButtonCodeForBind("teammenu");
m_ns.keys.bcClassMenu = gameuifuncs->GetButtonCodeForBind("classmenu");
m_ns.keys.bcLoadoutMenu = gameuifuncs->GetButtonCodeForBind("loadoutmenu");
}
This causes any re-binds and un-binds of that menu key to not work correctly after that code has run.

This means that users cannot rebind or unbind UI elements in the main menu correctly.

To Reproduce

  • Enter the main menu
  • Open the console
  • Bind the MP3 player to a new key: bind <key> mp3_player such that they key is different from what it used to be
    • Alternatively, unbind such a key from what it used to be

Expected behavior

  • When mp3_player bind is changed, the new bind should work correctly.
  • When mp3_player bind is un-bound with unbind, the old bind should no longer activate.

Actual behavior

  • When mp3_player bind is changed, the new different bind does not work.
  • When mp3_player bind is un-bound with unbind, the old bind incorrectly still keeps activating.

Operating System

  • Windows
  • Linux

Version/Distro

11

Machine's CPU

No response

Machine's GPU

No response

GPU's driver

No response

Build's compiler

No response

Additional context and Screenshots

No response

Metadata

Metadata

Assignees

Labels

Bug ReportBug Reports made through the "Report Issue" interface in GitHub.UI/HUDRelates to the HUD, NeoUI, menus, etc

Type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions