Skip to content

Commit cce804d

Browse files
authored
Merge branch 'master' into sheriff-PTech-update
2 parents 96370a6 + 396a460 commit cce804d

File tree

531 files changed

+27649
-11461
lines changed

Some content is hidden

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

531 files changed

+27649
-11461
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ concurrency:
66
on:
77
workflow_dispatch:
88
# Frontier: re-enabled autopublish
9-
schedule:
9+
schedule:
1010
- cron: '0 10 * * *'
1111

1212
jobs:

Content.Client/Administration/UI/PlayerPanel/PlayerPanel.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<Button Name="BanButton" Text="{Loc player-panel-ban}" Disabled="True"/>
3232
<controls:ConfirmButton Name="RejuvenateButton" Text="{Loc player-panel-rejuvenate}" Disabled="True"/>
3333
</GridContainer>
34+
<Button Name="JobWhitelistsButton" Text="{Loc player-panel-job-whitelists}" SetWidth="136" SetHeight="27" Disabled="True"/> <!-- DeltaV: Job whitelists -->
3435
</BoxContainer>
3536
</BoxContainer>
3637
</ui:FancyWindow>

Content.Client/Administration/UI/PlayerPanel/PlayerPanel.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public sealed partial class PlayerPanel : FancyWindow
2626
public event Action? OnLogs;
2727
public event Action? OnDelete;
2828
public event Action? OnRejuvenate;
29+
public event Action<NetUserId?>? OnOpenJobWhitelists; // DeltaV
2930

3031
public NetUserId? TargetPlayer;
3132
public string? TargetUsername;
@@ -52,6 +53,8 @@ public PlayerPanel(IClientAdminManager adminManager)
5253
LogsButton.OnPressed += _ => OnLogs?.Invoke();
5354
DeleteButton.OnPressed += _ => OnDelete?.Invoke();
5455
RejuvenateButton.OnPressed += _ => OnRejuvenate?.Invoke();
56+
57+
JobWhitelistsButton.OnPressed += _ => OnOpenJobWhitelists?.Invoke(TargetPlayer); // DeltaV: Job whitelists
5558
}
5659

5760
public void SetUsername(string player)
@@ -128,5 +131,6 @@ public void SetButtons()
128131
LogsButton.Disabled = !_adminManager.CanCommand("adminlogs");
129132
RejuvenateButton.Disabled = !_adminManager.HasFlag(AdminFlags.Debug);
130133
DeleteButton.Disabled = !_adminManager.HasFlag(AdminFlags.Debug);
134+
JobWhitelistsButton.Disabled = !_adminManager.HasFlag(AdminFlags.Whitelist); // DeltaV
131135
}
132136
}

Content.Client/Administration/UI/PlayerPanel/PlayerPanelEui.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public PlayerPanelEui()
3838
PlayerPanel.OnLogs += () => SendMessage(new PlayerPanelLogsMessage());
3939
PlayerPanel.OnRejuvenate += () => SendMessage(new PlayerPanelRejuvenationMessage());
4040
PlayerPanel.OnDelete+= () => SendMessage(new PlayerPanelDeleteMessage());
41+
PlayerPanel.OnOpenJobWhitelists += id => _console.ExecuteCommand($"jobwhitelists \"{id}\""); // DeltaV
4142

4243
PlayerPanel.OnClose += () => SendMessage(new CloseEuiMessage());
4344
}

Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private void UpdatePanelInfo(ChemMasterBoundUserInterfaceState state)
182182
};
183183
bufferHBox.AddChild(bufferVol);
184184

