forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* USSP channel fix * Update ebent species blacklist * Change ussp energy weapon colors * Added event role icons
- Loading branch information
1 parent
0db2a21
commit 44c5e31
Showing
25 changed files
with
301 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Content.Client.Antag; | ||
using Content.Shared.Ghost; | ||
using Content.Shared.SS220.AdmemeEvents; | ||
using Content.Shared.StatusIcon; | ||
using Content.Shared.StatusIcon.Components; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.SS220.AdmemeEvents; | ||
|
||
/// <summary> | ||
/// Used for the client to get status icons from other event roles. | ||
/// </summary> | ||
public sealed class EventRoleIconsSystem : AntagStatusIconSystem<EventRoleComponent> | ||
{ | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<EventRoleComponent, GetStatusIconsEvent>(GetRoleIcon); | ||
} | ||
|
||
/// <summary> | ||
/// Obtains a status icon from proto id mentioned in component | ||
/// </summary> | ||
private void GetRoleIcon(EntityUid uid, EventRoleComponent comp, ref GetStatusIconsEvent args) | ||
{ | ||
GetStatusIcon(comp, ref args); | ||
} | ||
|
||
private void GetStatusIcon(EventRoleComponent targetRoleComp, ref GetStatusIconsEvent args) | ||
{ | ||
var ent = _player.LocalPlayer?.ControlledEntity; | ||
|
||
if (!HasComp<GhostComponent>(ent)) | ||
{ | ||
if (!TryComp<EventRoleComponent>(ent, out var playerRoleComp)) | ||
return; | ||
else if (targetRoleComp.RoleGroupKey != playerRoleComp.RoleGroupKey) | ||
return; | ||
} | ||
|
||
args.StatusIcons.Add(_prototype.Index(targetRoleComp.StatusIcon)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Content.Shared.StatusIcon; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Shared.SS220.AdmemeEvents; | ||
|
||
/// <summary> | ||
/// Компонент добавляет возможность видеть указанный StatusIcon энтити, | ||
/// при условии что у наблюдателя тоже есть этот компонент с одинаковым RoleGroupKey. | ||
/// Используется чтобы ивентовые рольки видели друг-друга. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] | ||
public sealed partial class EventRoleComponent : Component | ||
{ | ||
[DataField(required: true), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] | ||
public ProtoId<StatusIconPrototype> StatusIcon; | ||
|
||
[DataField(required: true), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] | ||
public string RoleGroupKey; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.