Skip to content

Commit cbe65cb

Browse files
authored
upstream merge 19/01/2025 (#22)
2 parents 42cd61a + dfcee6e commit cbe65cb

388 files changed

Lines changed: 206294 additions & 10708 deletions

File tree

Some content is hidden

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

.envrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
2-
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
1+
set -e
2+
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
3+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
34
fi
45
use flake

.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/Access/UI/AccessOverriderWindow.xaml.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ public void UpdateState(IPrototypeManager protoManager, AccessOverriderBoundUser
8888
button.Disabled = !interfaceEnabled;
8989
if (interfaceEnabled)
9090
{
91-
button.Pressed = state.TargetAccessReaderIdAccessList?.Contains(accessName) ?? false;
92-
button.Disabled = (!state.AllowedModifyAccessList?.Contains(accessName)) ?? true;
91+
// Explicit cast because Rider gives a false error otherwise.
92+
button.Pressed = state.TargetAccessReaderIdAccessList?.Contains((ProtoId<AccessLevelPrototype>) accessName) ?? false;
93+
button.Disabled = (!state.AllowedModifyAccessList?.Contains((ProtoId<AccessLevelPrototype>) accessName)) ?? true;
9394
}
9495
}
9596
}

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/AdminMenuWindow.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
xmlns:tabs="clr-namespace:Content.Client.Administration.UI.Tabs"
77
xmlns:playerTab="clr-namespace:Content.Client.Administration.UI.Tabs.PlayerTab"
88
xmlns:objectsTab="clr-namespace:Content.Client.Administration.UI.Tabs.ObjectsTab"
9-
xmlns:panic="clr-namespace:Content.Client.Administration.UI.Tabs.PanicBunkerTab"
10-
xmlns:baby="clr-namespace:Content.Client.Administration.UI.Tabs.BabyJailTab">
9+
xmlns:panic="clr-namespace:Content.Client.Administration.UI.Tabs.PanicBunkerTab">
1110
<TabContainer Name="MasterTabContainer">
1211
<adminTab:AdminTab />
1312
<adminbusTab:AdminbusTab />
1413
<atmosTab:AtmosTab />
1514
<tabs:RoundTab />
1615
<tabs:ServerTab />
1716
<panic:PanicBunkerTab Name="PanicBunkerControl" Access="Public" />
18-
<baby:BabyJailTab Name="BabyJailControl" Access="Public" />
1917
<playerTab:PlayerTab Name="PlayerTabControl" Access="Public" />
2018
<objectsTab:ObjectsTab Name="ObjectsTabControl" Access="Public" />
2119
</TabContainer>

0 commit comments

Comments
 (0)