Skip to content

Commit

Permalink
Merge branch 'master' into Goblin-Species
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 committed Mar 27, 2024
2 parents 09ef1cf + 21ac8d3 commit 86938ce
Show file tree
Hide file tree
Showing 598 changed files with 58,309 additions and 8,259 deletions.
5 changes: 5 additions & 0 deletions Content.Client/DeltaV/Harpy/HarpyVisualsComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace Content.Client.DeltaV.Harpy;

[RegisterComponent]
public sealed partial class HarpyVisualsComponent : Component
{ }
44 changes: 44 additions & 0 deletions Content.Client/DeltaV/Overlays/UltraVisionOverlay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Enums;
using Robust.Shared.Prototypes;
using Content.Shared.DeltaV.Abilities;

namespace Content.Client.DeltaV.Overlays;

public sealed partial class UltraVisionOverlay : Overlay
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] IEntityManager _entityManager = default!;


public override bool RequestScreenTexture => true;
public override OverlaySpace Space => OverlaySpace.WorldSpace;
private readonly ShaderInstance _ultraVisionShader;

public UltraVisionOverlay()
{
IoCManager.InjectDependencies(this);
_ultraVisionShader = _prototypeManager.Index<ShaderPrototype>("UltraVision").Instance().Duplicate();
}

protected override void Draw(in OverlayDrawArgs args)
{
if (ScreenTexture == null)
return;
if (_playerManager.LocalPlayer?.ControlledEntity is not {Valid: true} player)
return;
if (!_entityManager.HasComponent<UltraVisionComponent>(player))
return;

_ultraVisionShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture);


var worldHandle = args.WorldHandle;
var viewport = args.WorldBounds;
worldHandle.SetTransform(Matrix3.Identity);
worldHandle.UseShader(_ultraVisionShader);
worldHandle.DrawRect(viewport, Color.White);
}
}
31 changes: 31 additions & 0 deletions Content.Client/DeltaV/Overlays/UltraVisionSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Shared.DeltaV.Abilities;
using Robust.Client.Graphics;

namespace Content.Client.DeltaV.Overlays;

public sealed partial class UltraVisionSystem : EntitySystem
{
[Dependency] private readonly IOverlayManager _overlayMan = default!;

private UltraVisionOverlay _overlay = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<UltraVisionComponent, ComponentInit>(OnUltraVisionInit);
SubscribeLocalEvent<UltraVisionComponent, ComponentShutdown>(OnUltraVisionShutdown);

_overlay = new();
}

private void OnUltraVisionInit(EntityUid uid, UltraVisionComponent component, ComponentInit args)
{
_overlayMan.AddOverlay(_overlay);
}

