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

Method UpdateScriptListbox

editor/ScriptSelect.cpp:199–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197// INTERNAL FUNCTIONS
198
199void CScriptSelect::UpdateScriptListbox() {
200 CListBox *scrlistbox = (CListBox *)GetDlgItem(IDC_SCRIPTSEL_LISTBOX);
201 int i;
202
203 GenerateScriptListFromAllFiles(m_CustomType);
204
205 // Add script names to list box
206 scrlistbox->ResetContent();
207 for (i = 0; i < MAX_SCRIPTS; i++) {
208 if (Script_names[i].used)
209 if (m_ScriptType == 0xffff || Script_names[i].type == m_ScriptType)
210 if ((Script_names[i].iscustom && (m_CustomType & CUSTOM_SCRIPT_MASK)) ||
211 (!Script_names[i].iscustom && (m_CustomType & DEFAULT_SCRIPT_MASK)))
212 scrlistbox->AddString(Script_names[i].name);
213 }
214
215 scrlistbox->AddString("null");
216
217 // make sure we reselect the current string.
218 if (scrlistbox->GetCount() > 0)
219 scrlistbox->SetCurSel(0);
220}
221
222void CScriptSelect::OnScriptselAdd() {
223 CAddScriptDialog dlg(this);

Callers

nothing calls this directly

Calls 2

AddStringMethod · 0.80

Tested by

no test coverage detected