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

Function PilotCopyDefaultControls

Descent3/pilot.cpp:1370–1396  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////////// Helper funktions //////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1368// Helper funktions
1369///////////////////////////////////////////////////////////////////////////////////
1370void 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

Callers 1

PilotSelectFunction · 0.85

Calls 7

PltClearListFunction · 0.85
PltGetPilotsFreeFunction · 0.85
PltGetPilotsFunction · 0.85
PilotChooseFunction · 0.85
cfexistFunction · 0.85
PltCopyKeyConfigFunction · 0.85
get_filenameMethod · 0.80

Tested by

no test coverage detected