Files
wwdpublic/Content.Shared/Shuttles/Systems/SharedShuttleSystem.IFF.cs
RedFoxIV 0536fc8645 Fuselage rust stage 2 (#629)
* the definition of insanity

* the definition of insanity

* the definition of insanity

* we have hullrot at home

* maybe the real hullrot was the friends we made along the way

* john hullrot

* i am going to hullroooooot

* it's hullrotver

* we're so hullback

* we're rotting the hull with this one

* hullmerge

* the hullrot is leaking

* never gonna rot you up

* hullfresh

* john starsector

* god i wish we had grid collision damage

* you can tell I am very tired because I stopped forcing a hullrot joke into every commit message

* hr

* this is a surprise sprite that will help us later

* motherfucker

* i have nothing good to say

* still nothing

* brb

* random letter random letter random letter dash random number random number random number

* ass

* blast

* ffs

* fcuk

* RE: ffs

* RE: RE: ffs

* гнида жестяная

* continue

* i hate tests

* i love tests

* slide to the right

* i hate tests again

* what the fuck

* ты шиз?

* ??

* bbgun
2025-06-28 11:31:07 +03:00

105 lines
2.8 KiB
C#

using Content.Shared.Shuttles.Components;
using JetBrains.Annotations;
namespace Content.Shared.Shuttles.Systems;
public abstract partial class SharedShuttleSystem
{
/*
* Handles the label visibility on radar controls. This can be hiding the label or applying other effects.
*/
protected virtual void UpdateIFFInterfaces(EntityUid gridUid, IFFComponent component) {}
public Color GetIFFColor(EntityUid gridUid, bool self = false, IFFComponent? component = null)
{
if (self)
{
return IFFComponent.SelfColor;
}
if (!Resolve(gridUid, ref component, false))
{
return IFFComponent.IFFColor;
}
return component.Color;
}
public string? GetIFFLabel(EntityUid gridUid, bool self = false, IFFComponent? component = null)
{
var entName = MetaData(gridUid).EntityName;
if (self)
{
return entName;
}
if (Resolve(gridUid, ref component, false) && (component.Flags & (IFFFlags.HideLabel | IFFFlags.Hide)) != 0x0)
{
return null;
}
return string.IsNullOrEmpty(entName) ? Loc.GetString("shuttle-console-unknown") : entName;
}
/// <summary>
/// Sets the color for this grid to appear as on radar.
/// </summary>
[PublicAPI]
public void SetIFFColor(EntityUid gridUid, Color color, IFFComponent? component = null)
{
component ??= EnsureComp<IFFComponent>(gridUid);
if (component.Color.Equals(color))
return;
component.Color = color;
Dirty(gridUid, component);
UpdateIFFInterfaces(gridUid, component);
}
// WWDP EDIT START
[PublicAPI]
public void SetIFFFlag(EntityUid gridUid, IFFFlags flags, IFFComponent? component = null)
{
component ??= EnsureComp<IFFComponent>(gridUid);
if (component.Flags == flags)
return;
component.Flags = flags;
Dirty(gridUid, component);
UpdateIFFInterfaces(gridUid, component);
}
// WWDP EDIT END
[PublicAPI]
public void AddIFFFlag(EntityUid gridUid, IFFFlags flags, IFFComponent? component = null)
{
component ??= EnsureComp<IFFComponent>(gridUid);
if ((component.Flags & flags) == flags)
return;
component.Flags |= flags;
Dirty(gridUid, component);
UpdateIFFInterfaces(gridUid, component);
}
[PublicAPI]
public void RemoveIFFFlag(EntityUid gridUid, IFFFlags flags, IFFComponent? component = null)
{
if (!Resolve(gridUid, ref component, false))
return;
if ((component.Flags & flags) == 0x0)
return;
component.Flags &= ~flags;
Dirty(gridUid, component);
UpdateIFFInterfaces(gridUid, component);
}
}