Skip to content

Commit 29b37d8

Browse files
author
Marty
committed
Merge remote-tracking branch 'origin/master'
2 parents de73a35 + 8d161ed commit 29b37d8

5,944 files changed

Lines changed: 435950 additions & 59902 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.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: dotnet restore
6262

6363
- name: Build Project
64-
run: dotnet build Content.MapRenderer --configuration Release --no-restore /p:WarningsAsErrors=nullable /m
64+
run: dotnet build Content.MapRenderer --configuration Release --no-restore /m
6565

6666
- name: Run Map Renderer
6767
run: dotnet run --project Content.MapRenderer Dev

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
run: dotnet restore
6868

6969
- name: Build Project
70-
run: dotnet build --configuration DebugOpt --no-restore /p:WarningsAsErrors=nullable /m
70+
run: dotnet build --configuration DebugOpt --no-restore /m
7171

7272
- name: Run Content.Tests
7373
run: dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0

.github/workflows/labeler-needsreview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
labels: "S: Needs Review"
2020
- uses: actions-ecosystem/action-remove-labels@v1
2121
with:
22-
labels: "S: Awaiting Changes"
22+
labels: "S: Needs Changes"

.github/workflows/labeler-review.yml

Lines changed: 71 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,79 @@ on:
1212
types: [submitted]
1313

1414
jobs:
15-
add_label:
16-
# Change the repository name after you've made sure the team name is correct for your fork!
17-
if: ${{ (github.repository == 'ProjectOmu/OmuStation') && (github.event.review.state == 'APPROVED') }}
15+
label-on-approval:
1816
permissions:
1917
contents: read
18+
issues: write
2019
pull-requests: write
2120
runs-on: ubuntu-latest
2221
steps:
23-
# - uses: tspascoal/get-user-teams-membership@v3 #Omu, only maints can approve anyway, so this isnt needed.
24-
# id: checkUserMember
25-
# with:
26-
# username: ${{ github.actor }}
27-
# team: "maintainers"
28-
# GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
29-
# - if: "${{ contains(github.event.pull_request.labels.*.name, 'S: Needs Second Approval') }}"
30-
# uses: actions-ecosystem/action-add-labels@v1
31-
# with:
32-
# labels: "S: Approved"
33-
- if: "${{ contains(github.event.pull_request.labels.*.name, 'S: Needs Second Approval') }}"
34-
uses: actions-ecosystem/action-remove-labels@v1
35-
with:
36-
labels: "S: Needs Second Approval"
37-
- if: "${{ false == contains(github.event.pull_request.labels.*.name, 'S: Needs Second Approval') }}"
38-
uses: actions-ecosystem/action-add-labels@v1
39-
with:
40-
labels: "S: Needs Second Approval"
22+
- name: Create JSON File
23+
id: curling-reviews
24+
run: |
25+
PR_NUMBER=${{ github.event.pull_request.number }}
26+
OWNER=${{ github.repository_owner }}
27+
REPO=${{ github.event.repository.name }}
28+
TOKEN=${{ secrets.GITHUB_TOKEN }}
29+
30+
# Fetch the reviews and place them into a json file.
31+
curl -o reviews.json -L \
32+
-H "Accept: application/vnd.github+json" \
33+
-H "Authorization: Bearer $TOKEN" \
34+
-H "X-GitHub-Api-Version: 2022-11-28" \
35+
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews
36+
37+
- name: Check for Approvals
38+
id: check-approvals
39+
run: |
40+
# Count the number of approvals
41+
APPROVALS=$(jq '[.[] | select(.state=="APPROVED")] | length' reviews.json)
42+
43+
echo "Number of approvals: $APPROVALS"
44+
echo "::set-output name=approvals::$APPROVALS"
45+
46+
- name: Add Approved Label if Enough Approvals
47+
if: steps.check-approvals.outputs.approvals >= 2 # Change the threshold here
48+
uses: actions-ecosystem/action-add-labels@v1
49+
env:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
labels: "S: Approved"
53+
54+
- name: Remove Other Labels on Approved
55+
if: steps.check-approvals.outputs.approval >= 2
56+
uses: actions-ecosystem/action-remove-labels@v1
57+
env:
58+
github_token: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
labels: |
61+
"S: Needs Review"
62+
"S: Needs Second Approval"
63+
64+
- name: Add Second Approval Requirement on Approval
65+
if: steps.check-approvals.outputs.approvals == 1
66+
uses: actions-ecosystem/action-add-labels@v1
67+
env:
68+
github_token: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
labels: |
71+
"S: Needs Second Approval"
72+
"S: Needs Review"
73+
74+
- name: Remove Other Labels on Second Approval Requirement
75+
if: steps.check-approvals.outputs.approvals == 1
76+
uses: actions-ecosystem/action-remove-labels@v1
77+
env:
78+
github_token: ${{ secrets.GITHUB_TOKEN }}
79+
with:
80+
labels: "S: Approved"
81+
82+
- name: Remove All Other Labels if No Approval
83+
if: steps.check-approvals.outputs.approvals < 1
84+
uses: actions-ecosystem/action-remove-labels@v1
85+
env:
86+
github_token: ${{ secrets.GITHUB_TOKEN }}
87+
with:
88+
labels: |
89+
"S: Approved"
90+
"S: Needs Second Approval"

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ jobs:
2929
runs-on: ubuntu-latest
3030

