Esempio n. 1
0
 public MyNotification(String notificationText, MyGuiScreenGamePlayType LifeArea, float scale,
                       MyGuiFont font,
                       MyGuiDrawAlignEnum textAlign, int disapearTimeMs, MyEntity owner = null, bool showConfirmMessage = false,
                       object[] textFormatArguments = null)
     : this(0, notificationText, LifeArea, scale, font, textAlign, disapearTimeMs, owner, showConfirmMessage, textFormatArguments)
 {
 }
Esempio n. 2
0
            private MyNotification(int notificationTextId, string notificationString, MyGuiScreenGamePlayType LifeArea, float scale,
                                   MyGuiFont font,
                                   MyGuiDrawAlignEnum textAlign, int disapearTimeMs, MyEntity owner, bool showConfirmMessage = false,
                                   object[] textFormatArguments = null)
            {
                Owner                = owner;
                m_originalText       = notificationString;
                m_notificationText   = notificationString;
                m_notificationTextID = (int)notificationTextId;
                m_isTextDirty        = false;

                // always false:
                m_isDisappeared = false;

                m_actualScale     = scale;
                m_actualFont      = font;
                m_actualTextAlign = textAlign;

                m_textFormatArguments = textFormatArguments;

                // timing:
                m_disappearTimeMs = disapearTimeMs;
                m_aliveTime       = 0;

                // life space;
                m_lifeSpace = LifeArea;

                // show standart message?
                m_showConfirmMessage = showConfirmMessage;
            }
Esempio n. 3
0
 public MyMessageBoxConfiguration(MyTexture2D texture, Vector4 textColor, Vector4 backgroundColor, Vector4 buttonColor, Vector4 rotatingWheelColor, Vector4 interferenceVideoColor, MyGuiFont font, MyTexture2D buttonTexture)
 {
     Texture                = texture;
     TextColor              = textColor;
     BackgroundColor        = backgroundColor;
     ButtonColor            = buttonColor;
     RotatingWheelColor     = rotatingWheelColor;
     InterferenceVideoColor = interferenceVideoColor;
     Font          = font;
     ButtonTexture = buttonTexture;
 }
Esempio n. 4
0
 public MySolarSystemMapNavigationMark(MyMwcVector3Int sector, string name, MyMissionID?missionID, Color color, MyTransparentMaterialEnum texture)
 {
     Sector           = sector;
     Name             = name;
     Color            = color;
     Texture          = texture;
     Importance       = 1;
     DrawVerticalLine = true;
     MissionID        = missionID;
     Font             = MyGuiManager.GetFontMinerWarsWhite();
 }
Esempio n. 5
0
        //  IMPORTANT: This class isn't initialized by constructor, but by Start() because it's supposed to be used in memory pool
        public void Start(MyGuiFont font, Vector2 position, Color color, float scale, MyGuiDrawAlignEnum alignement)
        {
            Font       = font;
            Position   = position;
            Color      = color;
            Scale      = scale;
            Alignement = alignement;

            //  Clear current text
            MyMwcUtils.ClearStringBuilder(m_text);
        }
Esempio n. 6
0
 public void Display(object[] parameters)
 {
     if (Text != null)
     {
         MyGuiFont font = GetFontDelegate();
         MyHudNotification.MyNotification notification = new MyHudNotification.MyNotification(Text.Value, font, 5000, null, parameters);
         MyHudNotification.AddNotification(notification);
     }
     if (SoundCue != null)
     {
         MyAudio.AddCue2D(SoundCue.Value);
     }
 }
Esempio n. 7
0
        // initialize:
        public static void LoadContent()
        {
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyHudNotification::LoadContent");

            m_usedFont = MyGuiManager.GetFontMinerWarsWhite();
            if (m_screenNotifications == null)
            {
                int allScreensCount = (int)MyGuiScreenGamePlayType.ALL_SCREEN_COUNT;
                m_screenNotifications = new MyScreenNotifications[allScreensCount];
                for (int i = 0; i < allScreensCount; ++i)
                {
                    m_screenNotifications[i] = new MyScreenNotifications();
                }
            }
            m_fogColor   = MyGuiConstants.SELECT_AMMO_TIP_BACKGROUND_FADE_COLOR;
            m_fogColor.A = (byte)(m_fogColor.A * 0.85f);

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock();
        }
Esempio n. 8
0
 public MyNotification(MyTextsWrapperEnum notificationText, MyGuiFont font, MyEntity owner = null)
     : this(notificationText, GetCurrentScreen(), 1.0f, font, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, DONT_DISAPEAR, owner)
 {
 }
Esempio n. 9
0
 public MyNotification(string notificationText, MyGuiFont font, int disapearTimeMs, MyEntity owner = null, object[] textFormatArguments = null)
     : this(notificationText, GetCurrentScreen(), 1.0f, font, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, disapearTimeMs, owner, false, textFormatArguments)
 {
 }
Esempio n. 10
0
 public MyNotification(string notificationText, MyGuiFont font, MyEntity owner = null, bool showConfirmMessage = false)
     : this(notificationText, GetCurrentScreen(), 1.0f, font, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, DONT_DISAPEAR, owner)
 {
     m_showConfirmMessage = showConfirmMessage;
 }
Esempio n. 11
0
 /// <summary>
 /// Creates new instance with text's color
 /// </summary>
 /// <param name="text">Warning text</param>
 /// <param name="textFont">Text's font</param>
 public MyHudTextWarning(StringBuilder text, MyGuiFont textFont)
 {
     Text     = text;
     TextFont = textFont;
 }
Esempio n. 12
0
 /// <summary>
 /// Creates new instance with text's font
 /// </summary>
 /// <param name="text">Warning text</param>
 /// <param name="textFont">Text's font</param>
 public MyHudTextWarning(MyTextsWrapperEnum text, MyGuiFont textFont)
     : this(MyTextsWrapper.Get(text), textFont)
 {
 }
Esempio n. 13
0
        protected void AddLabel(StringBuilder text, Vector4 color, float scale, List <MyGuiControlBase> controlGroup = null, MyGuiFont font = null)
        {
            MyGuiControlLabel label = new MyGuiControlLabel(this, m_currentPosition, null, text, color, MyGuiConstants.LABEL_TEXT_SCALE * MyGuiConstants.DEBUG_LABEL_TEXT_SCALE * scale * m_scale,
                                                            MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, font);
            float labelWidth = label.GetTextSize().Size.X + 0.02f;

            m_maxWidth = Math.Max(m_maxWidth, labelWidth);
            Controls.Add(label);

            m_currentPosition.Y += 0.04f * m_scale;

            if (controlGroup != null)
            {
                controlGroup.Add(label);
            }
        }