Skip to content

Commit 10b3e46

Browse files
authored
Add a Client Toggle for StunVisuals (DeltaV-Station#5831)
* OneCommitOps * Update DCCVars.cs Signed-off-by: Sir Warock <67167466+SirWarock@users.noreply.github.com> --------- Signed-off-by: Sir Warock <67167466+SirWarock@users.noreply.github.com>
1 parent bfb6387 commit 10b3e46

8 files changed

Lines changed: 18 additions & 4 deletions

File tree

Content.Client/Stunnable/StunSystem.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
using System.Numerics;
2+
using Content.Shared._DV.CCVars; // DeltaV - Enable Stars via CVar.
23
using Content.Shared.CombatMode;
34
using Content.Shared.Interaction;
45
using Content.Shared.Stunnable;
56
using Robust.Client.Animations;
67
using Robust.Client.GameObjects;
78
using Robust.Shared.Animations;
9+
using Robust.Shared.Configuration; // DeltaV - Enable Stars via CVar.
810
using Robust.Shared.Input;
911
using Robust.Shared.Input.Binding;
1012
using Robust.Shared.Random;
@@ -13,6 +15,7 @@ namespace Content.Client.Stunnable;
1315

1416
public sealed class StunSystem : SharedStunSystem
1517
{
18+
[Dependency] private readonly IConfigurationManager _cfg = default!; // DeltaV - Enable Stars via CVar.
1619
[Dependency] private readonly SharedCombatModeSystem _combat = default!;
1720
[Dependency] private readonly IRobustRandom _random = default!;
1821
[Dependency] private readonly SpriteSystem _spriteSystem = default!;
@@ -78,6 +81,9 @@ private void UpdateAppearance(Entity<SpriteComponent?> entity, string state)
7881

7982
var visible = Appearance.TryGetData<bool>(entity, StunVisuals.SeeingStars, out var stars) && stars;
8083

84+
if (visible && !_cfg.GetCVar(DCCVars.ShowStunVisuals)) // DeltaV - Enable Stars via CVar.
85+
visible = false;
86+
8187
_spriteSystem.LayerSetVisible((entity, entity.Comp), index, visible);
8288
_spriteSystem.LayerSetRsiState((entity, entity.Comp), index, state);
8389
}

Content.Client/_DV/Options/UI/Tabs/DeltaTab.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
StyleClasses="LabelKeyText"/>
1010
<CheckBox Name="DisableFiltersCheckBox" Text="{Loc 'ui-options-no-filters'}" />
1111
<CheckBox Name="DisableGlimmerEffectCheckBox" Text="{Loc 'ui-options-disable-glimmer-effect'}" />
12+
<CheckBox Name="EnableStunVisualsCheckBox" Text="{Loc 'ui-options-enable-stun-visuals'}" />
1213
<Label Text="{Loc 'ui-options-delta-tips'}"
1314
StyleClasses="LabelKeyText"/>
1415
<CheckBox Name="DisableTipsCheckBox" Text="{Loc 'ui-options-delta-disable-tips'}" />

Content.Client/_DV/Options/UI/Tabs/DeltaTab.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public DeltaTab()
1818

1919
Control.AddOptionCheckBox(DCCVars.NoVisionFilters, DisableFiltersCheckBox);
2020
Control.AddOptionCheckBox(DCCVars.DisableGlimmerShader, DisableGlimmerEffectCheckBox);
21+
Control.AddOptionCheckBox(DCCVars.ShowStunVisuals, EnableStunVisualsCheckBox);
2122
Control.AddOptionCheckBox(DCCVars.DisableTips, DisableTipsCheckBox);
2223

2324
ResetTipsButton.OnPressed += _ => OnResetTipsPressed();

Content.Shared/_DV/CCVars/DCCVars.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ public sealed partial class DCCVars
130130
public static readonly CVarDef<string> HiddenSpecies =
131131
CVarDef.Create("species.hidden", "Motorkind", CVar.SERVER | CVar.REPLICATED);
132132

133+
/// <summary>
134+
/// Whether a stunned entity will show the stun visuals (seeing stars effect) above their head.
135+
/// </summary>
136+
public static readonly CVarDef<bool> ShowStunVisuals =
137+
CVarDef.Create("game.see_stun_visuals", false, CVar.CLIENTONLY | CVar.ARCHIVE);
138+
133139
/*
134140
* Traits
135141
*/

Resources/Locale/en-US/_DV/escape-menu/options-menu.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ui-options-general-forknotice = Note: These settings are fork-specific and might
33
44
ui-options-no-filters = Disable species vision filters
55
ui-options-disable-glimmer-effect = Disable high glimmer shader effect
6+
ui-options-enable-stun-visuals = Enable the 'Seeing Stars' effect on stunned entities
67
78
## DeltaV NanoChat keybinds
89
ui-options-header-nano-chat = NanoChat

Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
acts: [ "Destruction" ]
4040
- type: ZombieImmune
4141
- type: ProtectedFromStepTriggers
42-
#- type: StunVisuals # DeltaV - No stars
42+
- type: StunVisuals
4343

4444
- type: entity
4545
abstract: true

Resources/Prototypes/Entities/Mobs/Species/base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
Asphyxiation: -1.0
295295
- type: FireVisuals
296296
alternateState: Standing
297-
#- type: StunVisuals # DeltaV - No stars
297+
- type: StunVisuals
298298
- type: CanDoCPR # DeltaV - Addition of CPR
299299
- type: PotentialPsionic # DeltaV - organic species can all be psionic
300300
- type: RevealRevenantOnCollide # DeltaV - passing through people reveal revenant

Resources/Prototypes/Entities/Mobs/base.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
- type: RequireProjectileTarget
4040
active: False
4141
- type: AnimatedEmotes # goob edit - animated emotes
42-
#- type: StunVisuals # DeltaV - No stars
4342

4443
# The progenitor. This should only container the most basic components possible.
4544
# Only put things on here if every mob *must* have it. This includes ghosts.
@@ -112,7 +111,7 @@
112111
- !type:VomitBehavior
113112
- type: RadiationReceiver
114113
- type: Stamina
115-
#- type: StunVisuals # DeltaV - No stars
114+
- type: StunVisuals
116115
- type: MobState
117116
- type: MobThresholds
118117
thresholds:

0 commit comments

Comments
 (0)