3131
steps:
32+
- name: Fail if we are attempting to run on the master branch
33+
if: ${{GITHUB.REF_NAME == 'master' && github.repository == 'space-wizards/space-station-14'}}
34+
run: exit 1
35+
3236
- name: Install dependencies
3337
run: sudo apt-get install -y python3-paramiko python3-lxml
3438

Content.Benchmarks/MapLoadBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public async Task Cleanup()
7777
PoolManager.Shutdown();
7878
}
7979

80-
public static readonly string[] MapsSource = { "Empty", "Satlern", "Box", "Bagel", "Dev", "CentComm", "Atlas", "Core", "TestTeg", "Packed", "Origin", "Omega", "Cluster", "Reach", "Meta", "Marathon", "Europa", "MeteorArena", "Fland", "Oasis", "FlandHighPop", "OasisHighPop", "OriginHighPop", "Barratry", "Kettle", "Submarine", "Lambda", "Leonid", "Delta", "Amber", "Chloris", "Cog"}; //Goobstation, readds maps
80+
public static readonly string[] MapsSource = { "Empty", "Satlern", "Box", "Bagel", "Dev", "CentComm", "Atlas", "Core", "TestTeg", "Packed", "Origin", "Omega", "Cluster", "Reach", "Meta", "Marathon", "Europa", "MeteorArena", "Fland", "Oasis", "FlandHighPop", "OasisHighPop", "OriginHighPop", "Barratry", "Kettle", "Submarine", "Lambda", "Leonid", "Delta", "Amber", "Chloris", "Cog", "Glacier", "Serpentcrest"}; //Goobstation, readds maps
8181

8282
[ParamsSource(nameof(MapsSource))]
8383
public string Map;

Content.Client/Actions/ActionsSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public void TriggerAction(Entity<ActionComponent> action)
368368
else
369369
{
370370
var request = new RequestPerformActionEvent(GetNetEntity(action));
371-
EntityManager.RaisePredictiveEvent(request);
371+
RaisePredictiveEvent(request);
372372
}
373373
}
374374

Content.Client/Administration/AdminNameOverlay.cs

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
//
103103
// SPDX-License-Identifier: AGPL-3.0-or-later
104104

105+
using System.Collections.Frozen;
105106
using System.Linq;
106107
using System.Numerics;
107108
using Content.Client.Administration.Systems;
@@ -129,6 +130,7 @@ internal sealed class AdminNameOverlay : Overlay
129130
private readonly EntityLookupSystem _entityLookup;
130131
private readonly IUserInterfaceManager _userInterfaceManager;
131132
private readonly SharedRoleSystem _roles;
133+
private readonly IPrototypeManager _prototypeManager;
132134
private readonly Font _font;
133135
private readonly Font _fontBold;
134136
private AdminOverlayAntagFormat _overlayFormat;
@@ -145,9 +147,10 @@ internal sealed class AdminNameOverlay : Overlay
145147
private bool _showUserName;
146148
// Goobstation - End
147149

148-
//TODO make this adjustable via GUI
149-
private readonly ProtoId<RoleTypePrototype>[] _filter =
150-
["SoloAntagonist", "TeamAntagonist", "SiliconAntagonist", "FreeAgent"];
150+
//TODO make this adjustable via GUI?
151+
private static readonly FrozenSet<ProtoId<RoleTypePrototype>> Filter =
152+
new ProtoId<RoleTypePrototype>[] {"SoloAntagonist", "TeamAntagonist", "SiliconAntagonist", "FreeAgent"}
153+
.ToFrozenSet();
151154

152155
private readonly string _antagLabelClassic = Loc.GetString("admin-overlay-antag-classic");
153156

