void CheckCodeButtonClicked(MyGuiControlButton button) { string code = Description.Text.ToString(); m_compilerErrors.Clear(); Assembly assembly = null; if (CompileProgram(code, m_compilerErrors, ref assembly)) { MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox( styleEnum: MyMessageBoxStyleEnum.Info, buttonType: MyMessageBoxButtonsType.OK, messageText: MyTexts.Get(MySpaceTexts.ProgrammableBlock_Editor_CompilationOk), canHideOthers: false)); } else { string compilerErrors = ""; foreach (var error in m_compilerErrors) { compilerErrors += FormatError(error) + "\n"; } var errorListScreen = new MyGuiScreenMission(missionTitle: MyTexts.GetString(MySpaceTexts.ProgrammableBlock_Editor_CompilationFailed), currentObjectivePrefix: MyTexts.GetString(MySpaceTexts.ProgrammableBlock_Editor_CompilationFailedErrorList), currentObjective: "", description: compilerErrors, canHideOthers: false, enableBackgroundFade: true, style: MyMissionScreenStyleEnum.RED); MyScreenManager.AddScreen(errorListScreen); } FocusedControl = m_descriptionBox; }
void CheckCodeButtonClicked(MyGuiControlButton button) { string code = Description.Text.ToString(); m_compilerErrors.Clear(); Assembly assembly = null; if (CompileProgram(code, m_compilerErrors, ref assembly)) { MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox( styleEnum: MyMessageBoxStyleEnum.Info, buttonType: MyMessageBoxButtonsType.OK, messageText: MyTexts.Get(MySpaceTexts.ProgrammableBlock_Editor_CompilationOk), canHideOthers: false)); } else { string compilerErrors = ""; foreach (var error in m_compilerErrors) { compilerErrors += FormatError(error) + "\n"; } var errorListScreen = new MyGuiScreenMission(missionTitle: MyTexts.GetString(MySpaceTexts.ProgrammableBlock_Editor_CompilationFailed), currentObjectivePrefix: MyTexts.GetString(MySpaceTexts.ProgrammableBlock_Editor_CompilationFailedErrorList), currentObjective: "", description: compilerErrors, canHideOthers: false, enableBackgroundFade:true, style: MyMissionScreenStyleEnum.RED); MyScreenManager.AddScreen(errorListScreen); } FocusedControl = m_descriptionBox; }