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

Function CtlConfigSwitchCB

Descent3/ctlconfig.cpp:1299–1322  ·  view source on GitHub ↗

called when we switch menus

Source from the content-addressed store, hash-verified

1297
1298// called when we switch menus
1299void CtlConfigSwitchCB(newuiMenu *menu, int16_t old_option_id, int16_t new_option_id, void *data) {
1300 t_ctlcfgswitchcb_data *cfgdata = (t_ctlcfgswitchcb_data *)data;
1301 // performs custom gadget deinitialization and reinitilization
1302 if (cfgdata->curcfg) {
1303 cfgdata->curcfg->unrealize();
1304 }
1305
1306 switch (new_option_id) {
1307 case IDV_KCONFIG:
1308 cfgdata->curcfg = cfgdata->keycfg;
1309 break;
1310 case IDV_CCONFIG:
1311 cfgdata->curcfg = cfgdata->joycfg;
1312 break;
1313 case IDV_WPNSEL:
1314 cfgdata->curcfg = cfgdata->wpncfg;
1315 break;
1316 default:
1317 cfgdata->curcfg = NULL;
1318 }
1319 if (cfgdata->curcfg) {
1320 cfgdata->curcfg->realize();
1321 }
1322}
1323// keep multiplayer going!
1324void CtlConfigUICB() {
1325 if (Game_mode & (GM_MULTI)) {

Callers

nothing calls this directly

Calls 2

unrealizeMethod · 0.80
realizeMethod · 0.80

Tested by

no test coverage detected