Files
RobustToolbox/Robust.Client/UserInterface/CustomControls/DebugMonitors.cs
T
Pieter-Jan BriersandGitHub 09c36b57cd Shift half of Clyde around to implement better outline rendering. (#830)
* Attempted Clyde cleanup, didn't get far.

* Add negation operator to Vector2i.

* Add RenderOrder to ISpriteComponent.

* Post process shaders.

Adds "post process" shaders to sprite component.
These are executed on the WHOLE sprite component (every layer)
in one draw.

This is necessary to implement functional outlines.
2019-07-06 19:17:33 +02:00

89 lines
3.5 KiB
C#

using Robust.Client.Interfaces.Graphics;
using Robust.Client.Interfaces.Graphics.ClientEye;
using Robust.Client.Interfaces.Input;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.Interfaces.State;
using Robust.Client.UserInterface.Controls;
using Robust.Client.Interfaces.UserInterface;
using Robust.Client.Player;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Interfaces.Timing;
namespace Robust.Client.UserInterface.CustomControls
{
public class DebugMonitors : VBoxContainer, IDebugMonitors
{
public bool ShowFPS { get => _fpsCounter.Visible; set => _fpsCounter.Visible = value; }
public bool ShowCoords { get => _debugCoordsPanel.Visible; set => _debugCoordsPanel.Visible = value; }
public bool ShowNet { get => _debugNetPanel.Visible; set => _debugNetPanel.Visible = value; }
public bool ShowTime { get => _timeDebug.Visible; set => _timeDebug.Visible = value; }
public bool ShowFrameGraph { get => _frameGraph.Visible; set => _frameGraph.Visible = value; }
private FPSCounter _fpsCounter;
private DebugCoordsPanel _debugCoordsPanel;
private DebugNetPanel _debugNetPanel;
private DebugTimePanel _timeDebug;
private FrameGraph _frameGraph;
private readonly IGameTiming _gameTiming;
private readonly IPlayerManager _playerManager;
private readonly IEyeManager _eyeManager;
private readonly IInputManager _inputManager;
private readonly IResourceCache _resourceCache;
private readonly IStateManager _stateManager;
private readonly IClyde _displayManager;
private readonly IClientNetManager _netManager;
private readonly IMapManager _mapManager;
//TODO: Think about a factory for this
public DebugMonitors(IGameTiming gameTiming, IPlayerManager playerManager, IEyeManager eyeManager, IInputManager inputManager, IResourceCache resourceCache, IStateManager stateManager, IClyde displayManager, IClientNetManager netManager, IMapManager mapManager)
{
_gameTiming = gameTiming;
_playerManager = playerManager;
_eyeManager = eyeManager;
_inputManager = inputManager;
_resourceCache = resourceCache;
_stateManager = stateManager;
_displayManager = displayManager;
_netManager = netManager;
_mapManager = mapManager;
PerformLayout();
}
protected override void Initialize()
{
base.Initialize();
MouseFilter = MouseFilterMode.Ignore;
Visible = false;
SetAnchorPreset(LayoutPreset.Wide);
MarginLeft = 2;
MarginTop = 2;
}
private void PerformLayout()
{
_fpsCounter = new FPSCounter(_gameTiming);
AddChild(_fpsCounter);
_debugCoordsPanel = new DebugCoordsPanel(_playerManager, _eyeManager, _inputManager,
_resourceCache, _stateManager, _displayManager, _mapManager);
AddChild(_debugCoordsPanel);
_debugNetPanel = new DebugNetPanel(_netManager, _gameTiming, _resourceCache);
AddChild(_debugNetPanel);
_timeDebug = new DebugTimePanel(_resourceCache, _gameTiming)
{
Visible = false,
};
AddChild(_timeDebug);
_frameGraph = new FrameGraph(_gameTiming);
AddChild(_frameGraph);
}
}
}