From 60ea0bc3c9d3ff2096c40d756f98f0ee1a79314c Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Fri, 17 Jan 2025 09:25:41 +0300 Subject: [PATCH] Register CUIEditKeyBind in the focus system (#943) --- src/xrGame/ui/UIEditKeyBind.cpp | 6 ++++++ src/xrGame/ui/UIEditKeyBind.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/xrGame/ui/UIEditKeyBind.cpp b/src/xrGame/ui/UIEditKeyBind.cpp index d3d228adadc..1563504d332 100644 --- a/src/xrGame/ui/UIEditKeyBind.cpp +++ b/src/xrGame/ui/UIEditKeyBind.cpp @@ -16,6 +16,12 @@ CUIEditKeyBind::CUIEditKeyBind(bool primary, bool isGamepadBinds /*= false*/) m_keyboard = NULL; m_opt_backup_value = NULL; m_action = NULL; + UI().Focus().RegisterFocusable(this); +} + +CUIEditKeyBind::~CUIEditKeyBind() +{ + UI().Focus().UnregisterFocusable(this); } u32 CutStringByLength(CGameFont* font, LPCSTR src, pstr dst, u32 dst_size, float length) diff --git a/src/xrGame/ui/UIEditKeyBind.h b/src/xrGame/ui/UIEditKeyBind.h index 8aec62f093c..36ee777a953 100644 --- a/src/xrGame/ui/UIEditKeyBind.h +++ b/src/xrGame/ui/UIEditKeyBind.h @@ -17,6 +17,7 @@ class CUIEditKeyBind final : public CUIStatic, public CUIOptionsItem public: CUIEditKeyBind(bool primary, bool isGamepadBinds = false); + ~CUIEditKeyBind(); // options item virtual void AssignProps(const shared_str& entry, const shared_str& group);