Skip to content

Commit d66ccda

Browse files
authored
Merge branch 'master' into surgery-2
2 parents cc82b50 + bd0ab98 commit d66ccda

File tree

916 files changed

+12918
-5486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

916 files changed

+12918
-5486
lines changed

.github/workflows/build-docfx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup .NET Core
2222
uses: actions/[email protected]
2323
with:
24-
dotnet-version: 8.0.x
24+
dotnet-version: 9.0.x
2525

2626
- name: Install dependencies
2727
run: dotnet restore

.github/workflows/build-map-renderer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup .NET Core
3737
uses: actions/[email protected]
3838
with:
39-
dotnet-version: 8.0.x
39+
dotnet-version: 9.0.x
4040

4141
- name: Install dependencies
4242
run: dotnet restore

.github/workflows/build-test-debug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup .NET Core
3737
uses: actions/[email protected]
3838
with:
39-
dotnet-version: 8.0.x
39+
dotnet-version: 9.0.x
4040

4141
- name: Install dependencies
4242
run: dotnet restore

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup .NET Core
2323
uses: actions/[email protected]
2424
with:
25-
dotnet-version: 8.0.x
25+
dotnet-version: 9.0.x
2626

2727
- name: Get Engine Tag
2828
run: |

.github/workflows/test-packaging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Setup .NET Core
5252
uses: actions/[email protected]
5353
with:
54-
dotnet-version: 8.0.x
54+
dotnet-version: 9.0.x
5555

5656
- name: Install dependencies
5757
run: dotnet restore

.github/workflows/yaml-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup .NET Core
2727
uses: actions/[email protected]
2828
with:
29-
dotnet-version: 8.0.x
29+
dotnet-version: 9.0.x
3030
- name: Install dependencies
3131
run: dotnet restore
3232
- name: Build

Content.Client/Administration/AdminNameOverlay.cs

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
1+
using System.Linq;
12
using System.Numerics;
23
using Content.Client.Administration.Systems;
4+
using Content.Shared.CCVar;
5+
using Content.Shared.Mind;
36
using Robust.Client.Graphics;
47
using Robust.Client.ResourceManagement;
58
using Robust.Client.UserInterface;
6-
using Robust.Shared;
7-
using Robust.Shared.Enums;
89
using Robust.Shared.Configuration;
10+
using Robust.Shared.Enums;
11+
using Robust.Shared.Prototypes;
912

1013
namespace Content.Client.Administration;
1114

1215
internal sealed class AdminNameOverlay : Overlay
1316
{
17+
[Dependency] private readonly IConfigurationManager _config = default!;
18+
1419
private readonly AdminSystem _system;
1520
private readonly IEntityManager _entityManager;
1621
private readonly IEyeManager _eyeManager;
1722
private readonly EntityLookupSystem _entityLookup;
1823
private readonly IUserInterfaceManager _userInterfaceManager;
1924
private readonly Font _font;
2025

26+
//TODO make this adjustable via GUI
27+
private readonly ProtoId<RoleTypePrototype>[] _filter =
28+
["SoloAntagonist", "TeamAntagonist", "SiliconAntagonist", "FreeAgent"];
29+
private readonly string _antagLabelClassic = Loc.GetString("admin-overlay-antag-classic");
30+
private readonly Color _antagColorClassic = Color.OrangeRed;
31+
2132
public AdminNameOverlay(AdminSystem system, IEntityManager entityManager, IEyeManager eyeManager, IResourceCache resourceCache, EntityLookupSystem entityLookup, IUserInterfaceManager userInterfaceManager)
2233
{
34+
IoCManager.InjectDependencies(this);
35+
2336
_system = system;
2437
_entityManager = entityManager;
2538
_eyeManager = eyeManager;
@@ -35,6 +48,9 @@ protected override void Draw(in OverlayDrawArgs args)
3548
{
3649
var viewport = args.WorldAABB;
3750

51+
//TODO make this adjustable via GUI
52+
var classic = _config.GetCVar(CCVars.AdminOverlayClassic);
53+
3854
foreach (var playerInfo in _system.PlayerList)
3955
{
4056
var entity = _entityManager.GetEntity(playerInfo.NetEntity);
@@ -64,12 +80,20 @@ protected override void Draw(in OverlayDrawArgs args)
6480
var screenCoordinates = _eyeManager.WorldToScreen(aabb.Center +
6581
new Angle(-_eyeManager.CurrentEye.Rotation).RotateVec(
6682
aabb.TopRight - aabb.Center)) + new Vector2(1f, 7f);
67-
if (playerInfo.Antag)
83+
84+
if (classic && playerInfo.Antag)
6885
{
69-
args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), "ANTAG", uiScale, Color.OrangeRed);
70-
;
86+
args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), _antagLabelClassic, uiScale, _antagColorClassic);
7187
}
72-
args.ScreenHandle.DrawString(_font, screenCoordinates+lineoffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : Color.White);
88+
else if (!classic && _filter.Contains(playerInfo.RoleProto.ID))
89+
{
90+
var label = Loc.GetString(playerInfo.RoleProto.Name).ToUpper();
91+
var color = playerInfo.RoleProto.Color;
92+
93+
args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), label, uiScale, color);
94+
}
95+
96+
args.ScreenHandle.DrawString(_font, screenCoordinates + lineoffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : Color.White);
7397
args.ScreenHandle.DrawString(_font, screenCoordinates, playerInfo.CharacterName, uiScale, playerInfo.Connected ? Color.Aquamarine : Color.White);
7498
}
7599
}

Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ private int Compare(PlayerInfo x, PlayerInfo y)
197197
Header.Character => Compare(x.CharacterName, y.CharacterName),
198198
Header.Job => Compare(x.StartingJob, y.StartingJob),
199199
Header.Antagonist => x.Antag.CompareTo(y.Antag),
200+
Header.RoleType => Compare(x.RoleProto.Name , y.RoleProto.Name),
200201
Header.Playtime => TimeSpan.Compare(x.OverallPlaytime ?? default, y.OverallPlaytime ?? default),
201202
_ => 1
202203
};

Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
HorizontalExpand="True"
2525
ClipText="True"/>
2626
<customControls:VSeparator/>
27+
<Label Name="RoleTypeLabel"
28+
SizeFlagsStretchRatio="2"
29+
HorizontalExpand="True"
30+
ClipText="True"/>
31+
<customControls:VSeparator/>
2732
<Label Name="OverallPlaytimeLabel"
2833
SizeFlagsStretchRatio="1"
2934
HorizontalExpand="True"

Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public PlayerTabEntry(PlayerInfo player, StyleBoxFlat styleBoxFlat)
2323
if (player.IdentityName != player.CharacterName)
2424
CharacterLabel.Text += $" [{player.IdentityName}]";
2525
AntagonistLabel.Text = Loc.GetString(player.Antag ? "player-tab-is-antag-yes" : "player-tab-is-antag-no");
26+
RoleTypeLabel.Text = Loc.GetString(player.RoleProto.Name);
27+
RoleTypeLabel.FontColorOverride = player.RoleProto.Color;
2628
BackgroundColorPanel.PanelOverride = styleBoxFlat;
2729
OverallPlaytimeLabel.Text = player.PlaytimeString;
2830
PlayerEntity = player.NetEntity;

0 commit comments

Comments
 (0)