Files
RobustToolbox/Robust.Client/UserInterface/CustomControls/DebugMonitors.cs
T
AcruidandPieter-Jan Briers 7053fb15f8 Map System Code Refactor (#796)
* Removed unused method TileRef.GetStep().
Removed unused property TileRef.TileSize.
Removed unused property TileRef.Tile, made the field public with the same name.
Made the TileRef struct readonly.
Removed property TileRef.TileDef.
Removed property TileRef.LocalPos.
Renamed GridTile to GridIndices.
Implemented IEquatable on TileRef.
Implemented Equality operators on TileRef.
Added PublicAPI attribute to TileRef.
Added doc comments to TileRef.

* Modified Tile:
Added the PublicApi annotation.
Made struct readonly.
Filled out doc comments.
Changed auto properties to readonly fields.
Renamed TileId to TypeId.
Added a static Empty tile to the struct.
Implemented IEquatable.

* Modified MapCoordinates:
Added PublicApi attribute.
Implemented IEquatable.
Filled out doc comments.
Removed Map property.

* Modified ScreenCoordinates:
Filled out doc comments.
Added the PublicApi attribute.
Implemented IEquatable.

* Modified GridCoordinates:
Removed method IsValidLocation.

* Removed property GridCoordinates.Grid.

* Removed GridCoordinates.Map.

* Removed GridCoordinates.MapId.

* Removed property GridCoordinates.IsWorld.
Removed constructors taking a MapId.

* Removed static IoCManager calls from GridCoordinates.

* Modified GridCoordinates:
Added attribute PublicApi.
Filled out doc comments.

* Filled out doc comments for MapGrid.
Filled out doc comments for MapIndices.
Misc refactors for both.

* added command to teleport grids.

* Added method Box2.Intersect.
Added method Box2.Union.
Placement manager now spawns new grids to place tiles not connected to an existing grid.
2019-04-20 20:37:37 +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 IDisplayManager _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, IDisplayManager 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);
}
}
}