public override void Load() { base.Load(); MyScriptWrapper.OnDialogueFinished += MyScriptWrapperOnOnDialogueFinished; m_notification = MyScriptWrapper.CreateNotification(MyTextsWrapperEnum.DoNotGoThere, MyGuiManager.GetFontMinerWarsRed()); m_target = MyScriptWrapper.GetEntity(m_targetId); MyScriptWrapper.MarkEntity(m_target, NameTemp.ToString(), MyHudIndicatorFlagsEnum.SHOW_MISSION_MARKER | MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS | MyHudIndicatorFlagsEnum.SHOW_DISTANCE | MyHudIndicatorFlagsEnum.SHOW_TEXT, MyGuitargetMode.Objective); MyScriptWrapper.AddNotification(m_notification); m_notification.Disappear(); }
public override void Success() { if (this.ParentMission.MarkedForUnload) { return; } if (MyMultiplayerGameplay.IsHosting && !MySession.Static.EventLog.IsMissionFinished(ID)) { MyMultiplayerGameplay.Static.SendMissionProgress(this, CommonLIB.AppCode.Networking.Multiplayer.MyMissionProgressType.Success); } MySession.Static.EventLog.SubmissionFinished(ID); SetLocationVisibility(false); if (Location != null) { Location.Entity = null; } bool canPlaySuccessDialogue = (!MyFakes.ENABLE_AUTOSKIPPING_ENDMISSION_DIALOGUE || SkipDialogEnabled); if (MyFakes.TEST_MISSION_GAMEPLAY && MyFakes.TEST_MISSION_GAMEPLAY_AUTO_KILLS == 0) { m_dialogDelayToSkipForTesting -= MyConstants.PHYSICS_STEP_SIZE_IN_MILLISECONDS; if (m_dialogDelayToSkipForTesting <= 0) { //Stop success dialogue after one second. This delay should be enough to spawn bots etc. canPlaySuccessDialogue = false; } } else if (MyFakes.TEST_MISSION_GAMEPLAY) { canPlaySuccessDialogue = false; } if (canPlaySuccessDialogue) { if (m_succesDialogStarted && !m_successDialogFinished) // We are waiting to finish dialog { return; } if (!m_successDialogFinished && SuccessDialogId != null) // We succeded but still did not played succes dialog { m_succesDialogStarted = true; if (OnSuccessDialogueStarted != null) { OnSuccessDialogueStarted(this); } MyScriptWrapper.PlayDialogue(SuccessDialogId.Value); return; } } MyMwcLog.WriteLine("Submission " + NameTemp + " success."); base.Success(); MyAudio.AddCue2D(MySoundCuesEnum.HudObjectiveComplete); ParentMission.ObjectiveCompleted(this); MyMissions.SaveName = this.ParentMission.NameTemp.ToString() + ": " + (NameTemp != null ? NameTemp.ToString() : "(null)") + (SaveOnSuccess ? "" : " *"); MyMissions.NeedsSave |= SaveOnSuccess; }
public override void AddSolarMapMarks(MySolarSystemMapData data) { foreach (var objective in ActiveObjectives) { if (objective.Location != null && !MyGuiScreenGamePlay.Static.IsCurrentSector(objective.Location.Sector) && objective.ShowNavigationMark) { var missionMark = new MySolarSystemMapNavigationMark(objective.Location.Sector, objective.NameTemp.ToString(), null, MyHudConstants.MISSION_MARKER_COLOR, TransparentGeometry.MyTransparentMaterialEnum.SolarMapNavigationMark) { VerticalLineColor = MyHudConstants.MISSION_MARKER_COLOR.ToVector4(), DirectionalTexture = MyHudTexturesEnum.DirectionIndicator_white }; data.NavigationMarks.Add(missionMark); } objective.AddSolarMapMarks(data); } if (Location != null && !MyGuiScreenGamePlay.Static.IsCurrentSector(Location.Sector) && ShowNavigationMark) { var missionMark = new MySolarSystemMapNavigationMark(Location.Sector, NameTemp.ToString(), null, MyHudConstants.ACTIVE_MISSION_SOLAR_MAP_COLOR, TransparentGeometry.MyTransparentMaterialEnum.SolarMapNavigationMark) { VerticalLineColor = MyHudConstants.MISSION_MARKER_COLOR.ToVector4(), DirectionalTexture = MyHudTexturesEnum.DirectionIndicator_white }; data.NavigationMarks.Add(missionMark); } }