private void OnUltraVisionShutdown(EntityUid uid, UltraVisionComponent component, ComponentShutdown args)
{
_overlayMan.RemoveOverlay(_overlay);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Client.Pinpointer.UI;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects; // Frontier modification

namespace Content.Client.Medical.CrewMonitoring;

Expand Down Expand Up @@ -63,7 +64,9 @@ protected override void Draw(DrawingHandleScreen handle)
if (!LocalizedNames.TryGetValue(netEntity, out var name))
name = "Unknown";

var message = name + "\nLocation: [x = " + MathF.Round(blip.Coordinates.X) + ", y = " + MathF.Round(blip.Coordinates.Y) + "]";
// Text location of the blip will display GPS coordinates for the purpose of being able to find a person via GPS
// Previously it displayed coordinates relative to the center of the station, which had no use.
var message = name + "\nLocation: [x = " + MathF.Round(blip.MapCoordinates.X) + ", y = " + MathF.Round(blip.MapCoordinates.Y) + "]"; // Frontier modification

_trackedEntityLabel.Text = message;
_trackedEntityPanel.Visible = true;
Expand Down
13 changes: 10 additions & 3 deletions Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public sealed partial class CrewMonitoringWindow : FancyWindow
private readonly IEntityManager _entManager;
private readonly IPrototypeManager _prototypeManager;
private readonly SpriteSystem _spriteSystem;
private readonly SharedTransformSystem _transformSystem; // Frontier modification

private NetEntity? _trackedEntity;
private bool _tryToScrollToListFocus;
Expand All @@ -39,6 +40,7 @@ public CrewMonitoringWindow(string stationName, EntityUid? mapUid)
_entManager = IoCManager.Resolve<IEntityManager>();
_prototypeManager = IoCManager.Resolve<IPrototypeManager>();
_spriteSystem = _entManager.System<SpriteSystem>();
_transformSystem = _entManager.System<SharedTransformSystem>(); // Frontier modification

_blipTexture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")));

Expand Down Expand Up @@ -149,7 +151,7 @@ public void ShowSensors(List<SuitSensorStatus> sensors, EntityUid monitor, Entit
// Show monitor on nav map
if (monitorCoords != null && _blipTexture != null)
{
NavMap.TrackedEntities[_entManager.GetNetEntity(monitor)] = new NavMapBlip(monitorCoords.Value, _blipTexture, Color.Cyan, true, false);
NavMap.TrackedEntities[_entManager.GetNetEntity(monitor)] = new NavMapBlip(monitorCoords.Value, monitorCoords.Value.ToMap(_entManager, _transformSystem), _blipTexture, Color.Cyan, true, false); // Frontier modification
}
}

Expand Down Expand Up @@ -273,10 +275,13 @@ private void PopulateDepartmentList(IEnumerable<SuitSensorStatus> departmentSens
jobContainer.AddChild(jobIcon);
}

// Job name
// Job name area
// Frontier modification
// Made in its name appear location name as its much more convenient
// While job icons should do good enough job of conveying job
var jobLabel = new Label()
{
Text = sensor.Job,
Text = sensor.LocationName,
HorizontalExpand = true,
ClipText = true,
};
Expand All @@ -289,6 +294,7 @@ private void PopulateDepartmentList(IEnumerable<SuitSensorStatus> departmentSens
NavMap.TrackedEntities.TryAdd(sensor.SuitSensorUid,
new NavMapBlip
(coordinates.Value,
coordinates.Value.ToMap(_entManager, _transformSystem), // Frontier modification
_blipTexture,
(_trackedEntity == null || sensor.SuitSensorUid == _trackedEntity) ? Color.LimeGreen : Color.LimeGreen * Color.DimGray,
sensor.SuitSensorUid == _trackedEntity));
Expand Down Expand Up @@ -355,6 +361,7 @@ private void UpdateSensorsTable(NetEntity? currTrackedEntity, NetEntity? prevTra
{
data = new NavMapBlip
(data.Coordinates,
data.Coordinates.ToMap(_entManager, _transformSystem), // Frontier modification
data.Texture,
(currTrackedEntity == null || castSensor.SuitSensorUid == currTrackedEntity) ? Color.LimeGreen : Color.LimeGreen * Color.DimGray,
castSensor.SuitSensorUid == currTrackedEntity);
Expand Down
4 changes: 3 additions & 1 deletion Content.Client/Pinpointer/UI/NavMapControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,14 +642,16 @@ protected Vector2 GetOffset()
public struct NavMapBlip
{
public EntityCoordinates Coordinates;
public MapCoordinates MapCoordinates; //Frontier modification
public Texture Texture;
public Color Color;
public bool Blinks;
public bool Selectable;

public NavMapBlip(EntityCoordinates coordinates, Texture texture, Color color, bool blinks, bool selectable = true)
public NavMapBlip(EntityCoordinates coordinates, MapCoordinates mapCoordinates, Texture texture, Color color, bool blinks, bool selectable = true) //Frontier modification
{
Coordinates = coordinates;
MapCoordinates = mapCoordinates; // Frontier modification
Texture = texture;
Color = color;
Blinks = blinks;
Expand Down
6 changes: 4 additions & 2 deletions Content.Client/Power/PowerMonitoringWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public sealed partial class PowerMonitoringWindow : FancyWindow
private readonly IEntityManager _entManager;
private readonly SpriteSystem _spriteSystem;
private readonly IGameTiming _gameTiming;
private readonly SharedTransformSystem _transformSystem; // Frontier modification

private const float BlinkFrequency = 1f;

Expand All @@ -39,6 +40,7 @@ public PowerMonitoringWindow(PowerMonitoringConsoleBoundUserInterface userInterf
RobustXamlLoader.Load(this);
_entManager = IoCManager.Resolve<IEntityManager>();
_gameTiming = IoCManager.Resolve<IGameTiming>();
_transformSystem = _entManager.System<SharedTransformSystem>(); // Frontier modification

_spriteSystem = _entManager.System<SpriteSystem>();
_owner = owner;
Expand Down Expand Up @@ -166,7 +168,7 @@ public void ShowEntites
if (monitorCoords != null && mon != null)
{
var texture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")));
var blip = new NavMapBlip(monitorCoords.Value, texture, Color.Cyan, true, false);
var blip = new NavMapBlip(monitorCoords.Value, monitorCoords.Value.ToMap(_entManager, _transformSystem), texture, Color.Cyan, true, false); // Frontier modification
NavMap.TrackedEntities[mon.Value] = blip;
}

Expand Down Expand Up @@ -233,7 +235,7 @@ private void AddTrackedEntityToNavMap(NetEntity netEntity, PowerMonitoringDevice
if (_focusEntity != null && usedEntity != _focusEntity && !entitiesOfInterest.Contains(usedEntity.Value))
modulator = Color.DimGray;

var blip = new NavMapBlip(coords, _spriteSystem.Frame0(texture), color * modulator, blink);
var blip = new NavMapBlip(coords, coords.ToMap(_entManager, _transformSystem), _spriteSystem.Frame0(texture), color * modulator, blink); //Frontier modification
NavMap.TrackedEntities[netEntity] = blip;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,27 @@ public void UpdateState(GeneralStationRecordConsoleState state)

StationRecordsFilterType.SelectId((int) _currentFilterType);

if (state.JobList != null)
{
JobListing.Visible = true;
PopulateJobsContainer(state.JobList);
}

if (state.RecordListing == null)
{
RecordListingStatus.Visible = true;
RecordListing.Visible = false;
RecordListing.Visible = true;
RecordListingStatus.Text = Loc.GetString("general-station-record-console-empty-state");
RecordContainer.Visible = false;
RecordContainerStatus.Visible = false;
RecordContainer.Visible = true;
RecordContainerStatus.Visible = true;
return;
}

RecordListingStatus.Visible = false;
RecordListing.Visible = true;
RecordContainer.Visible = true;
PopulateRecordListing(state.RecordListing!, state.SelectedKey);
if (state.JobList != null)
{
JobListing.Visible = true;
PopulateJobsContainer(state.JobList);
}

RecordContainerStatus.Visible = state.Record == null;

if (state.Record != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public sealed partial class BoardNodeEntity : IGraphNodeEntity

// Frontier - adds tabletop variants
if (args.EntityManager.TryGetComponent(container.Owner, out ConstructionComponent? constructionComponent)
&& constructionComponent.Graph == "GraphComputerTabletop"
&& constructionComponent.Graph == "ComputerTabletop"
&& args.EntityManager.TryGetComponent(board, out ComputerTabletopBoardComponent? tabletopComputer))
{
return tabletopComputer.Prototype;
Expand Down
Loading

0 comments on commit 86938ce

Please sign in to comment.