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

Method OnAdd

editor/BriefManage.cpp:65–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63bool AddNewGameFile(char *fullpath, char *directory);
64bool CheckInGamefile(char *tempbuffer, bool show_ok_confirmation);
65void CBriefManage::OnAdd() {
66 if (!Network_up) {
67 MessageBox("You need to say YES on the data update when starting the editor");
68 return;
69 }
70
71 int sel = m_List.GetCurSel();
72 if (sel == LB_ERR) {
73 MessageBox("Please select the file you want to add");
74 return;
75 }
76
77 char full_buffer[_MAX_PATH + 100];
78 m_List.GetText(sel, full_buffer);
79
80 int page_type = -1;
81 char *ptr;
82
83 // break it down
84 ptr = full_buffer + strlen(full_buffer);
85
86 while (ptr > full_buffer && (*ptr) != '|')
87 ptr--;
88
89 if (*ptr != '|') {
90 MessageBox("Internal Error");
91 Int3(); // get jeff;
92 return;
93 }
94
95 *ptr = '\0';
96 ptr++;
97
98 if (page_type == -1 && strstr(ptr, "[sound]"))
99 page_type = PAGETYPE_SOUND;
100 if (page_type == -1 && strstr(ptr, "[file]"))
101 page_type = PAGETYPE_GAMEFILE;
102
103 if (page_type == -1) {
104 MessageBox("Internal Error");
105 Int3(); // get Jeff
106 return;
107 }
108
109 if (page_type == PAGETYPE_SOUND) {
110 MessageBox("You must add sounds in the sound dialog");
111 return;
112 }
113
114 switch (page_type) {
115 case PAGETYPE_GAMEFILE: {
116 char filename[255];
117 char real_filename[_MAX_PATH];
118
119 strcpy(filename, full_buffer);
120
121 // Get the filename of the representing image
122 CString filter = "";

Callers

nothing calls this directly

Calls 8

OpenFileDialogFunction · 0.85
AddNewGameFileFunction · 0.85
mng_MakeLockerFunction · 0.85
CheckInGamefileFunction · 0.85
mng_EraseLockerFunction · 0.85
ddio_SplitPathFunction · 0.50
GetTextMethod · 0.45
DoModalMethod · 0.45

Tested by

no test coverage detected