void DrawTrashAdminView()
        {
            float metric;
            var   state = MyTrashRemoval.GetTrashState(m_grid, MyTrashRemoval.PreviewSettings);
            var   color = Color.Green;
            var   aabb  = m_grid.PositionComp.WorldAABB;

            if (state != MyTrashRemovalFlags.None)
            {
                color = Color.Red;
                string name = MyTrashRemoval.GetName(state);

                if (state == MyTrashRemovalFlags.WithBlockCount)
                {
                    name = string.Format(name, MyTrashRemoval.PreviewSettings.BlockCountThreshold);
                    if (m_grid.BlocksCount < MyTrashRemoval.PreviewSettings.BlockCountThreshold)
                    {
                        color = Color.Green;
                    }
                }
                else if (state == MyTrashRemovalFlags.DistanceFromPlayer)
                {
                    name = string.Format(name, MyTrashRemoval.PreviewSettings.PlayerDistanceThreshold);
                }

                MyRenderProxy.DebugDrawText3D(aabb.Center, name, color, 0.7f, false, VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);
            }
            MyRenderProxy.DebugDrawAABB(aabb, color, 1, 1, false);
        }
Exemplo n.º 2
0
        protected void AddTrashCheckbox(MyTrashRemovalFlags flag, bool enabled, List <MyGuiControlBase> controlGroup = null, Vector4?color = null, Vector2?checkBoxOffset = null)
        {
            string name = string.Format(MyTrashRemoval.GetName(flag), String.Empty);

            AddCheckBox(name, (MyTrashRemoval.PreviewSettings.Flags & flag) == flag, c => OnFlagChanged(flag, c.IsChecked), enabled, controlGroup, color, checkBoxOffset);
        }