Saves all data
| 670 | |
| 671 | // Saves all data |
| 672 | void CDallasMainDlg::OnSaveButton() { |
| 673 | CString temp_str; |
| 674 | char fullpath[_MAX_PATH]; |
| 675 | |
| 676 | #ifndef NEWEDITOR |
| 677 | // Make sure we're in the editor |
| 678 | if (GetFunctionMode() != EDITOR_MODE) |
| 679 | return; |
| 680 | #endif |
| 681 | |
| 682 | Compiling = TRUE; |
| 683 | |
| 684 | // Create the script source file |
| 685 | if (!CreateScriptFile(m_ScriptFilename.GetBuffer(0))) { |
| 686 | Compiling = FALSE; |
| 687 | return; |
| 688 | } |
| 689 | SetModified(FALSE); |
| 690 | |
| 691 | // Write out the message list |
| 692 | CreateMsgTableFile(m_ScriptMessagesFilename.GetBuffer(0)); |
| 693 | |
| 694 | // Get the full DLL path, and delete the DLL |
| 695 | ddio_MakePath(fullpath, LocalScriptDir, m_ScriptDLLFilename.GetBuffer(0), NULL); |
| 696 | ddio_DeleteFile(fullpath); |
| 697 | |
| 698 | // Attempt to compile it and create the dll |
| 699 | CompilerOutputText = ""; |
| 700 | tCompilerInfo ci; |
| 701 | ci.callback = CompilerCallback; |
| 702 | ci.script_type = ST_LEVEL; |
| 703 | |
| 704 | strcpy(ci.source_filename, m_ScriptFilename.GetBuffer(0)); |
| 705 | ScriptCompile(&ci); |
| 706 | |
| 707 | // Check to see if the DLL has been created |
| 708 | ddio_MakePath(fullpath, LocalScriptDir, m_ScriptDLLFilename.GetBuffer(0), NULL); |
| 709 | if (_access(fullpath, 0x00) == -1) { |
| 710 | MessageBox("The compile failed. See output for error details.", "Compiler Error"); |
| 711 | } |
| 712 | |
| 713 | Compiling = FALSE; |
| 714 | } |
| 715 | |
| 716 | // Called when the cancel button is pressed |
| 717 | void CDallasMainDlg::OnCancel() { |
nothing calls this directly
no test coverage detected