| 110 | } |
| 111 | |
| 112 | static void Hotkeys_AddNewHotkey(int trigger, cc_uint8 modifiers, const cc_string* text, cc_uint8 flags) { |
| 113 | struct HotkeyData hKey; |
| 114 | hKey.trigger = trigger; |
| 115 | hKey.mods = modifiers; |
| 116 | hKey.textIndex = HotkeysText.count; |
| 117 | hKey.flags = flags; |
| 118 | |
| 119 | if (HotkeysText.count == HOTKEYS_MAX_COUNT) { |
| 120 | Chat_AddRaw("&cCannot define more than 256 hotkeys"); |
| 121 | return; |
| 122 | } |
| 123 | |
| 124 | HotkeysList[HotkeysText.count] = hKey; |
| 125 | StringsBuffer_Add(&HotkeysText, text); |
| 126 | /* sort so that hotkeys with largest modifiers are first */ |
| 127 | Hotkeys_QuickSort(0, HotkeysText.count - 1); |
| 128 | } |
| 129 | |
| 130 | static void Hotkeys_RemoveText(int index) { |
| 131 | struct HotkeyData* hKey = HotkeysList; |
no test coverage detected