void IMyUtilities.ShowMissionScreen(string screenTitle, string currentObjectivePrefix, string currentObjective, string screenDescription, Action <ResultEnum> callback = null, string okButtonCaption = null) { var missionScreen = new MyGuiScreenMission(missionTitle: screenTitle, currentObjectivePrefix: currentObjectivePrefix, currentObjective: currentObjective, description: screenDescription, resultCallback: callback, okButtonCaption: okButtonCaption); MyScreenManager.AddScreen(missionScreen); }
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; }