| 594 | } |
| 595 | |
| 596 | void CScriptLevelInterface::UpdateScriptListWithLevels() { |
| 597 | CComboBox *combo = (CComboBox *)GetDlgItem(IDC_SELECTED_SCRIPT); |
| 598 | if (!combo) |
| 599 | return; |
| 600 | |
| 601 | combo->ResetContent(); |
| 602 | |
| 603 | SetStatus("Updating script list of level scripts"); |
| 604 | |
| 605 | char buffer[_MAX_PATH]; |
| 606 | int length, i; |
| 607 | |
| 608 | if (m_ShowNonCheckedOut) { |
| 609 | char olddir[_MAX_PATH]; |
| 610 | ddio_GetWorkingDir(olddir, _MAX_PATH); |
| 611 | ddio_SetWorkingDir(LocalScriptDir); |
| 612 | |
| 613 | for (i = 0; i < MAX_GAMEFILES; i++) { |
| 614 | if (Gamefiles[i].used) { |
| 615 | // look for d3l's |
| 616 | length = strlen(Gamefiles[i].name); |
| 617 | |
| 618 | if (length > 4 && !stricmp(&Gamefiles[i].name[length - 4], ".d3l")) { |
| 619 | strcpy(buffer, Gamefiles[i].name); |
| 620 | buffer[length - 4] = '\0'; |
| 621 | strcat(buffer, ".cpp"); |
| 622 | |
| 623 | // ok we have a d3l, look to see if there is a script available for it |
| 624 | char temp[_MAX_PATH]; |
| 625 | if (ddio_FindFileStart(buffer, temp)) { |
| 626 | combo->AddString(buffer); |
| 627 | } |
| 628 | ddio_FindFileClose(); |
| 629 | /* |
| 630 | for ( int j=0; j<MAX_GAMEFILES;j++){ |
| 631 | if(!stricmp(Gamefiles[j].name,buffer)){ |
| 632 | //we found a corresponding script |
| 633 | combo->AddString(buffer); |
| 634 | break; |
| 635 | } |
| 636 | } |
| 637 | */ |
| 638 | } |
| 639 | } |
| 640 | } |
| 641 | |
| 642 | ddio_SetWorkingDir(olddir); |
| 643 | } else { |
| 644 | |
| 645 | for (i = 0; i < MAX_TRACKLOCKS; i++) { |
| 646 | if (GlobalTrackLocks[i].used && GlobalTrackLocks[i].pagetype == PAGETYPE_GAMEFILE) { |
| 647 | |
| 648 | // look for checked out d3l's |
| 649 | length = strlen(GlobalTrackLocks[i].name); |
| 650 | |
| 651 | if (length > 4 && !stricmp(&GlobalTrackLocks[i].name[length - 4], ".d3l")) { |
| 652 | strcpy(buffer, GlobalTrackLocks[i].name); |
| 653 | buffer[length - 4] = '\0'; |
nothing calls this directly
no test coverage detected