示例#1
0
        public override void Draw()
        {
            try
            {
                if (DedicatedServer || _lastDrawTick == Tick || _paused)
                {
                    return;
                }
                _lastDrawTick = Tick;
                DsUtil.Start("draw");

                CameraMatrix          = Session.Camera.WorldMatrix;
                CameraPos             = CameraMatrix.Translation;
                CameraFrustrum.Matrix = (Camera.ViewMatrix * Camera.ProjectionMatrix);

                if (HudUi.TexturesToAdd > 0)
                {
                    HudUi.DrawTextures();
                }

                if ((UiInput.PlayerCamera || UiInput.FirstPersonView || InGridAiBlock) && !InMenu && !Session.Config.MinimalHud && !MyAPIGateway.Gui.IsCursorVisible)
                {
                    if (WheelUi.WheelActive)
                    {
                        WheelUi.DrawWheel();
                    }
                    TargetUi.DrawTargetUi();
                }

                Av.Run();
                DsUtil.Complete("draw", true);
            }
            catch (Exception ex) { Log.Line($"Exception in SessionDraw: {ex}"); }
        }
示例#2
0
        public override void Draw()
        {
            try
            {
                if (SuppressWc || DedicatedServer || _lastDrawTick == Tick || _paused)
                {
                    return;
                }

                if (DebugLos)
                {
                    LosDebuging();
                }

                _lastDrawTick = Tick;
                DsUtil.Start("draw");
                CameraMatrix          = Session.Camera.WorldMatrix;
                CameraPos             = CameraMatrix.Translation;
                CameraFrustrum.Matrix = (Camera.ViewMatrix * Camera.ProjectionMatrix);
                var newFov = Camera.FovWithZoom;

                if (!MyUtils.IsEqual(newFov, CurrentFovWithZoom))
                {
                    FovChanged();
                }

                CurrentFovWithZoom = newFov;
                AspectRatio        = Camera.ViewportSize.X / Camera.ViewportSize.Y;
                AspectRatioInv     = Camera.ViewportSize.Y / Camera.ViewportSize.X;

                ScaleFov = Math.Tan(CurrentFovWithZoom * 0.5);

                if (!Session.Config.MinimalHud && InGridAiBlock)
                {
                    if (HudUi.TexturesToAdd > 0 || HudUi.KeepBackground)
                    {
                        HudUi.DrawTextures();
                    }

                    if ((UiInput.PlayerCamera || UiInput.FirstPersonView || UiInput.CameraBlockView) && !InMenu && !MyAPIGateway.Gui.IsCursorVisible && PlayerDummyTargets.ContainsKey(PlayerId))
                    {
                        TargetUi.DrawTargetUi();
                    }

                    if (HudUi.AgingTextures)
                    {
                        HudUi.DrawText();
                    }
                }

                Av.Run();
                DrawDisabledGuns();
                DsUtil.Complete("draw", true);
            }
            catch (Exception ex) { Log.Line($"Exception in SessionDraw: {ex}"); }
        }
示例#3
0
        public override void Draw()
        {
            try
            {
                if (SupressLoad || DedicatedServer || _lastDrawTick == Tick || _paused)
                {
                    return;
                }
                _lastDrawTick = Tick;
                DsUtil.Start("draw");
                CameraMatrix          = Session.Camera.WorldMatrix;
                CameraPos             = CameraMatrix.Translation;
                CameraFrustrum.Matrix = (Camera.ViewMatrix * Camera.ProjectionMatrix);
                var newFov = Camera.FovWithZoom;

                if (!MyUtils.IsEqual(newFov, CurrentFovWithZoom))
                {
                    FovChanged();
                }

                CurrentFovWithZoom = newFov;
                ScaleFov           = Math.Tan(CurrentFovWithZoom * 0.5);

                if (HudUi.TexturesToAdd > 0)
                {
                    HudUi.DrawTextures();
                }

                if ((UiInput.PlayerCamera || UiInput.FirstPersonView || InGridAiBlock) && !InMenu && !Session.Config.MinimalHud && !MyAPIGateway.Gui.IsCursorVisible)
                {
                    TargetUi.DrawTargetUi();
                }
                Av.Run();
                DsUtil.Complete("draw", true);
            }
            catch (Exception ex) { Log.Line($"Exception in SessionDraw: {ex}"); }
        }