Re-organize all projects (#4166)

This commit is contained in:
DrSmugleaf
2021-06-09 22:19:39 +02:00
committed by GitHub
parent 9f50e4061b
commit ff1a2d97ea
1773 changed files with 5258 additions and 5508 deletions

View File

@@ -0,0 +1,43 @@
using System.Collections.Generic;
using Content.Client.HUD.UI;
using Content.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.IoC;
namespace Content.Client.Viewport
{
/// <summary>
/// Event proxy for <see cref="MainViewport"/> to listen to config events.
/// </summary>
// ReSharper disable once ClassNeverInstantiated.Global
public sealed class ViewportManager
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
private readonly List<MainViewport> _viewports = new();
public void Initialize()
{
_cfg.OnValueChanged(CCVars.ViewportStretch, _ => UpdateCfg());
_cfg.OnValueChanged(CCVars.ViewportSnapToleranceClip, _ => UpdateCfg());
_cfg.OnValueChanged(CCVars.ViewportSnapToleranceMargin, _ => UpdateCfg());
_cfg.OnValueChanged(CCVars.ViewportScaleRender, _ => UpdateCfg());
_cfg.OnValueChanged(CCVars.ViewportFixedScaleFactor, _ => UpdateCfg());
}
private void UpdateCfg()
{
_viewports.ForEach(v => v.UpdateCfg());
}
public void AddViewport(MainViewport vp)
{
_viewports.Add(vp);
}
public void RemoveViewport(MainViewport vp)
{
_viewports.Remove(vp);
}
}
}