Add text coloring for inspected solution containers, code cleanup (#2010)

* Initial commit

* remove helper

* fixes

* small fix
This commit is contained in:
nuke
2020-09-09 18:32:31 -04:00
committed by GitHub
parent f7a5bad839
commit 753a627c75
56 changed files with 981 additions and 726 deletions

View File

@@ -22,7 +22,7 @@ namespace Content.Server.GameObjects.Components.Body.Circulatory
/// <summary>
/// Internal solution for reagent storage
/// </summary>
[ViewVariables] private SolutionComponent _internalSolution;
[ViewVariables] private SolutionContainerComponent _internalSolution;
/// <summary>
/// Empty volume of internal solution
@@ -31,13 +31,13 @@ namespace Content.Server.GameObjects.Components.Body.Circulatory
[ViewVariables] public GasMixture Air { get; set; }
[ViewVariables] public SolutionComponent Solution => _internalSolution;
[ViewVariables] public SolutionContainerComponent Solution => _internalSolution;
public override void Initialize()
{
base.Initialize();
_internalSolution = Owner.EnsureComponent<SolutionComponent>();
_internalSolution = Owner.EnsureComponent<SolutionContainerComponent>();
_internalSolution.MaxVolume = _initialMaxVolume;
}

View File

@@ -24,10 +24,10 @@ namespace Content.Server.GameObjects.Components.Body.Digestive
/// </summary>
public ReagentUnit MaxVolume
{
get => Owner.TryGetComponent(out SolutionComponent? solution) ? solution.MaxVolume : ReagentUnit.Zero;
get => Owner.TryGetComponent(out SolutionContainerComponent? solution) ? solution.MaxVolume : ReagentUnit.Zero;
set
{
if (Owner.TryGetComponent(out SolutionComponent? solution))
if (Owner.TryGetComponent(out SolutionContainerComponent? solution))
{
solution.MaxVolume = value;
}
@@ -64,9 +64,9 @@ namespace Content.Server.GameObjects.Components.Body.Digestive
{
base.Startup();
if (!Owner.EnsureComponent(out SolutionComponent solution))
if (!Owner.EnsureComponent(out SolutionContainerComponent solution))
{
Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} didn't have a {nameof(SolutionComponent)}");
Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} didn't have a {nameof(SolutionContainerComponent)}");
}
solution.MaxVolume = _initialMaxVolume;
@@ -74,7 +74,7 @@ namespace Content.Server.GameObjects.Components.Body.Digestive
public bool TryTransferSolution(Solution solution)
{
if (!Owner.TryGetComponent(out SolutionComponent? solutionComponent))
if (!Owner.TryGetComponent(out SolutionContainerComponent? solutionComponent))
{
return false;
}
@@ -104,7 +104,7 @@ namespace Content.Server.GameObjects.Components.Body.Digestive
/// <param name="frameTime">The time since the last update in seconds.</param>
public void Update(float frameTime)
{
if (!Owner.TryGetComponent(out SolutionComponent? solutionComponent) ||
if (!Owner.TryGetComponent(out SolutionContainerComponent? solutionComponent) ||
!Owner.TryGetComponent(out BloodstreamComponent? bloodstream))
{
return;