Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
 private void UpdateNotification(MyEntityDetector entityDetector, ref MyHudNotification.MyNotification notification, MyEntity newEntity)
 {
     if (notification != null)
     {
         notification.Disappear();
         notification = null;
     }
     if (newEntity != null)
     {
         MySmallShipInteractionActionEnum action = (MySmallShipInteractionActionEnum)entityDetector.GetNearestEntityCriterias();
         notification = DisplayDetectedEntityActionNotification(newEntity, action);
     }
 }