| 1111 | } |
| 1112 | |
| 1113 | static void CPE_SetTextHotkey(cc_uint8* data) { |
| 1114 | /* First 64 bytes are label string */ |
| 1115 | cc_string action = UNSAFE_GetString(&data[64]); |
| 1116 | cc_uint32 keyCode = Stream_GetU32_BE(&data[128]); |
| 1117 | cc_uint8 keyMods = data[132]; |
| 1118 | int key; |
| 1119 | |
| 1120 | if (keyCode > 255) return; |
| 1121 | key = Hotkeys_LWJGL[keyCode]; |
| 1122 | if (!key) return; |
| 1123 | Platform_Log3("CPE hotkey added: %c, %b: %s", Input_DisplayNames[key], &keyMods, &action); |
| 1124 | |
| 1125 | if (!action.length) { |
| 1126 | Hotkeys_Remove(key, keyMods); |
| 1127 | StoredHotkeys_Load(key, keyMods); |
| 1128 | } else if (action.buffer[action.length - 1] == '\n') { |
| 1129 | action.length--; |
| 1130 | Hotkeys_Add(key, keyMods, &action, |
| 1131 | HOTKEY_FLAG_AUTO_DEFINED); |
| 1132 | } else { /* more input needed by user */ |
| 1133 | Hotkeys_Add(key, keyMods, &action, |
| 1134 | HOTKEY_FLAG_AUTO_DEFINED | HOTKEY_FLAG_STAYS_OPEN); |
| 1135 | } |
| 1136 | } |
| 1137 | |
| 1138 | static void CPE_ExtAddPlayerName(cc_uint8* data) { |
| 1139 | EntityID id = data[1]; /* 16 bit id */ |
nothing calls this directly
no test coverage detected