Skip to content

Commit

Permalink
Merge pull request #141 from RedFoxIV/360noscope
Browse files Browse the repository at this point in the history
mom get the camera
  • Loading branch information
Spatison authored Dec 6, 2024
2 parents d68e48f + 52ed4f9 commit 5adfe75
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Content.Shared/CombatMode/CombatModeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,19 @@ public sealed partial class CombatModeComponent : Component
/// </summary>
[DataField, AutoNetworkedField]
public bool ToggleMouseRotator = true;

// WD EDIT START
/// <summary>
/// If true, sets <see cref="MouseRotatorComponent.AngleTolerance"/> to 1 degree and <see cref="MouseRotatorComponent.Simple4DirMode"/>
/// to false when the owner enters combatmode. This is currently being tested as of 06.12.24,
/// so a simple bool switch should suffice.
/// Leaving AutoNetworking just in case shitmins need to disable it for someone. Will only take effect when re-enabling combat mode.
/// </summary>
/// <remarks>
/// No effect if <see cref="ToggleMouseRotator"/> is false.
/// </remarks>
[DataField, AutoNetworkedField]
public bool SmoothRotation = true;
// WD EDIT END
}
}
9 changes: 8 additions & 1 deletion Content.Shared/CombatMode/SharedCombatModeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ private void SetMouseRotatorComponents(EntityUid uid, bool value)
{
if (value)
{
EnsureComp<MouseRotatorComponent>(uid);
var rot = EnsureComp<MouseRotatorComponent>(uid);
// WD EDIT START
if (TryComp<CombatModeComponent>(uid, out var comp) && comp.SmoothRotation) // no idea under which (intended) circumstances this can fail (if any), so i'll avoid Comp<>().
{
rot.AngleTolerance = Angle.FromDegrees(1); // arbitrary
rot.Simple4DirMode = false;
}
// WD EDIT END
EnsureComp<NoRotateOnMoveComponent>(uid);
}
else
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/MouseRotator/MouseRotatorComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;

Expand Down

0 comments on commit 5adfe75

Please sign in to comment.