public void Start() { MyGuiManager.AddScreen(this); if (Background && BackgroundNotification.HasValue) { var notification = new MyHudNotification.MyNotification(BackgroundNotification.Value); MyHudNotification.AddNotification(notification); this.Closed += (screen) => notification.Disappear(); } }
public override void Load() { MyScriptWrapper.OnBotReachedWaypoint += BotReachedWaypoint; MyScriptWrapper.OnSpawnpointBotSpawned += OnSpawnpointBotSpawned; MyScriptWrapper.EntityDeath += OnEntityDeath; m_actionKeyString[0] = MyGuiManager.GetInput().GetGameControlTextEnum(MyGameControlEnums.USE); m_canBuildNotification = MyScriptWrapper.CreateNotification( Localization.MyTextsWrapperEnum.PressToBuildTurret, MyGuiManager.GetFontMinerWarsBlue()); m_canBuildNotification.SetTextFormatArguments(m_actionKeyString); m_remainingTurretsNotification = MyScriptWrapper.CreateNotification( Localization.MyTextsWrapperEnum.RemainingTurrets, MyGuiManager.GetFontMinerWarsBlue()); //m_canSkipNotification = MyScriptWrapper.CreateNotification( // Localization.MyTextsWrapperEnum.PressToSkipTimer, // MyGuiManager.GetFontMinerWarsBlue()); //m_canSkipNotification.SetTextFormatArguments(m_actionKeyString); //m_canSkipNotification.Disappear(); m_generatorUnderAttackNotification = MyScriptWrapper.CreateNotification( Localization.MyTextsWrapperEnum.GeneratorUnderAttack, MyGuiManager.GetFontMinerWarsRed(), 3000); m_generatorUnderAttackNotification.Disappear(); m_useProgress = new MyGuiScreenUseProgressBar(MyTextsWrapperEnum.Turrets, MyTextsWrapperEnum.BuildingInProgress,0f, MySoundCuesEnum.SfxProgressBuild, MySoundCuesEnum.SfxCancelBuild, MyGameControlEnums.USE, 0, 3000, 0); m_useProgress.OnCanceled += OnCanceledHandler; m_useProgress.OnSuccess += OnSuccessHandler; SetupMotherships(); SetUpTurrets(); base.Load(); }
private void ShowOrHideNotification(bool show, ref MyHudNotification.MyNotification notification, MyTextsWrapperEnum text, MyGameControlEnums? gameControl) { if (show) { if (notification == null) { notification = new MyHudNotification.MyNotification(text, MyHudConstants.MISSION_FONT, MyHudNotification.DONT_DISAPEAR, null, null); if (gameControl.HasValue) { notification.SetTextFormatArguments(new object[] { MyGuiManager.GetInput().GetGameControlTextEnum(gameControl.Value) }); } notification.Disappear(); } if (notification.IsDisappeared()) { notification.Appear(); MyHudNotification.AddNotification(notification); } } else { if (notification != null && !notification.IsDisappeared()) notification.Disappear(); } }
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(); }