MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / GetKeyBindingText

Function GetKeyBindingText

Descent3/hud.cpp:1362–1382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1360}
1361
1362char *GetKeyBindingText(int fidkey) {
1363 static char *key_bind_txt;
1364 ct_type ctype[CTLBINDS_PER_FUNC];
1365 uint8_t cfgflags[CTLBINDS_PER_FUNC];
1366 ct_config_data cfgdata;
1367 tCfgDataParts cfgparts;
1368 if (-1 == fidkey)
1369 return NULL;
1370 key_bind_txt = NULL;
1371 fidkey = CtlFindBinding(fidkey, true);
1372 if (fidkey == -1) // DAJ -1FIX
1373 return NULL;
1374
1375 Controller->get_controller_function(Cfg_key_elements[fidkey].fn_id, ctype, &cfgdata, cfgflags);
1376 parse_config_data(&cfgparts, ctype[0], ctype[1], cfgdata);
1377 uint8_t one_binding = cfgparts.bind_0;
1378 uint8_t one_ctrlbind = cfgparts.ctrl_0;
1379
1380 key_bind_txt = (char *)cfg_binding_text(ctype[0], one_ctrlbind, one_binding);
1381 return key_bind_txt;
1382}
1383
1384void DoEnabledControlsLine(const char *controlp, const char *keyp, const char *label, int y, const char *axis = NULL) {
1385 char control_text[200] = "";

Callers 1

RenderHUDItemsFunction · 0.85

Calls 4

CtlFindBindingFunction · 0.85
parse_config_dataFunction · 0.85
cfg_binding_textFunction · 0.85

Tested by

no test coverage detected