185-
foreach (var (reagent, quantity) in state.BufferReagents)
185+
foreach (var (reagent, quantity) in state.BufferReagents.OrderBy(x => x.Reagent.Prototype)) // Frontier: add OrderBy
186186
{
187187
// Try to get the prototype for the given reagent. This gives us its name.
188188
_prototypeManager.TryIndex(reagent.Prototype, out ReagentPrototype? proto);

Content.Client/CryoSleep/CryosleepWakeupWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private void OnWakeupResponse(WakeupRequestMessage.Response response)
9797
DenyButton.Disabled = false;
9898
if (response.Status == ReturnToBodyStatus.Occupied)
9999
Label.SetMessage(Loc.GetString("cryo-wakeup-result-occupied"));
100-
else if (response.Status == ReturnToBodyStatus.CryopodMissing)
100+
else if (response.Status == ReturnToBodyStatus.NoCryopodAvailable)
101101
Label.SetMessage(Loc.GetString("cryo-wakeup-result-no-cryopod"));
102102
else if (response.Status == ReturnToBodyStatus.BodyMissing)
103103
Label.SetMessage(Loc.GetString("cryo-wakeup-result-no-body"));
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<PanelContainer
2+
xmlns="https://spacestation14.io"
3+
xmlns:cc="clr-namespace:Content.Client.DeltaV.Administration.UI"
4+
StyleClasses="BackgroundDark"
5+
HorizontalExpand="True"
6+
Margin="4">
7+
<BoxContainer Orientation="Vertical">
8+
<CheckBox Name="Department"/> <!-- Toggles all jobs in the department at once -->
9+
<GridContainer Name="JobsContainer" Columns="4"/> <!-- Populated with each job to toggle individually-->
10+
</BoxContainer>
11+
</PanelContainer>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using Content.Shared.Roles;
2+
using Robust.Client.AutoGenerated;
3+
using Robust.Client.UserInterface;
4+
using Robust.Client.UserInterface.Controls;
5+
using Robust.Client.UserInterface.CustomControls;
6+
using Robust.Client.UserInterface.XAML;
7+
using Robust.Shared.Prototypes;
8+
9+
namespace Content.Client.DeltaV.Administration.UI;
10+
11+
[GenerateTypedNameReferences]
12+
public sealed partial class DepartmentWhitelistPanel : PanelContainer
13+
{
14+
public Action<ProtoId<JobPrototype>, bool>? OnSetJob;
15+
16+
public DepartmentWhitelistPanel(DepartmentPrototype department, IPrototypeManager proto, HashSet<ProtoId<JobPrototype>> whitelists, bool globalWhitelist) // Frontier: add globalWhitelist
17+
{
18+
RobustXamlLoader.Load(this);
19+
20+
var anyValid = false;//
21+
var allWhitelisted = true;
22+
var grey = Color.FromHex("#ccc");
23+
foreach (var id in department.Roles)
24+
{
25+
var thisJob = id; // closure capturing funny
26+
27+
// Frontier: skip non-whitelisted roles, cache prototype
28+
var jobProto = proto.Index(id);
29+
if (!jobProto.Whitelisted)
30+
continue;
31+
else
32+
anyValid = true;
33+
// End Frontier
34+
35+
var button = new CheckBox();
36+
button.Text = jobProto.LocalizedName;
37+
if (!jobProto.Whitelisted)
38+
button.Modulate = grey; // Let admins know whitelisting this job is only for futureproofing.
39+
button.Pressed = whitelists.Contains(id) || globalWhitelist;
40+
button.OnPressed += _ => OnButtonPressed(thisJob, button, globalWhitelist); // Frontier: check global whitelist
41+
JobsContainer.AddChild(button);
42+
43+
allWhitelisted &= button.Pressed;
44+
}
45+
46+
if (!anyValid) // Frontier: hide checkbox set if no valid events
47+
Visible = false; // Frontier
48+
49+
Department.Text = Loc.GetString(department.Name);
50+
Department.Modulate = department.Color;
51+
Department.Pressed = allWhitelisted;
52+
Department.OnPressed += args => OnDepartmentPressed(department, proto, whitelists, globalWhitelist); // Frontier: check global whitelist
53+
}
54+
55+
// Frontier: global whitelist handling
56+
private void OnButtonPressed(ProtoId<JobPrototype> thisJob, CheckBox button, bool globalWhitelist)
57+
{
58+
if (globalWhitelist)
59+
button.Pressed = true; // Force the button on.
60+
else
61+
OnSetJob?.Invoke(thisJob, button.Pressed);
62+
}
63+
64+
private void OnDepartmentPressed(DepartmentPrototype department, IPrototypeManager proto, HashSet<ProtoId<JobPrototype>> whitelists, bool globalWhitelist)
65+
{
66+
// Frontier: global override
67+
if (globalWhitelist)
68+
{
69+
Department.Pressed = true;
70+
return;
71+
}
72+
// End Frontier: global override
73+
74+
foreach (var id in department.Roles)
75+
{
76+
// only request to whitelist roles that aren't already whitelisted, and vice versa - Frontier: roles must be whitelisted
77+
if (whitelists.Contains(id) != Department.Pressed && proto.Index(id).Whitelisted)
78+
OnSetJob?.Invoke(id, Department.Pressed);
79+
}
80+
}
81+
// End Frontier
82+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<PanelContainer
2+
xmlns="https://spacestation14.io"
3+
xmlns:cc="clr-namespace:Content.Client.DeltaV.Administration.UI"
4+
StyleClasses="BackgroundDark"
5+
HorizontalExpand="True"
6+
Margin="4"> <!-- Frontier: ghost role set whitelist -->
7+
<BoxContainer Orientation="Vertical">
8+
<CheckBox Name="GhostRoleSet"/> <!-- Toggles all jobs in the department at once -->
9+
<GridContainer Name="RolesContainer" Columns="4"/> <!-- Populated with each job to toggle individually-->
10+
</BoxContainer>
11+
</PanelContainer>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
using Content.Shared.Ghost.Roles;
2+
using Robust.Client.AutoGenerated;
3+
using Robust.Client.UserInterface.Controls;
4+
using Robust.Client.UserInterface.XAML;
5+
using Robust.Shared.Prototypes;
6+
7+
namespace Content.Client.DeltaV.Administration.UI;
8+
9+
// Frontier: ghost role whitelist set
10+
[GenerateTypedNameReferences]
11+
public sealed partial class GhostRoleSetWhitelistPanel : PanelContainer
12+
{
13+
public Action<ProtoId<GhostRolePrototype>, bool>? OnSetGhostRole;
14+
15+
public GhostRoleSetWhitelistPanel(List<ProtoId<GhostRolePrototype>> ghostRoleList, string ghostRoleSetName, Color ghostRoleSetColor, IPrototypeManager proto, HashSet<ProtoId<GhostRolePrototype>> whitelists, bool globalWhitelist)
16+
{
17+
RobustXamlLoader.Load(this);
18+
19+
var allWhitelisted = true;
20+
foreach (var id in ghostRoleList)
21+
{
22+
var thisRole = id; // closure capturing funny
23+
var button = new CheckBox();
24+
button.Text = Loc.GetString(proto.Index(id).Name);
25+
button.Pressed = whitelists.Contains(id) || globalWhitelist;
26+
button.OnPressed += _ => OnButtonPressed(thisRole, button, globalWhitelist);
27+
RolesContainer.AddChild(button);
28+
29+
allWhitelisted &= button.Pressed;
30+
}
31+
32+
GhostRoleSet.Text = Loc.GetString(ghostRoleSetName);
33+
GhostRoleSet.Modulate = ghostRoleSetColor;
34+
GhostRoleSet.Pressed = allWhitelisted;
35+
GhostRoleSet.OnPressed += args => OnDepartmentPressed(ghostRoleList, whitelists, globalWhitelist);
36+
}
37+
38+
// Frontier: global whitelist
39+
private void OnButtonPressed(ProtoId<GhostRolePrototype> thisRole, CheckBox button, bool globalWhitelist)
40+
{
41+
if (globalWhitelist)
42+
button.Pressed = true; // Force the button on.
43+
else
44+
OnSetGhostRole?.Invoke(thisRole, button.Pressed);
45+
}
46+
47+
private void OnDepartmentPressed(List<ProtoId<GhostRolePrototype>> ghostRoleList, HashSet<ProtoId<GhostRolePrototype>> whitelists, bool globalWhitelist)
48+
{
49+
// Frontier: global override
50+
if (globalWhitelist)
51+
{
52+
GhostRoleSet.Pressed = true;
53+
return;
54+
}
55+
// End Frontier: global override
56+
57+
foreach (var id in ghostRoleList)
58+
{
59+
// only request to whitelist roles that aren't already whitelisted, and vice versa
60+
if (whitelists.Contains(id) != GhostRoleSet.Pressed)
61+
OnSetGhostRole?.Invoke(id, GhostRoleSet.Pressed);
62+
}
63+
}
64+
// End Frontier
65+
66+
}
67+
// End Frontier

0 commit comments

Comments
 (0)