| 63 | bool AddNewGameFile(char *fullpath, char *directory); |
| 64 | bool CheckInGamefile(char *tempbuffer, bool show_ok_confirmation); |
| 65 | void 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 = ""; |
nothing calls this directly
no test coverage detected