a (#655)
This commit is contained in:
parent
62a45ac6b1
commit
ae78fa1048
5 changed files with 38 additions and 2 deletions
|
|
@ -31,6 +31,7 @@
|
|||
<!-- Misc -->
|
||||
<Label Text="{Loc 'ui-options-misc-label'}" StyleClasses="LabelKeyText"/>
|
||||
<CheckBox Name="FpsCounterCheckBox" Text="{Loc 'ui-options-fps-counter'}" />
|
||||
<CheckBox Name="ShowFootprintsCheckBox" Text="{Loc 'ui-options-show-footprints'}" />
|
||||
</BoxContainer>
|
||||
</ScrollContainer>
|
||||
<ui:OptionsTabControlRow Name="Control" Access="Public" />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Content.Shared.CCVar;
|
||||
using Content.Shared._Sunrise.SunriseCCVars;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
|
|
@ -60,6 +61,7 @@ public sealed partial class GraphicsTab : Control
|
|||
Control.AddOptionCheckBox(CCVars.ViewportScaleRender, ViewportLowResCheckBox, invert: true);
|
||||
Control.AddOptionCheckBox(CCVars.ParallaxLowQuality, ParallaxLowQualityCheckBox);
|
||||
Control.AddOptionCheckBox(CCVars.HudFpsCounterVisible, FpsCounterCheckBox);
|
||||
Control.AddOptionCheckBox(SunriseCCVars.ShowFootprints, ShowFootprintsCheckBox);
|
||||
|
||||
Control.Initialize();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using Content.Shared._Sunrise.Footprints;
|
||||
using Content.Shared._Sunrise.Footprints;
|
||||
using Content.Shared._Sunrise.SunriseCCVars;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Client._Sunrise.Footprints;
|
||||
|
|
@ -12,16 +14,31 @@ public sealed class FootprintVisualizerSystem : VisualizerSystem<FootprintCompon
|
|||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
|
||||
private bool _showFootprints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_cfg.OnValueChanged(SunriseCCVars.ShowFootprints, OnShowFootprintsChanged, true);
|
||||
|
||||
SubscribeLocalEvent<FootprintComponent, ComponentInit>(OnFootprintInitialized);
|
||||
SubscribeLocalEvent<FootprintComponent, ComponentShutdown>(OnFootprintShutdown);
|
||||
}
|
||||
|
||||
private void OnShowFootprintsChanged(bool value)
|
||||
{
|
||||
_showFootprints = value;
|
||||
var query = EntityManager.AllEntityQueryEnumerator<FootprintComponent, SpriteComponent>();
|
||||
while (query.MoveNext(out var uid, out var footprint, out var sprite))
|
||||
{
|
||||
UpdateFootprintVisuals(uid, footprint, sprite);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the visual appearance of a new footprint
|
||||
/// </summary>
|
||||
|
|
@ -74,6 +91,15 @@ public sealed class FootprintVisualizerSystem : VisualizerSystem<FootprintCompon
|
|||
|| !TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
return;
|
||||
|
||||
// Hide footprints if disabled in settings
|
||||
if (!_showFootprints)
|
||||
{
|
||||
sprite.Visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
sprite.Visible = true;
|
||||
|
||||
if (!_appearanceSystem.TryGetData<FootprintVisualType>(
|
||||
uid,
|
||||
FootprintVisualParameter.VisualState,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Configuration;
|
||||
|
||||
namespace Content.Shared._Sunrise.SunriseCCVars;
|
||||
|
||||
|
|
@ -330,4 +330,10 @@ public sealed class SunriseCCVars
|
|||
|
||||
public static readonly CVarDef<bool> MoodDecreasesSpeed =
|
||||
CVarDef.Create("mood.decreases_speed", true, CVar.SERVER);
|
||||
|
||||
/// <summary>
|
||||
/// Whether to show footprints
|
||||
/// </summary>
|
||||
public static readonly CVarDef<bool> ShowFootprints =
|
||||
CVarDef.Create("game.show_footprints", true, CVar.CLIENTONLY | CVar.ARCHIVE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ ui-options-lobby-art = Арт лобби
|
|||
ui-options-lobby-animation = Анимация лобби
|
||||
ui-options-lobby-parallax = Паралакс лобби
|
||||
ui-options-damage-overlay = Оверлей урона
|
||||
ui-options-show-footprints = Отображать следы
|
||||
Loading…
Add table
Reference in a new issue