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

Method AddLevelFilename

editor/TableFileFilterMng.cpp:673–706  ·  view source on GitHub ↗

Adds a level filename to the filename list (and to the dialog list box)

Source from the content-addressed store, hash-verified

671
672// Adds a level filename to the filename list (and to the dialog list box)
673bool PageDataList::AddLevelFilename(char *level_filename) {
674 int i, level_found;
675
676 CWaitCursor wc;
677
678 if (level_filename == NULL)
679 return FALSE;
680
681 // Make sure the level hasn't already been added
682 level_found = -1;
683 for (i = 0; i < m_NumLevelFilenames; i++)
684 if (stricmp(m_LevelFilenames[i], level_filename) == 0)
685 level_found = i;
686
687 if (level_found >= 0)
688 return FALSE;
689
690 // Add the filename to the list
691 if (m_NumLevelFilenames >= MAX_LEVEL_FILENAMES)
692 return FALSE;
693 strcpy(m_LevelFilenames[m_NumLevelFilenames], level_filename);
694 m_NumLevelFilenames++;
695
696 // Add the filename to the list box
697 m_LevelListBox->InsertString(-1, level_filename);
698
699 // Add the pages required by this level
700 ProcessPagesForLevel(level_filename, ADD_PAGES);
701 wc.Restore();
702
703 m_DataListModified = TRUE;
704
705 return TRUE;
706}
707
708// Removes the selected level from the filename list (and from the dialog list box)
709bool PageDataList::RemoveSelLevelFilename(void) {

Callers 1

OnBtnAddLevelMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected