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

Method OnPshipDyingModel

editor/WorldObjectsPlayerDialog.cpp:913–945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

911}
912
913void CWorldObjectsPlayerDialog::OnPshipDyingModel() {
914 char filename[_MAX_PATH];
915 int img_handle;
916 int ship_handle;
917 int c = 1, finding_name = 1;
918 int model = 0;
919
920 // Get the filename of the representing image
921
922 CString filter = "Descent III files (*.pof,*.oof)|*.pof;*.oof||";
923
924 if (!OpenFileDialog(this, (LPCTSTR)filter, filename, Current_model_dir, sizeof(Current_model_dir)))
925 return;
926
927 // Okay, we selected a file. Lets do what needs to be done here.
928 img_handle = LoadShipImage(filename);
929
930 if (img_handle < 0) {
931 OutrageMessageBox("Couldn't open that animation/model file.");
932 return;
933 }
934
935 ship_handle = D3EditState.current_ship;
936
937 Ships[ship_handle].dying_model_handle = img_handle;
938
939 // Finally, save a local copy of the model
940
941 std::filesystem::path curname = LocalModelsDir / Poly_models[Ships[ship_handle].dying_model_handle].name;
942 cf_CopyFile(curname, filename);
943
944 UpdateDialog();
945}
946
947void CWorldObjectsPlayerDialog::OnNullDying() {
948 int n = D3EditState.current_ship;

Callers

nothing calls this directly

Calls 4

OpenFileDialogFunction · 0.85
LoadShipImageFunction · 0.85
OutrageMessageBoxFunction · 0.85
cf_CopyFileFunction · 0.85

Tested by

no test coverage detected