| 1543 | } |
| 1544 | |
| 1545 | bool CScriptLevelInterface::CheckInScripts() { |
| 1546 | CCheckListBox *list = (CCheckListBox *)GetDlgItem(IDC_LIST_CHECKEDOUT); |
| 1547 | int listbox_size = list->GetCount(); |
| 1548 | int list_size = 0; |
| 1549 | int i; |
| 1550 | for (i = 0; i < listbox_size; i++) { |
| 1551 | if (list->GetCheck(i)) { |
| 1552 | list_size++; |
| 1553 | } |
| 1554 | } |
| 1555 | |
| 1556 | if (list_size == 0) |
| 1557 | return false; |
| 1558 | int *index_map = (int *)mem_malloc(list_size * sizeof(int)); |
| 1559 | if (!index_map) |
| 1560 | return false; |
| 1561 | |
| 1562 | int index = 0; |
| 1563 | for (i = 0; i < listbox_size; i++) { |
| 1564 | if (list->GetCheck(i)) { |
| 1565 | index_map[index] = i; |
| 1566 | index++; |
| 1567 | } |
| 1568 | } |
| 1569 | |
| 1570 | if (!mng_MakeLocker()) { |
| 1571 | mem_free(index_map); |
| 1572 | return false; |
| 1573 | } |
| 1574 | |
| 1575 | int j; |
| 1576 | bool changed = false; |
| 1577 | char tempbuffer[_MAX_PATH]; |
| 1578 | char savename[_MAX_PATH]; |
| 1579 | |
| 1580 | for (i = 0; i < list_size; i++) { |
| 1581 | index = index_map[i]; |
| 1582 | |
| 1583 | list->GetText(index, tempbuffer); |
| 1584 | strcpy(savename, tempbuffer); |
| 1585 | strcat(tempbuffer, ".cpp"); |
| 1586 | |
| 1587 | char t[256]; |
| 1588 | sprintf(t, "Checking In: %s", tempbuffer); |
| 1589 | SetStatus(t); |
| 1590 | |
| 1591 | // this item is checked...we wish to checkin |
| 1592 | if (CheckInGamefile(tempbuffer, false)) |
| 1593 | changed = true; |
| 1594 | |
| 1595 | // ok, now see if there was a DLL too |
| 1596 | strcpy(tempbuffer, savename); |
| 1597 | strcat(tempbuffer, ".dll"); |
| 1598 | for (j = 0; j < MAX_TRACKLOCKS; j++) { |
| 1599 | if ((GlobalTrackLocks[j].used) && (GlobalTrackLocks[j].pagetype == PAGETYPE_GAMEFILE) && |
| 1600 | (!stricmp(GlobalTrackLocks[j].name, tempbuffer))) { |
| 1601 | // ok, we found a possibly matching script...ask if they want that |
| 1602 | // checked in also... |
nothing calls this directly
no test coverage detected