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

Method OnScriptselAdd

editor/ScriptSelect.cpp:222–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void CScriptSelect::OnScriptselAdd() {
223 CAddScriptDialog dlg(this);
224
225 // in this case, load the script source file level.scr and add to it.
226 if (dlg.DoModal() == IDOK) {
227 char *source;
228
229 source = LoadScript(LEVEL_SCRIPT_NAME);
230 if (!source) {
231 OutrageMessageBox("Unable to find script for level. Something is wrong!");
232 return;
233 }
234 source = AddScriptBlockToScript(source, (LPCSTR)dlg.m_Name, (LPCSTR)dlg.m_TypeName);
235 SaveScript(LEVEL_SCRIPT_NAME, source);
236 FreeScript(source);
237 EditScript(LEVEL_SCRIPT_NAME, dlg.m_Name);
238 }
239}
240
241void CScriptSelect::OnEditScript() {
242 CListBox *scrlistbox = (CListBox *)GetDlgItem(IDC_SCRIPTSEL_LISTBOX);

Callers

nothing calls this directly

Calls 6

LoadScriptFunction · 0.85
OutrageMessageBoxFunction · 0.85
AddScriptBlockToScriptFunction · 0.85
SaveScriptFunction · 0.85
FreeScriptFunction · 0.85
DoModalMethod · 0.45

Tested by

no test coverage detected