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}"); } }
public Session() { UiInput = new UiInput(this); HudUi = new Hud(this); TargetUi = new TargetUi(this); DsUtil = new DSUtils(this); DsUtil2 = new DSUtils(this); StallReporter = new StallReporter(); InnerStallReporter = new StallReporter(); Av = new RunAv(this); Api = new ApiBackend(this); ApiServer = new ApiServer(this); Projectiles = new Projectiles.Projectiles(this); AcqManager = new AcquireManager(this); TerminalMon = new TerminalMonitor(this); _cachedEwarPacket.Data = new List <EwarValues>(32); ProblemRep = new ProblemReport(this); VisDirToleranceCosine = Math.Cos(MathHelper.ToRadians(VisDirToleranceAngle)); AimDirToleranceCosine = Math.Cos(MathHelper.ToRadians(AimDirToleranceAngle)); VoxelCaches[ulong.MaxValue] = new VoxelCache(); HeatEmissives = CreateHeatEmissive(); LoadVanillaData(); for (int i = 0; i < AuthorSettings.Length; i++) { AuthorSettings[i] = -1; } }
internal void TargetSelection() { if ((UiInput.AltPressed && UiInput.ShiftReleased || TargetUi.DrawReticle && UiInput.ClientInputState.MouseButtonRight) && InGridAiBlock) { TrackingAi.Construct.Focus.RequestReleaseActive(TrackingAi); } if (UiInput.ActionKeyReleased && TrackingAi.Construct.Data.Repo.FocusData.HasFocus && InGridAiBlock) { TrackingAi.Construct.Focus.RequestAddLock(TrackingAi); } if (InGridAiBlock) { if ((TargetUi.DrawReticle || UiInput.FirstPersonView) && MyAPIGateway.Input.IsNewLeftMouseReleased()) { TargetUi.SelectTarget(); } else { if (UiInput.CurrentWheel != UiInput.PreviousWheel) { TargetUi.SelectNext(); } else if (UiInput.LongShift || UiInput.ShiftReleased && !UiInput.LongShift) { TrackingAi.Construct.Focus.RequestNextActive(UiInput.LongShift, TrackingAi); } } } }
public Session() { UiInput = new UiInput(this); TargetUi = new TargetUi(this); WheelUi = new Wheel(this); HudUi = new Hud(this); DsUtil = new DSUtils(this); DsUtil2 = new DSUtils(this); StallReporter = new StallReporter(this); Av = new RunAv(this); Api = new ApiBackend(this); ApiServer = new ApiServer(this); Projectiles = new Projectiles.Projectiles(this); Proccessor = new NetworkProccessor(this); VisDirToleranceCosine = Math.Cos(MathHelper.ToRadians(VisDirToleranceAngle)); AimDirToleranceCosine = Math.Cos(MathHelper.ToRadians(AimDirToleranceAngle)); HeatEmissives = CreateHeatEmissive(); LoadVanillaData(); CoreWorkOpt.TaskType = CastProhibit(CoreWorkOpt.TaskType, 5); CoreWorkOpt.MaximumThreads = 1; foreach (var suit in (PacketType[])Enum.GetValues(typeof(PacketType))) { PacketPools.Add(suit, new MyConcurrentPool <Packet>(128, packet => packet.CleanUp())); } }
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}"); } }
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}"); } }
private void FovChanged() { HudUi.NeedsUpdate = true; TargetUi.ResetCache(); }