forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ghost & admin roles tracking
- Loading branch information
Showing
8 changed files
with
62 additions
and
80 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
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
25 changes: 25 additions & 0 deletions
25
Content.Server/SS220/GhostRoleMarkerRole/GhostRoleMarkerRoleTimeTracker.cs
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,25 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Server.Ghost.Roles; | ||
using Content.Shared.Roles; | ||
|
||
namespace Content.Server.SS220.GhostRoleMarkerRole; | ||
|
||
public sealed class GhostRoleMarkerRoleTimeTracker : EntitySystem | ||
{ | ||
private const string UnknownRoleName = "game-ticker-unknown-role"; | ||
private const string GhostRoleTracker = "JobGhostRole"; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<GhostRoleMarkerRoleComponent, MindGetAllRolesEvent>(OnMindGetAllRoles); | ||
} | ||
|
||
private void OnMindGetAllRoles(EntityUid uid, GhostRoleMarkerRoleComponent component, ref MindGetAllRolesEvent args) | ||
{ | ||
string name = component.Name == null ? UnknownRoleName : component.Name; | ||
args.Roles.Add(new RoleInfo(component, name, false, GhostRoleTracker)); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
- type: playTimeTracker | ||
id: JobGhostRole | ||
id: JobGhostRole | ||
|
||
- type: playTimeTracker | ||
id: AdminTime | ||
|
||
- type: playTimeTracker | ||
id: AGhostTime | ||
|
||
- type: playTimeTracker | ||
id: ObserverTime |