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

Method OnLoadDoorModel

editor/WorldObjectsDoorDialog.cpp:767–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765}
766
767void CWorldObjectsDoorDialog::OnLoadDoorModel() {
768 char filename[255];
769 int img_handle;
770 int door_handle;
771 int c = 1, finding_name = 1;
772 int model = 0;
773
774 // Get the filename of the representing image
775
776 CString filter = "Descent III files (*.pof,*.oof)|*.pof;*.oof||";
777
778 if (!OpenFileDialog(this, (LPCSTR)filter, filename, Current_model_dir, sizeof(Current_model_dir)))
779 return;
780
781 // Okay, we selected a file. Lets do what needs to be done here.
782 img_handle = LoadDoorImage(filename, 0);
783
784 if (img_handle < 0) {
785 OutrageMessageBox("Couldn't open that animation/model file.");
786 return;
787 }
788
789 door_handle = D3EditState.current_door;
790
791 Doors[door_handle].model_handle = img_handle;
792
793 // Finally, save a local copy of the model
794 std::filesystem::path curname = LocalModelsDir / Poly_models[Doors[door_handle].model_handle].name;
795 cf_CopyFile(curname, filename);
796
797 UpdateDialog();
798}
799
800void CWorldObjectsDoorDialog::OnLockDoor() {
801 int n = D3EditState.current_door;

Callers

nothing calls this directly

Calls 4

OpenFileDialogFunction · 0.85
LoadDoorImageFunction · 0.85
OutrageMessageBoxFunction · 0.85
cf_CopyFileFunction · 0.85

Tested by

no test coverage detected