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

Method RemoveSelLevelFilename

editor/TableFileFilterMng.cpp:709–748  ·  view source on GitHub ↗

Removes the selected level from the filename list (and from the dialog list box)

Source from the content-addressed store, hash-verified

707
708// Removes the selected level from the filename list (and from the dialog list box)
709bool PageDataList::RemoveSelLevelFilename(void) {
710 int i, level_found;
711 int index;
712 CString level_filename;
713
714 CWaitCursor wc;
715
716 if (m_LevelListBox == NULL)
717 return FALSE;
718
719 index = m_LevelListBox->GetCurSel();
720 if (index == LB_ERR)
721 return FALSE;
722 m_LevelListBox->GetText(index, level_filename);
723
724 // Find the level position in the filename list
725 level_found = -1;
726 for (i = 0; i < m_NumLevelFilenames; i++)
727 if (stricmp(m_LevelFilenames[i], level_filename.GetBuffer(0)) == 0)
728 level_found = i;
729
730 if (level_found < 0)
731 return FALSE;
732
733 // Remove the filename from the list
734 for (i = level_found; i < m_NumLevelFilenames - 1; i++)
735 strcpy(m_LevelFilenames[i], m_LevelFilenames[i + 1]);
736 m_NumLevelFilenames--;
737
738 // Remove the filename from the list box
739 m_LevelListBox->DeleteString(index);
740
741 // Remove the pages required by this level
742 ProcessPagesForLevel(level_filename.GetBuffer(0), REMOVE_PAGES);
743 wc.Restore();
744
745 m_DataListModified = TRUE;
746
747 return TRUE;
748}
749
750char *gamefile_level_ext[] = {".d3l", ".cpp", ".dll", ".msg", ".omf", ".brf", ".str", ".msn", NULL};
751

Callers 1

OnBtnRemoveLevelMethod · 0.80

Calls 2

GetBufferMethod · 0.80
GetTextMethod · 0.45

Tested by

no test coverage detected