called when we switch menus
| 1297 | |
| 1298 | // called when we switch menus |
| 1299 | void 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! |
| 1324 | void CtlConfigUICB() { |
| 1325 | if (Game_mode & (GM_MULTI)) { |