@@ -159,14 +162,16 @@ public AdminNameOverlay(
159162
EntityLookupSystem entityLookup,
160163
IUserInterfaceManager userInterfaceManager,
161164
IConfigurationManager config,
162-
SharedRoleSystem roles)
165+
SharedRoleSystem roles,
166+
IPrototypeManager prototypeManager)
163167
{
164168
_system = system;
165169
_entityManager = entityManager;
166170
_eyeManager = eyeManager;
167171
_entityLookup = entityLookup;
168172
_userInterfaceManager = userInterfaceManager;
169173
_roles = roles;
174+
_prototypeManager = prototypeManager;
170175
ZIndex = 200;
171176
// Setting these to a specific ttf would break the antag symbols
172177
_font = resourceCache.NotoStack();
@@ -240,6 +245,14 @@ protected override void Draw(in OverlayDrawArgs args)
240245
foreach (var info in sortable.OrderBy(s => s.Item4.Y).ToList())
241246
{
242247
var playerInfo = info.Item1;
248+
var rolePrototype = playerInfo.RoleProto == null
249+
? null
250+
: _prototypeManager.Index(playerInfo.RoleProto.Value);
251+
252+
var roleName = Loc.GetString(rolePrototype?.Name ?? RoleTypePrototype.FallbackName);
253+
var roleColor = rolePrototype?.Color ?? RoleTypePrototype.FallbackColor;
254+
var roleSymbol = rolePrototype?.Symbol ?? RoleTypePrototype.FallbackSymbol;
255+
243256
var aabb = info.Item2;
244257
var entity = info.Item3;
245258
var screenCoordinatesCenter = info.Item4;
@@ -330,7 +343,7 @@ protected override void Draw(in OverlayDrawArgs args)
330343
switch (_overlaySymbolStyle)
331344
{
332345
case AdminOverlayAntagSymbolStyle.Specific:
333-
symbol = playerInfo.RoleProto.Symbol;
346+
symbol = roleSymbol;
334347
break;
335348
case AdminOverlayAntagSymbolStyle.Basic:
336349
symbol = Loc.GetString("player-tab-antag-prefix");
@@ -346,21 +359,21 @@ protected override void Draw(in OverlayDrawArgs args)
346359
switch (_overlayFormat)
347360
{
348361
case AdminOverlayAntagFormat.Roletype:
349-
color = playerInfo.RoleProto.Color;
350-
symbol = _filter.Contains(playerInfo.RoleProto) ? symbol : string.Empty;
351-
text = _filter.Contains(playerInfo.RoleProto)
352-
? Loc.GetString(playerInfo.RoleProto.Name).ToUpper()
362+
color = roleColor;
363+
symbol = IsFiltered(playerInfo.RoleProto) ? symbol : string.Empty;
364+
text = IsFiltered(playerInfo.RoleProto)
365+
? roleName.ToUpper()
353366
: string.Empty;
354367
break;
355368
case AdminOverlayAntagFormat.Subtype:
356-
color = playerInfo.RoleProto.Color;
357-
symbol = _filter.Contains(playerInfo.RoleProto) ? symbol : string.Empty;
358-
text = _filter.Contains(playerInfo.RoleProto)
359-
? _roles.GetRoleSubtypeLabel(playerInfo.RoleProto.Name, playerInfo.Subtype).ToUpper()
369+
color = roleColor;
370+
symbol = IsFiltered(playerInfo.RoleProto) ? symbol : string.Empty;
371+
text = IsFiltered(playerInfo.RoleProto)
372+
? _roles.GetRoleSubtypeLabel(roleName, playerInfo.Subtype).ToUpper()
360373
: string.Empty;
361374
break;
362375
case AdminOverlayAntagFormat.Off: // Goobstation
363-
color = playerInfo.RoleProto.Color;
376+
color = roleColor;
364377
symbol = string.Empty;
365378
text = string.Empty;
366379
break;
@@ -384,4 +397,12 @@ protected override void Draw(in OverlayDrawArgs args)
384397
drawnOverlays.Add((screenCoordinatesCenter, currentOffset));
385398
}
386399
}
400+
401+
private static bool IsFiltered(ProtoId<RoleTypePrototype>? roleProtoId)
402+
{
403+
if (roleProtoId == null)
404+
return false;
405+
406+
return Filter.Contains(roleProtoId.Value);
407+
}
387408
}

Content.Client/Administration/Systems/AdminSystem.Overlay.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
using Robust.Client.ResourceManagement;
5454
using Robust.Client.UserInterface;
5555
using Robust.Shared.Configuration;
56+
using Robust.Shared.Prototypes;
5657

5758
namespace Content.Client.Administration.Systems
5859
{
@@ -66,6 +67,7 @@ public sealed partial class AdminSystem
6667
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
6768
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
6869
[Dependency] private readonly SharedRoleSystem _roles = default!;
70+
[Dependency] private readonly IPrototypeManager _proto = default!;
6971

7072
private AdminNameOverlay _adminNameOverlay = default!;
7173

@@ -82,7 +84,8 @@ private void InitializeOverlay()
8284
_entityLookup,
8385
_userInterfaceManager,
8486
_configurationManager,
85-
_roles);
87+
_roles,
88+
_proto);
8689
_adminManager.AdminStatusUpdated += OnAdminStatusUpdated;
8790
}
8891

Content.Client/Administration/UI/BanPanel/BanPanel.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SPDX-License-Identifier: MIT
1111
<DefaultWindow
1212
xmlns="https://spacestation14.io"
1313
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
14-
Title="{Loc ban-panel-title}" MinSize="350 500">
14+
Title="{Loc ban-panel-title}" MinSize="410 500">
1515
<BoxContainer Orientation="Vertical">
1616
<TabContainer Name="Tabs" VerticalExpand="True">
1717
<!-- Basic info -->

0 commit comments

Comments
 (0)