////////////////////////////////////////////////////////////////////////////// Helper funktions //////////////////////////////////////////////////////////////////////////////
| 1368 | // Helper funktions |
| 1369 | /////////////////////////////////////////////////////////////////////////////////// |
| 1370 | void PilotCopyDefaultControls(pilot *Pilot) { |
| 1371 | PltClearList(); |
| 1372 | PltGetPilotsFree(); |
| 1373 | filelist = PltGetPilots(&filecount, NULL, 2); |
| 1374 | |
| 1375 | // if(filecount>0 && DoMessageBox(TXT_PRESETCONTROLS,TXT_USEPRESETS,MSGBOX_YESNO)) |
| 1376 | if (filecount > 0) { |
| 1377 | pilot s_pil; |
| 1378 | |
| 1379 | if (PilotChoose(&s_pil, true)) { |
| 1380 | char spfilename[_MAX_FNAME]; |
| 1381 | s_pil.get_filename(spfilename); |
| 1382 | |
| 1383 | if (cfexist(spfilename)) { |
| 1384 | PltCopyKeyConfig(&s_pil, Pilot); |
| 1385 | } else { |
| 1386 | mprintf(0, "%s does not exist...not copying\n", spfilename); |
| 1387 | Int3(); |
| 1388 | } |
| 1389 | } |
| 1390 | } |
| 1391 | |
| 1392 | // Restore the pilot list, ignoring none |
| 1393 | PltClearList(); |
| 1394 | PltGetPilotsFree(); |
| 1395 | filelist = PltGetPilots(&filecount); |
| 1396 | } |
| 1397 | |
| 1398 | /////////////////////////////////////////////////////////// |
| 1399 | // Displays a window to select a pilot |
no test coverage detected