コード例 #1
0
            public WarningLine(MySimpleProfiler.PerformanceWarning warning, MyGuiScreenPerformanceWarnings screen)
            {
                Parent        = new MyGuiControlParent();
                m_name        = new MyGuiControlLabel(text: Truncate(warning.Block.DisplayName), position: new Vector2(-0.43f, 0), originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, font: VRage.Game.MyFontEnum.Red);
                m_description = new MyGuiControlLabel
                                (
                    text: String.IsNullOrEmpty(warning.Block.Description.String) ? MyTexts.GetString(MyCommonTexts.PerformanceWarningTooManyBlocks) : MyTexts.GetString(warning.Block.Description),
                    position: new Vector2(-0.24f, 0),
                    originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER
                                );
                m_separator = new MyGuiControlSeparatorList();
                Parent.Size = new Vector2(Parent.Size.X, m_description.Size.Y);
                m_separator.AddVertical(new Vector2(-0.25f, -Parent.Size.Y / 2 - 0.006f), Parent.Size.Y + 0.016f);
                m_separator.AddVertical(new Vector2(0.35f, -Parent.Size.Y / 2 - 0.006f), Parent.Size.Y + 0.016f);
                m_time = new MyGuiControlLabel(position: new Vector2(0.43f, 0), originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER);

                switch (warning.Block.type)
                {
                case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.GRAPHICS:
                    screen.m_areaTitleGraphics.Warnings.Add(this);
                    break;

                case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.BLOCK:
                    screen.m_areaTitleBlocks.Warnings.Add(this);
                    break;

                case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.OTHER:
                    screen.m_areaTitleOther.Warnings.Add(this);
                    break;
                }
                this.Warning = warning;
            }
コード例 #2
0
            public WarningLine(MySimpleProfiler.PerformanceWarning warning, MyGuiScreenPerformanceWarnings screen)
            {
                Parent = new MyGuiControlParent();
                m_name = new MyGuiControlLabel(text: Truncate(warning.Block.DisplayName), position: new Vector2(-0.43f, 0), originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, font: VRage.Game.MyFontEnum.Red);
                m_description = new MyGuiControlLabel
                    (
                    text: String.IsNullOrEmpty(warning.Block.Description.String) ? MyTexts.GetString(MyCommonTexts.PerformanceWarningTooManyBlocks) : MyTexts.GetString(warning.Block.Description), 
                    position: new Vector2(-0.24f, 0), 
                    originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER
                    );
                m_separator = new MyGuiControlSeparatorList();
                Parent.Size = new Vector2(Parent.Size.X, m_description.Size.Y);
                m_separator.AddVertical(new Vector2(-0.25f, -Parent.Size.Y / 2 - 0.006f), Parent.Size.Y + 0.016f);
                m_separator.AddVertical(new Vector2(0.35f, -Parent.Size.Y / 2 - 0.006f), Parent.Size.Y + 0.016f);
                m_time = new MyGuiControlLabel(position: new Vector2(0.43f, 0), originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER);

                switch (warning.Block.type)
                {
                    case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.GRAPHICS:
                        screen.m_areaTitleGraphics.Warnings.Add(this);
                        break;
                    case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.BLOCK:
                        screen.m_areaTitleBlocks.Warnings.Add(this);
                        break;
                    case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.OTHER:
                        screen.m_areaTitleOther.Warnings.Add(this);
                        break;
                }
                this.Warning = warning;
            }