private void TryRegisterHotkey(string name, BindingKeysData value)
        {
            Mod.Debug(MethodBase.GetCurrentMethod(), name, HotkeyHelper.GetKeyText(value));

            if (value != null)
            {
                HotkeyHelper.RegisterKey(name, value, KeyboardAccess.GameModesGroup.All);
            }
            else
            {
                HotkeyHelper.UnregisterKey(name);
            }
        }
        private void OnGUIHotkey()
        {
            if (!string.IsNullOrEmpty(_waitingHotkeyName) && HotkeyHelper.ReadKey(out BindingKeysData newKey))
            {
                Mod.Core.Hotkeys.SetHotkey(_waitingHotkeyName, newKey);
                _waitingHotkeyName = null;
            }

            IDictionary <string, BindingKeysData> hotkeys = Mod.Core.Hotkeys.Hotkeys;

            using (new GUILayout.HorizontalScope())
            {
                using (new GUILayout.VerticalScope())
                {
                    foreach (KeyValuePair <string, BindingKeysData> item in hotkeys)
                    {
                        GUIHelper.ToggleButton(item.Value != null, Local[item.Key], _labelStyle, GUILayout.ExpandWidth(false));
                    }
                }

                GUILayout.Space(10f);

                using (new GUILayout.VerticalScope())
                {
                    foreach (BindingKeysData key in hotkeys.Values)
                    {
                        GUILayout.Label(HotkeyHelper.GetKeyText(key));
                    }
                }

                GUILayout.Space(10f);

                using (new GUILayout.VerticalScope())
                {
                    foreach (string name in hotkeys.Keys)
                    {
                        bool waitingThisHotkey = _waitingHotkeyName == name;
                        if (GUILayout.Button(Local["Menu_Btn_Set"], waitingThisHotkey ? _downButtonStyle : _buttonStyle))
                        {
                            if (waitingThisHotkey)
                            {
                                _waitingHotkeyName = null;
                            }
                            else
                            {
                                _waitingHotkeyName = name;
                            }
                        }
                    }
                }

                using (new GUILayout.VerticalScope())
                {
                    string hotkeyToClear = default;
                    foreach (string name in hotkeys.Keys)
                    {
                        if (GUILayout.Button(Local["Menu_Btn_Clear"], _buttonStyle))
                        {
                            hotkeyToClear = name;

                            if (_waitingHotkeyName == name)
                            {
                                _waitingHotkeyName = null;
                            }
                        }
                    }
                    if (!string.IsNullOrEmpty(hotkeyToClear))
                    {
                        Mod.Core.Hotkeys.SetHotkey(hotkeyToClear, null);
                    }
                }

                using (new GUILayout.VerticalScope())
                {
                    foreach (KeyValuePair <string, BindingKeysData> item in hotkeys)
                    {
                        if (item.Value != null && !HotkeyHelper.CanBeRegistered(item.Key, item.Value))
                        {
                            GUILayout.Label(Local["Menu_Txt_Duplicated"].Color(RGBA.yellow));
                        }
                        else
                        {
                            GUILayout.Label(string.Empty);
                        }
                    }
                }

                GUILayout.FlexibleSpace();
            }

            ToggleFiveFootStepOnRightClickGround =
                GUIHelper.ToggleButton(ToggleFiveFootStepOnRightClickGround,
                                       Local["Menu_Opt_ToggleFiveFootStepOnRightClickGround"], _buttonStyle, GUILayout.ExpandWidth(false));
        }