From a21b52a79a6b415040ad2c5d4906b71c75e6d86a Mon Sep 17 00:00:00 2001 From: Rinary Date: Tue, 24 Mar 2026 23:21:22 +0200 Subject: [PATCH] Revert "Revert shooting 3.0 and (Hotfix) Migration.yml entry for removed Lionhunter Rifle (#3909)" This reverts commit 2b3982de31fca6d9e57381927a11a211f20e1935. # Conflicts: # Resources/Locale/en-US/_Starlight/escape-menu/ui/options-menu.ftl --- .../CombatMode/CombatModeIndicatorsOverlay.cs | 180 ++++++++++++---- Content.Client/CombatMode/CombatModeSystem.cs | 111 +++++++++- Content.Client/Options/UI/OptionsMenu.xaml | 12 +- Content.Client/Options/UI/OptionsMenu.xaml.cs | 14 +- .../Options/UI/Tabs/GraphicsTab.xaml | 56 +++-- .../Options/UI/Tabs/GraphicsTab.xaml.cs | 4 + Content.Client/Options/UI/Tabs/MiscTab.xaml | 33 ++- .../Options/UI/Tabs/MiscTab.xaml.cs | 27 +-- .../Weapons/Ranged/Systems/GunSystem.cs | 54 ++++- .../Options/UI/OptionsSightPreview.xaml | 16 ++ .../Options/UI/OptionsSightPreview.xaml.cs | 113 ++++++++++ .../_Starlight/Options/UI/Tabs/UITab.xaml | 79 +++++++ .../_Starlight/Options/UI/Tabs/UITab.xaml.cs | 194 ++++++++++++++++++ .../Weapons/Ranged/Systems/GunSystem.cs | 20 +- .../Weapons/Ranged/Components/GunComponent.cs | 8 + .../Components/GunWieldBonusComponent.cs | 14 ++ .../Weapons/Ranged/Systems/SharedGunSystem.cs | 38 ++++ .../Wieldable/SharedWieldableSystem.cs | 6 + .../CCVar/StarlightCCVars.Graphics.cs | 6 + .../CCVar/StarlightCCVars.Interface.cs | 13 -- .../_Starlight/CCVar/StarlightCCVars.UI.cs | 27 +++ .../_Starlight/CombatMode/SightPrototype.cs | 45 ++++ .../escape-menu/ui/options-menu.ftl | 14 ++ .../en-US/_Starlight/overlay/sights_melee.ftl | 2 + .../_Starlight/overlay/sights_ranged.ftl | 8 + .../_Starlight/overlay/sights_universal.ftl | 6 + .../_Starlight/ui-options/ui-options-tts.ftl | 15 -- .../en-US/escape-menu/ui/options-menu.ftl | 3 - .../Catalog/Fills/Lockers/heads.yml | 2 +- .../Catalog/Fills/Lockers/security.yml | 2 +- .../Weapons/Guns/Basic/base_wieldable.yml | 11 +- .../Objects/Weapons/Guns/Pistols/pistols.yml | 22 +- .../Weapons/Guns/Projectiles/hitscan.yml | 6 + .../Weapons/Guns/Revolvers/revolvers.yml | 14 +- .../Objects/Weapons/Guns/SMGs/smgs.yml | 4 +- .../Objects/Weapons/Guns/Snipers/snipers.yml | 17 +- .../Entities/Structures/Walls/walls.yml | 8 + .../Entities/Structures/base_structure.yml | 2 + .../Prototypes/Roles/Jobs/CentComm/cburn.yml | 2 +- .../Catalog/Fills/Crates/armory.yml | 2 +- .../Catalog/Fills/Lockers/security.yml | 2 +- .../VendingMachines/Inventories/salvage.yml | 4 +- .../_Starlight/Entities/Effects/weapon.yml | 55 +++++ .../Weapons/Guns/Battery/battery_guns.yml | 68 +++--- .../Objects/Weapons/Guns/LMGs/lmgs.yml | 7 +- .../Objects/Weapons/Guns/Pistols/pistols.yml | 144 +++++-------- .../Weapons/Guns/Projectiles/effects.yml | 24 --- .../Weapons/Guns/Projectiles/hitscan.yml | 28 ++- .../Objects/Weapons/Guns/Rifles/rifles.yml | 65 +----- .../Objects/Weapons/Guns/SMGs/smgs.yml | 9 +- .../Weapons/Guns/Shotguns/shotguns.yml | 1 - .../Objects/Weapons/Guns/Snipers/snipers.yml | 56 ++++- .../_Starlight/Overlay/sights_melee.yml | 17 ++ .../_Starlight/Overlay/sights_ranged.yml | 82 ++++++++ .../_Starlight/Overlay/sights_universal.yml | 53 +++++ .../SecuritySOP/HeadOfSecurity.xml | 2 +- .../crosshair_pointers.rsi/melee_sight.png | Bin 16635 -> 0 bytes .../Effects/bullet_hole.rsi/bullet_hole.png | Bin 0 -> 110 bytes .../Effects/bullet_hole.rsi/meta.json | 17 ++ .../Effects/impact_sparks.rsi/effect.png | Bin 0 -> 207 bytes .../Effects/impact_sparks.rsi/meta.json | 22 ++ .../Misc/crosshair_pointers.rsi/arrows.png | Bin 0 -> 228 bytes .../crosshair_pointers.rsi/arrows_dot.png | Bin 0 -> 270 bytes .../crosshair_pointers.rsi/arrows_outer.png | Bin 0 -> 217 bytes .../arrows_outer_double.png | Bin 0 -> 250 bytes .../Misc/crosshair_pointers.rsi/basic.png | Bin 0 -> 167 bytes .../Misc/crosshair_pointers.rsi/basic_dot.png | Bin 0 -> 167 bytes .../Misc/crosshair_pointers.rsi/brackets.png | Bin 0 -> 252 bytes .../Misc/crosshair_pointers.rsi/cross_dot.png | Bin 0 -> 291 bytes .../crosshair_pointers.rsi/cross_small.png | Bin 0 -> 184 bytes .../crosshair_pointers.rsi/cross_small2.png | Bin 0 -> 237 bytes .../Misc/crosshair_pointers.rsi/dot.png | Bin 0 -> 177 bytes .../crosshair_pointers.rsi/double_dot.png | Bin 0 -> 197 bytes .../crosshair_pointers.rsi/melee_sight.png | Bin 0 -> 621 bytes .../Misc/crosshair_pointers.rsi/meta.json | 143 +++++++++++++ .../Misc/crosshair_pointers.rsi/triple.png | Bin 0 -> 186 bytes .../crosshair_pointers.rsi/triple_dot.png | Bin 0 -> 251 bytes .../gun_bolt_sight.png | Bin .../crosshair_pointers_big.rsi}/gun_sight.png | Bin .../crosshair_pointers_big.rsi}/meta.json | 3 - Resources/_Starlight/migration.yml | 7 + git | 0 82 files changed, 1584 insertions(+), 435 deletions(-) create mode 100644 Content.Client/_Starlight/Options/UI/OptionsSightPreview.xaml create mode 100644 Content.Client/_Starlight/Options/UI/OptionsSightPreview.xaml.cs create mode 100644 Content.Client/_Starlight/Options/UI/Tabs/UITab.xaml create mode 100644 Content.Client/_Starlight/Options/UI/Tabs/UITab.xaml.cs delete mode 100644 Content.Shared/_Starlight/CCVar/StarlightCCVars.Interface.cs create mode 100644 Content.Shared/_Starlight/CombatMode/SightPrototype.cs create mode 100644 Resources/Locale/en-US/_Starlight/overlay/sights_melee.ftl create mode 100644 Resources/Locale/en-US/_Starlight/overlay/sights_ranged.ftl create mode 100644 Resources/Locale/en-US/_Starlight/overlay/sights_universal.ftl delete mode 100644 Resources/Locale/en-US/_Starlight/ui-options/ui-options-tts.ftl create mode 100644 Resources/Prototypes/_Starlight/Entities/Effects/weapon.yml delete mode 100644 Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/effects.yml create mode 100644 Resources/Prototypes/_Starlight/Overlay/sights_melee.yml create mode 100644 Resources/Prototypes/_Starlight/Overlay/sights_ranged.yml create mode 100644 Resources/Prototypes/_Starlight/Overlay/sights_universal.yml delete mode 100644 Resources/Textures/Interface/Misc/crosshair_pointers.rsi/melee_sight.png create mode 100644 Resources/Textures/_Starlight/Effects/bullet_hole.rsi/bullet_hole.png create mode 100644 Resources/Textures/_Starlight/Effects/bullet_hole.rsi/meta.json create mode 100644 Resources/Textures/_Starlight/Effects/impact_sparks.rsi/effect.png create mode 100644 Resources/Textures/_Starlight/Effects/impact_sparks.rsi/meta.json create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/arrows.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/arrows_dot.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/arrows_outer.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/arrows_outer_double.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/basic.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/basic_dot.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/brackets.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/cross_dot.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/cross_small.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/cross_small2.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/dot.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/double_dot.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/melee_sight.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/meta.json create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/triple.png create mode 100644 Resources/Textures/_Starlight/Interface/Misc/crosshair_pointers.rsi/triple_dot.png rename Resources/Textures/{Interface/Misc/crosshair_pointers.rsi => _Starlight/Interface/Misc/crosshair_pointers_big.rsi}/gun_bolt_sight.png (100%) rename Resources/Textures/{Interface/Misc/crosshair_pointers.rsi => _Starlight/Interface/Misc/crosshair_pointers_big.rsi}/gun_sight.png (100%) rename Resources/Textures/{Interface/Misc/crosshair_pointers.rsi => _Starlight/Interface/Misc/crosshair_pointers_big.rsi}/meta.json (85%) delete mode 100644 git diff --git a/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs b/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs index d852e20c4577..a1ca51d1184e 100644 --- a/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs +++ b/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs @@ -6,7 +6,14 @@ using Robust.Client.Input; using Robust.Client.UserInterface; using Robust.Shared.Enums; -using Robust.Shared.Utility; + +#region Starlight +using Content.Shared._Starlight.CombatMode; +using Robust.Shared.Prototypes; +using SixLabors.ImageSharp.PixelFormats; +using Robust.Shared.Graphics.RSI; +using Content.Client.Weapons.Ranged.Systems; +#endregion namespace Content.Client.CombatMode; @@ -23,42 +30,48 @@ public sealed class CombatModeIndicatorsOverlay : Overlay private readonly IEyeManager _eye; private readonly CombatModeSystem _combat; private readonly HandsSystem _hands = default!; - - private readonly Texture _gunSight; - private readonly Texture _gunBoltSight; - private readonly Texture _meleeSight; + private readonly IClyde _clyde = default!; // Starlight-edit + + #region Starlight + private readonly SightPrototype? _gunSight; + private readonly SightPrototype? _gunBoltSight; + private readonly SightPrototype? _meleeSight; + private readonly float? _scale; + private readonly float? _offset; + private readonly Color? _main; + private readonly Color? _second; + private readonly bool _rotation = true; + #endregion public override OverlaySpace Space => OverlaySpace.ScreenSpace; - public Color MainColor = Color.White.WithAlpha(0.3f); - public Color StrokeColor = Color.Black.WithAlpha(0.5f); - public float Scale = 0.6f; // 1 is a little big - - public CombatModeIndicatorsOverlay(IInputManager input, IEntityManager entMan, - IEyeManager eye, CombatModeSystem combatSys, HandsSystem hands) + public CombatModeIndicatorsOverlay(IInputManager input, IEntityManager entMan, IPrototypeManager prototypes, + IEyeManager eye, CombatModeSystem combatSys, HandsSystem hands, IClyde clyde, SightPrototype gunSight, SightPrototype meleeSight, float scale, float offset, Color main, Color second, bool rotation = true) // Starlight-edit { _inputManager = input; _entMan = entMan; _eye = eye; _combat = combatSys; _hands = hands; - - var spriteSys = _entMan.EntitySysManager.GetEntitySystem(); - _gunSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"), - "gun_sight")); - _gunBoltSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"), - "gun_bolt_sight")); - _meleeSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"), - "melee_sight")); + // Starlight-start: replace Texture to Proto + _gunSight = gunSight; + _meleeSight = meleeSight; + _clyde = clyde; + _scale = scale; + _offset = offset; + _main = main; + _second = second; + _rotation = rotation; + + if (_gunSight.BoltVariant != null) + prototypes.TryIndex(_gunSight.BoltVariant, out _gunBoltSight); + // Starlight-end } - protected override bool BeforeDraw(in OverlayDrawArgs args) - { - if (!_combat.IsInCombatMode()) - return false; - - return base.BeforeDraw(in args); - } + // Starlight-start: Make it lambda + protected override bool BeforeDraw(in OverlayDrawArgs args) + => !_combat.IsInCombatMode() ? false : base.BeforeDraw(in args); + // Starlight-end protected override void Draw(in OverlayDrawArgs args) { @@ -68,28 +81,121 @@ protected override void Draw(in OverlayDrawArgs args) return; var handEntity = _hands.GetActiveHandEntity(); - var isHandGunItem = _entMan.HasComponent(handEntity); + var isHandGunItem = _entMan.TryGetComponent(handEntity, out var gun); // Starlight-edit var isGunBolted = true; if (_entMan.TryGetComponent(handEntity, out ChamberMagazineAmmoProviderComponent? chamber)) isGunBolted = chamber.BoltClosed ?? true; - var mousePos = mouseScreenPosition.Position; var uiScale = (args.ViewportControl as Control)?.UIScale ?? 1f; var limitedScale = uiScale > 1.25f ? 1.25f : uiScale; - var sight = isHandGunItem ? (isGunBolted ? _gunSight : _gunBoltSight) : _meleeSight; - DrawSight(sight, args.ScreenHandle, mousePos, limitedScale * Scale); + #region Starlight + + var spriteSys = _entMan.EntitySysManager.GetEntitySystem(); + + var sight = isHandGunItem ? (isGunBolted || _gunBoltSight == null ? _gunSight : _gunBoltSight) : _meleeSight; + if (sight != null) + { + if (!sight.ShowCursor) + _clyde.SetCursor(_clyde.CreateCursor(new SixLabors.ImageSharp.Image(32, 32), Vector2i.Zero)); + else + _clyde.SetCursor(null); + + var scale = limitedScale * Math.Clamp(_scale ?? 0.6f, 0f, 1f); + + var eyePos = _eye.CurrentEye.Position; + var eyeScreen = _eye.MapToScreen(eyePos); + var rot = MathF.Atan2(eyeScreen.Y - mousePos.Y, eyeScreen.X - mousePos.X); + rot -= MathF.PI / 2f; + var rsiState = spriteSys.RsiStateLike(sight.Sprite); + if (rsiState.IsAnimated && rsiState.AnimationFrameCount >= 3) + { + + var currentAngle = 0f; + if (isHandGunItem && handEntity != null) + currentAngle = (float)_entMan.System().GetCurrentAngle(handEntity.Value).Degrees; + + var bracket1 = rsiState.GetFrame(RsiDirection.South, 0); // Left + var sightTexture = rsiState.GetFrame(RsiDirection.South, 1); // Center + var bracket2 = rsiState.GetFrame(RsiDirection.South, 2); // Right + + Texture? bracket3 = null; // Down + Texture? bracket4 = null; // Up + + if (rsiState.AnimationFrameCount >= 4) + bracket3 = rsiState.GetFrame(RsiDirection.South, 3); + + if (rsiState.AnimationFrameCount >= 5) + bracket4 = rsiState.GetFrame(RsiDirection.South, 4); + + var offset = CalculateOffset(currentAngle, (eyeScreen.Position - mousePos).Length(), scale); + DrawSightPartial(sightTexture, bracket1, bracket2, args.ScreenHandle, rot, mousePos, scale,_main ?? sight.MainColor,_second ?? sight.StrokeColor, offset, bracket3, bracket4); + } + else + { + var sightTexture = spriteSys.Frame0(sight.Sprite); + DrawOverlayPart(sightTexture, args.ScreenHandle, mousePos, scale, _main ?? sight.MainColor, _second ?? sight.StrokeColor); + } + } + + #endregion + } + + #region Starlight + private float CalculateOffset(float currentAngle, float distance, float scale) + { + var angleRad = currentAngle * MathF.PI / 180f; + var offset = MathF.Tan(angleRad) * distance; + offset *= scale; + // So if slider is in center: 0.5 + 0.5 = 1, meaning no change. If slider is at minimum: 0 + 0.5 = 0.5, meaning offset is halved. If slider is at maximum: 1 + 0.5 = 1.5, meaning offset is increased by 50%. + offset *= (_offset ?? 0.5f) + 0.5f; + return offset; + } + + private void DrawSightPartial(Texture sight, Texture bracket1, Texture bracket2, DrawingHandleScreen screen, float rotation, Vector2 centerPos, float scale, Color mainColor, Color strokeColor, float offset, Texture? bracket3 = null, Texture? bracket4 = null) + { + DrawOverlayPart(sight, screen, centerPos, scale, mainColor, strokeColor); + + var bracketSize1 = bracket1.Size * scale; + var bracketSize2 = bracket2.Size * scale; + + if (_rotation) + screen.SetTransform(Matrix3x2.CreateRotation(rotation, centerPos)); + + var bracket1Pos = centerPos + new Vector2(-offset - bracketSize1.X * 0.5f, 0f); + var bracket2Pos = centerPos + new Vector2(offset + bracketSize2.X * 0.5f, 0f); + DrawOverlayPart(bracket1, screen, bracket1Pos, scale, mainColor, strokeColor); + DrawOverlayPart(bracket2, screen, bracket2Pos, scale, mainColor, strokeColor); + + if (bracket3 != null) + { + var bracket3Pos = centerPos + new Vector2(0f, offset + bracketSize1.Y * 0.5f); + DrawOverlayPart(bracket3, screen, bracket3Pos, scale, mainColor, strokeColor); + } + + if (bracket4 != null) + { + var bracket4Pos = centerPos + new Vector2(0f, -offset - bracketSize2.Y * 0.5f); + DrawOverlayPart(bracket4, screen, bracket4Pos, scale, mainColor, strokeColor); + } } - private void DrawSight(Texture sight, DrawingHandleScreen screen, Vector2 centerPos, float scale) + private static void DrawOverlayPart(Texture texture, DrawingHandleScreen screen, Vector2 position, float scale, Color mainColor, Color strokeColor) { - var sightSize = sight.Size * scale; - var expandedSize = sightSize + new Vector2(7f, 7f); + var size = texture.Size * scale; + screen.DrawTextureRect(texture, + UIBox2.FromDimensions(position - size * 0.5f, size), strokeColor); + screen.DrawTextureRect(texture, + UIBox2.FromDimensions(position - size * 0.5f - new Vector2(3f, 3f), size + new Vector2(7f, 7f)), mainColor); + } - screen.DrawTextureRect(sight, - UIBox2.FromDimensions(centerPos - sightSize * 0.5f, sightSize), StrokeColor); - screen.DrawTextureRect(sight, - UIBox2.FromDimensions(centerPos - expandedSize * 0.5f, expandedSize), MainColor); + private sealed class DummyCursor : ICursor + { + public void Dispose() + { + } } + + #endregion } diff --git a/Content.Client/CombatMode/CombatModeSystem.cs b/Content.Client/CombatMode/CombatModeSystem.cs index 2c938b1b9378..3a91d7186584 100644 --- a/Content.Client/CombatMode/CombatModeSystem.cs +++ b/Content.Client/CombatMode/CombatModeSystem.cs @@ -7,6 +7,12 @@ using Robust.Client.Player; using Robust.Shared.Configuration; +#region Starlight +using Content.Shared._Starlight.CombatMode; +using Content.Shared.Starlight.CCVar; +using Robust.Shared.Prototypes; +#endregion + namespace Content.Client.CombatMode; public sealed class CombatModeSystem : SharedCombatModeSystem @@ -16,12 +22,27 @@ public sealed class CombatModeSystem : SharedCombatModeSystem [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IInputManager _inputManager = default!; [Dependency] private readonly IEyeManager _eye = default!; + #region Starlight + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IClyde _clyde = default!; + #endregion /// /// Raised whenever combat mode changes. /// public event Action? LocalPlayerCombatModeUpdated; + #region Starlight + private bool _lastState = false; + private string _rangedSight = "GunSight"; + private string _meleeSight = "MeleeSight"; + private float _scale = 0.6f; + private float _offset = 0.5f; + private bool _rotation = true; + private Color _main = Color.White.WithAlpha(0.3f); + private Color _second = Color.Black.WithAlpha(0.5f); + #endregion + public override void Initialize() { base.Initialize(); @@ -29,6 +50,15 @@ public override void Initialize() SubscribeLocalEvent(OnHandleState); Subs.CVar(_cfg, CCVars.CombatModeIndicatorsPointShow, OnShowCombatIndicatorsChanged, true); + // Starlight-start + Subs.CVar(_cfg, StarlightCCVars.RangedSight, OnRangedSightChanged, true); + Subs.CVar(_cfg, StarlightCCVars.RangedSightScale, OnRangedSightScaleChanged, true); + Subs.CVar(_cfg, StarlightCCVars.RangedSightOffset, OnRangedSightOffsetChanged, true); + Subs.CVar(_cfg, StarlightCCVars.SightMainColor, OnSightMainColorChanged, true); + Subs.CVar(_cfg, StarlightCCVars.SightSecondColor, OnSightSecondColorChanged, true); + Subs.CVar(_cfg, StarlightCCVars.MeleeSight, OnMeleeSightChanged, true); + Subs.CVar(_cfg, StarlightCCVars.SightRotation, OnRotationChanged, true); + // Starlight-end } private void OnHandleState(EntityUid uid, CombatModeComponent component, ref AfterAutoHandleStateEvent args) @@ -72,23 +102,88 @@ private void UpdateHud(EntityUid entity) } var inCombatMode = IsInCombatMode(); + // Starlight-start + if (!inCombatMode) + _clyde.SetCursor(null); + // Starlight-end LocalPlayerCombatModeUpdated?.Invoke(inCombatMode); } - private void OnShowCombatIndicatorsChanged(bool isShow) + private void OnShowCombatIndicatorsChanged(bool isShow) // Starlight-edit: moved into another method + => UpdateCombatIndicators(isShow); + + #region Starlight + + private void OnRangedSightChanged(string sight) + { + _rangedSight = sight; + UpdateCombatIndicators(); + } + + private void OnRangedSightScaleChanged(int scale) + { + float fScale = scale * 0.01f; + _scale = fScale; + UpdateCombatIndicators(); + } + + private void OnRangedSightOffsetChanged(int offset) + { + float fOffset = offset * 0.01f; + _offset = fOffset; + UpdateCombatIndicators(); + } + + private void OnSightMainColorChanged(string color) + { + _main = Color.FromHex(color).WithAlpha(0.3f); + UpdateCombatIndicators(); + } + + private void OnSightSecondColorChanged(string color) { - if (isShow) + _second = Color.FromHex(color).WithAlpha(0.5f); + UpdateCombatIndicators(); + } + + private void OnMeleeSightChanged(string sight) + { + _meleeSight = sight; + UpdateCombatIndicators(); + } + + private void OnRotationChanged(bool rotation) + { + _rotation = rotation; + UpdateCombatIndicators(); + } + + private void UpdateCombatIndicators(bool? isShow = null) + { + if (isShow != null && isShow != _lastState) + _lastState = isShow.Value; + + if ((isShow == null || !_lastState) && _overlayManager.HasOverlay()) + _overlayManager.RemoveOverlay(); + if ((isShow == null || _lastState) && _prototypeManager.TryIndex(_rangedSight, out var ranged) && _prototypeManager.TryIndex(_meleeSight, out var melee)) { _overlayManager.AddOverlay(new CombatModeIndicatorsOverlay( _inputManager, EntityManager, + _prototypeManager, _eye, this, - EntityManager.System())); - } - else - { - _overlayManager.RemoveOverlay(); + EntityManager.System(), + _clyde, + ranged, + melee, + _scale, + _offset, + _main, + _second, + _rotation)); } } -} + + #endregion +} \ No newline at end of file diff --git a/Content.Client/Options/UI/OptionsMenu.xaml b/Content.Client/Options/UI/OptionsMenu.xaml index 21c4b64ce8fa..4c0536f10866 100644 --- a/Content.Client/Options/UI/OptionsMenu.xaml +++ b/Content.Client/Options/UI/OptionsMenu.xaml @@ -1,9 +1,13 @@ - + + + diff --git a/Content.Client/Options/UI/OptionsMenu.xaml.cs b/Content.Client/Options/UI/OptionsMenu.xaml.cs index 9efd04fd0b81..b745b665d7bb 100644 --- a/Content.Client/Options/UI/OptionsMenu.xaml.cs +++ b/Content.Client/Options/UI/OptionsMenu.xaml.cs @@ -15,12 +15,15 @@ public OptionsMenu() RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); + // Starlight-edit: UI Tab Tabs.SetTabTitle(0, Loc.GetString("ui-options-tab-misc")); - Tabs.SetTabTitle(1, Loc.GetString("ui-options-tab-graphics")); - Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-controls")); - Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-audio")); - Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-accessibility")); - Tabs.SetTabTitle(5, Loc.GetString("ui-options-tab-admin")); + Tabs.SetTabTitle(1, Loc.GetString("ui-options-tab-ui")); + Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-graphics")); + Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-controls")); + Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-audio")); + Tabs.SetTabTitle(5, Loc.GetString("ui-options-tab-accessibility")); + Tabs.SetTabTitle(6, Loc.GetString("ui-options-tab-admin")); + // Starlight-end UpdateTabs(); } @@ -32,6 +35,7 @@ public void UpdateTabs() GraphicsTab.Control.ReloadValues(); MiscTab.Control.ReloadValues(); + UITab.Control.ReloadValues(); // Starlight-edit: UI Tab AccessibilityTab.Control.ReloadValues(); AudioTab.Control.ReloadValues(); AdminOptionsTab.Control.ReloadValues(); diff --git a/Content.Client/Options/UI/Tabs/GraphicsTab.xaml b/Content.Client/Options/UI/Tabs/GraphicsTab.xaml index fcda72d94bd6..82b56894b50c 100644 --- a/Content.Client/Options/UI/Tabs/GraphicsTab.xaml +++ b/Content.Client/Options/UI/Tabs/GraphicsTab.xaml @@ -1,39 +1,51 @@ - + - - - diff --git a/Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs b/Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs index 36d58c6c9f3d..6ce1ba4067bf 100644 --- a/Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs @@ -70,7 +70,11 @@ public GraphicsTab() Control.AddOption(new OptionIntegerScaling(Control, _cfg, IntegerScalingCheckBox)); Control.AddOptionCheckBox(CCVars.ViewportScaleRender, ViewportLowResCheckBox, invert: true); Control.AddOptionCheckBox(CCVars.ParallaxLowQuality, ParallaxLowQualityCheckBox); + // Starlight-start Control.AddOptionCheckBox(StarlightCCVars.TracesEnabled, TracesCheckBox); + Control.AddOptionCheckBox(StarlightCCVars.HolesEnabled, HolesCheckBox); + Control.AddOptionCheckBox(StarlightCCVars.SparksEnabled, SparksCheckBox); + // Starlight-end Control.AddOptionCheckBox(CCVars.HudFpsCounterVisible, FpsCounterCheckBox); Control.Initialize(); diff --git a/Content.Client/Options/UI/Tabs/MiscTab.xaml b/Content.Client/Options/UI/Tabs/MiscTab.xaml index 1f56c4f465a2..ff5357c6cd61 100644 --- a/Content.Client/Options/UI/Tabs/MiscTab.xaml +++ b/Content.Client/Options/UI/Tabs/MiscTab.xaml @@ -1,30 +1,25 @@ - + - - -