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

Method LoadCurrentModule

editor/ScriptWizard.cpp:508–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506// ComboBox
507
508void CScriptWizard::LoadCurrentModule() {
509 CComboBox *modcbox = (CComboBox *)GetDlgItem(IDC_SCRMOD_BOX);
510 char str[MAX_SCRNAME];
511
512 // Get current module select and load it in.
513 if (m_ScriptSource)
514 FreeScript(m_ScriptSource);
515
516 m_ScriptSource = NULL;
517
518 if (modcbox->GetLBText(modcbox->GetCurSel(), str) != CB_ERR) {
519 char *ptr;
520 m_ScriptSource = LoadScript(str);
521 strcpy(ScriptFileName, str);
522 strcpy(ScriptCodeName, str);
523 ptr = strtok(ScriptCodeName, ".");
524 strcat(ptr, ".d3x");
525 }
526
527 // new script file, set current script to 0
528 m_CurScriptSel = 0;
529
530 // compile and generate list of script names.
531 ResetScriptList();
532 if (m_ScriptSource) {
533 if (stricmp(ScriptFileName, DEFAULT_SCRIPT_NAME) == 0)
534 GenerateScriptWizardInfo(m_ScriptSource, false);
535 else
536 GenerateScriptWizardInfo(m_ScriptSource, true);
537 }
538
539 UpdateScriptListbox();
540}
541
542void CScriptWizard::UpdateScriptListbox() {
543 CListBox *scrlistbox = (CListBox *)GetDlgItem(IDC_SCR_LISTBOX);

Callers

nothing calls this directly

Calls 4

FreeScriptFunction · 0.85
LoadScriptFunction · 0.85
ResetScriptListFunction · 0.85
GenerateScriptWizardInfoFunction · 0.85

Tested by

no test coverage detected