MAPS IN ATMOS (#4909)
* COLORIZE! * ATMOS! * FUCK * fix occluders. also supply rates snuck in, broken serv3.
This commit is contained in:
@@ -29,9 +29,11 @@ namespace Content.Server.Atmos.Piping.Trinary.Components
|
||||
public float TargetPressure = Atmospherics.OneAtmosphere;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("inletOneConcentration")]
|
||||
public float InletOneConcentration = 0.5f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("inletTwoConcentration")]
|
||||
public float InletTwoConcentration = 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Content.Server.Atmos.Piping.Unary.Components
|
||||
public VentPressureBound PressureChecks { get; set; } = VentPressureBound.ExternalBound;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("externalPressureBound")]
|
||||
public float ExternalPressureBound { get; set; } = Atmospherics.OneAtmosphere;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -24,7 +24,10 @@ namespace Content.Server.Atmos.Piping.Unary.Components
|
||||
[ViewVariables]
|
||||
public readonly HashSet<Gas> FilterGases = new()
|
||||
{
|
||||
Gas.CarbonDioxide
|
||||
Gas.CarbonDioxide,
|
||||
Gas.Plasma,
|
||||
Gas.Tritium,
|
||||
Gas.WaterVapor
|
||||
};
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
96
Content.Server/Sandbox/Commands/ColorNetworkCommand.cs
Normal file
96
Content.Server/Sandbox/Commands/ColorNetworkCommand.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Atmos.Piping.Components;
|
||||
using Content.Server.Atmos.Piping.EntitySystems;
|
||||
using Content.Server.NodeContainer;
|
||||
using Content.Server.NodeContainer.NodeGroups;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Server.Sandbox.Commands
|
||||
{
|
||||
[AnyCommand]
|
||||
public class ColorNetworkCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "colornetwork";
|
||||
public string Description => Loc.GetString("color-network-command-description");
|
||||
public string Help => Loc.GetString("color-network-command-help-text", ("command",Command));
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var sandboxManager = IoCManager.Resolve<ISandboxManager>();
|
||||
var adminManager = IoCManager.Resolve<IAdminManager>();
|
||||
if (shell.IsClient && (!sandboxManager.IsSandboxEnabled && !adminManager.HasAdminFlag((IPlayerSession)shell.Player!, AdminFlags.Mapping)))
|
||||
{
|
||||
shell.WriteError("You are not currently able to use mapping commands.");
|
||||
}
|
||||
|
||||
if (args.Length != 3)
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-wrong-arguments-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (!int.TryParse(args[0], out var targetId))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-argument-must-be-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
var eUid = new EntityUid(targetId);
|
||||
|
||||
if (!eUid.IsValid() || !entityManager.EntityExists(eUid))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-invalid-entity-id"));
|
||||
return;
|
||||
}
|
||||
|
||||
var target = entityManager.GetEntity(eUid);
|
||||
if (!target.TryGetComponent(out NodeContainerComponent? nodeContainerComponent))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-entity-is-not-node-container"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Enum.TryParse(args[1], out NodeGroupID nodeGroupId))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-node-group-is-invalid"));
|
||||
return;
|
||||
}
|
||||
|
||||
var color = Color.TryFromHex(args[2]);
|
||||
if (!color.HasValue)
|
||||
{
|
||||
shell.WriteError(Loc.GetString("shell-invalid-color-hex"));
|
||||
return;
|
||||
}
|
||||
|
||||
PaintNodes(nodeContainerComponent, nodeGroupId, color.Value);
|
||||
}
|
||||
|
||||
private void PaintNodes(NodeContainerComponent nodeContainerComponent, NodeGroupID nodeGroupId, Color color)
|
||||
{
|
||||
var group = nodeContainerComponent.Nodes[nodeGroupId.ToString().ToLower()].NodeGroup;
|
||||
|
||||
if (group == null) return;
|
||||
|
||||
foreach (var x in group.Nodes)
|
||||
{
|
||||
if (!x.Owner.TryGetComponent<AtmosPipeColorComponent>(out var atmosPipeColorComponent)) continue;
|
||||
|
||||
EntitySystem.Get<AtmosPipeColorSystem>().SetColor(x.Owner.Uid, atmosPipeColorComponent, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user