Skip to content

Commit

Permalink
Merge branch 'master' into Newplayerguide
Browse files Browse the repository at this point in the history
  • Loading branch information
blackknight954 authored Dec 26, 2024
2 parents 657ebf6 + 22247a1 commit 1055ccb
Show file tree
Hide file tree
Showing 770 changed files with 84,532 additions and 13,943 deletions.
13 changes: 3 additions & 10 deletions .github/mapchecker/whitelist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,10 @@ Cove: true
Lodge: true
Trade: true

#Cove:
#- WallPlastitanium
#- HighSecDoor
#Lodge:
#- WallPlastitanium
#- HighSecDoor

# TECHNICAL DEBT BELOW. These ones were added to this list to ensure other PR's would not break upon merging. It is
# the intention for this list to become empty in separate PR's.
#DartX:
#- HighSecDoor
Paladin:
- ShuttleGunDuster
Rogue:
- ShuttleGunFriendship
Bottleneck:
Expand All @@ -25,4 +18,4 @@ Watchdog:
- WindoorSecureSecurityLocked
- AirlockSecurityGlassLocked
- ThrusterSecurity
- SmallGyroscopeSecurity
- SmallGyroscopeSecurity
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ concurrency:

on:
workflow_dispatch:
# schedule:
# - cron: '0 10 * * *'
# Frontier: re-enabled autopublish
schedule:
- cron: '0 10 * * *'

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<Button Name="BanButton" Text="{Loc player-panel-ban}" Disabled="True"/>
<controls:ConfirmButton Name="RejuvenateButton" Text="{Loc player-panel-rejuvenate}" Disabled="True"/>
</GridContainer>
<Button Name="JobWhitelistsButton" Text="{Loc player-panel-job-whitelists}" SetWidth="136" SetHeight="27" Disabled="True"/> <!-- DeltaV: Job whitelists -->
</BoxContainer>
</BoxContainer>
</ui:FancyWindow>
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public sealed partial class PlayerPanel : FancyWindow
public event Action? OnLogs;
public event Action? OnDelete;
public event Action? OnRejuvenate;
public event Action<NetUserId?>? OnOpenJobWhitelists; // DeltaV

public NetUserId? TargetPlayer;
public string? TargetUsername;
Expand All @@ -52,6 +53,8 @@ public PlayerPanel(IClientAdminManager adminManager)
LogsButton.OnPressed += _ => OnLogs?.Invoke();
DeleteButton.OnPressed += _ => OnDelete?.Invoke();
RejuvenateButton.OnPressed += _ => OnRejuvenate?.Invoke();

JobWhitelistsButton.OnPressed += _ => OnOpenJobWhitelists?.Invoke(TargetPlayer); // DeltaV: Job whitelists
}

public void SetUsername(string player)
Expand Down Expand Up @@ -128,5 +131,6 @@ public void SetButtons()
LogsButton.Disabled = !_adminManager.CanCommand("adminlogs");
RejuvenateButton.Disabled = !_adminManager.HasFlag(AdminFlags.Debug);
DeleteButton.Disabled = !_adminManager.HasFlag(AdminFlags.Debug);
JobWhitelistsButton.Disabled = !_adminManager.HasFlag(AdminFlags.Whitelist); // DeltaV
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public PlayerPanelEui()
PlayerPanel.OnLogs += () => SendMessage(new PlayerPanelLogsMessage());
PlayerPanel.OnRejuvenate += () => SendMessage(new PlayerPanelRejuvenationMessage());
PlayerPanel.OnDelete+= () => SendMessage(new PlayerPanelDeleteMessage());
PlayerPanel.OnOpenJobWhitelists += id => _console.ExecuteCommand($"jobwhitelists \"{id}\""); // DeltaV

PlayerPanel.OnClose += () => SendMessage(new CloseEuiMessage());
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private void UpdatePanelInfo(ChemMasterBoundUserInterfaceState state)
};
bufferHBox.AddChild(bufferVol);

foreach (var (reagent, quantity) in state.BufferReagents)
foreach (var (reagent, quantity) in state.BufferReagents.OrderBy(x => x.Reagent.Prototype)) // Frontier: add OrderBy
{
// Try to get the prototype for the given reagent. This gives us its name.
_prototypeManager.TryIndex(reagent.Prototype, out ReagentPrototype? proto);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/CryoSleep/CryosleepWakeupWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void OnWakeupResponse(WakeupRequestMessage.Response response)
DenyButton.Disabled = false;
if (response.Status == ReturnToBodyStatus.Occupied)
Label.SetMessage(Loc.GetString("cryo-wakeup-result-occupied"));
else if (response.Status == ReturnToBodyStatus.CryopodMissing)
else if (response.Status == ReturnToBodyStatus.NoCryopodAvailable)
Label.SetMessage(Loc.GetString("cryo-wakeup-result-no-cryopod"));
else if (response.Status == ReturnToBodyStatus.BodyMissing)
Label.SetMessage(Loc.GetString("cryo-wakeup-result-no-body"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<PanelContainer
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.DeltaV.Administration.UI"
StyleClasses="BackgroundDark"
HorizontalExpand="True"
Margin="4">
<BoxContainer Orientation="Vertical">
<CheckBox Name="Department"/> <!-- Toggles all jobs in the department at once -->
<GridContainer Name="JobsContainer" Columns="4"/> <!-- Populated with each job to toggle individually-->
</BoxContainer>
</PanelContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
using Content.Shared.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;

namespace Content.Client.DeltaV.Administration.UI;

[GenerateTypedNameReferences]
public sealed partial class DepartmentWhitelistPanel : PanelContainer
{
public Action<ProtoId<JobPrototype>, bool>? OnSetJob;

public DepartmentWhitelistPanel(DepartmentPrototype department, IPrototypeManager proto, HashSet<ProtoId<JobPrototype>> whitelists, bool globalWhitelist) // Frontier: add globalWhitelist
{
RobustXamlLoader.Load(this);

var anyValid = false;//
var allWhitelisted = true;
var grey = Color.FromHex("#ccc");
foreach (var id in department.Roles)
{
var thisJob = id; // closure capturing funny

// Frontier: skip non-whitelisted roles, cache prototype
var jobProto = proto.Index(id);
if (!jobProto.Whitelisted)
continue;
else
anyValid = true;
// End Frontier

var button = new CheckBox();
button.Text = jobProto.LocalizedName;
if (!jobProto.Whitelisted)
button.Modulate = grey; // Let admins know whitelisting this job is only for futureproofing.
button.Pressed = whitelists.Contains(id) || globalWhitelist;
button.OnPressed += _ => OnButtonPressed(thisJob, button, globalWhitelist); // Frontier: check global whitelist
JobsContainer.AddChild(button);

allWhitelisted &= button.Pressed;
}

if (!anyValid) // Frontier: hide checkbox set if no valid events
Visible = false; // Frontier

Department.Text = Loc.GetString(department.Name);
Department.Modulate = department.Color;
Department.Pressed = allWhitelisted;
Department.OnPressed += args => OnDepartmentPressed(department, proto, whitelists, globalWhitelist); // Frontier: check global whitelist
}

// Frontier: global whitelist handling
private void OnButtonPressed(ProtoId<JobPrototype> thisJob, CheckBox button, bool globalWhitelist)
{
if (globalWhitelist)
button.Pressed = true; // Force the button on.
else
OnSetJob?.Invoke(thisJob, button.Pressed);
}

private void OnDepartmentPressed(DepartmentPrototype department, IPrototypeManager proto, HashSet<ProtoId<JobPrototype>> whitelists, bool globalWhitelist)
{
// Frontier: global override
if (globalWhitelist)
{
Department.Pressed = true;
return;
}
// End Frontier: global override

foreach (var id in department.Roles)
{
// only request to whitelist roles that aren't already whitelisted, and vice versa - Frontier: roles must be whitelisted
if (whitelists.Contains(id) != Department.Pressed && proto.Index(id).Whitelisted)
OnSetJob?.Invoke(id, Department.Pressed);
}
}
// End Frontier
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<PanelContainer
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.DeltaV.Administration.UI"
StyleClasses="BackgroundDark"
HorizontalExpand="True"
Margin="4"> <!-- Frontier: ghost role set whitelist -->
<BoxContainer Orientation="Vertical">
<CheckBox Name="GhostRoleSet"/> <!-- Toggles all jobs in the department at once -->
<GridContainer Name="RolesContainer" Columns="4"/> <!-- Populated with each job to toggle individually-->
</BoxContainer>
</PanelContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using Content.Shared.Ghost.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;

namespace Content.Client.DeltaV.Administration.UI;

// Frontier: ghost role whitelist set
[GenerateTypedNameReferences]
public sealed partial class GhostRoleSetWhitelistPanel : PanelContainer
{
public Action<ProtoId<GhostRolePrototype>, bool>? OnSetGhostRole;

public GhostRoleSetWhitelistPanel(List<ProtoId<GhostRolePrototype>> ghostRoleList, string ghostRoleSetName, Color ghostRoleSetColor, IPrototypeManager proto, HashSet<ProtoId<GhostRolePrototype>> whitelists, bool globalWhitelist)
{
RobustXamlLoader.Load(this);

var allWhitelisted = true;
foreach (var id in ghostRoleList)
{
var thisRole = id; // closure capturing funny
var button = new CheckBox();
button.Text = Loc.GetString(proto.Index(id).Name);
button.Pressed = whitelists.Contains(id) || globalWhitelist;
button.OnPressed += _ => OnButtonPressed(thisRole, button, globalWhitelist);
RolesContainer.AddChild(button);

allWhitelisted &= button.Pressed;
}

GhostRoleSet.Text = Loc.GetString(ghostRoleSetName);
GhostRoleSet.Modulate = ghostRoleSetColor;
GhostRoleSet.Pressed = allWhitelisted;
GhostRoleSet.OnPressed += args => OnDepartmentPressed(ghostRoleList, whitelists, globalWhitelist);
}

// Frontier: global whitelist
private void OnButtonPressed(ProtoId<GhostRolePrototype> thisRole, CheckBox button, bool globalWhitelist)
{
if (globalWhitelist)
button.Pressed = true; // Force the button on.
else
OnSetGhostRole?.Invoke(thisRole, button.Pressed);
}

private void OnDepartmentPressed(List<ProtoId<GhostRolePrototype>> ghostRoleList, HashSet<ProtoId<GhostRolePrototype>> whitelists, bool globalWhitelist)
{
// Frontier: global override
if (globalWhitelist)
{
GhostRoleSet.Pressed = true;
return;
}
// End Frontier: global override

foreach (var id in ghostRoleList)
{
// only request to whitelist roles that aren't already whitelisted, and vice versa
if (whitelists.Contains(id) != GhostRoleSet.Pressed)
OnSetGhostRole?.Invoke(id, GhostRoleSet.Pressed);
}
}
// End Frontier

}
// End Frontier
42 changes: 42 additions & 0 deletions Content.Client/DeltaV/Administration/UI/JobWhitelistsEui.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Content.Client.Eui;
using Content.Shared.DeltaV.Administration;
using Content.Shared.Eui;

namespace Content.Client.DeltaV.Administration.UI;

public sealed class JobWhitelistsEui : BaseEui
{
private JobWhitelistsWindow Window;

public JobWhitelistsEui()
{
Window = new JobWhitelistsWindow();
Window.OnClose += () => SendMessage(new CloseEuiMessage());
Window.OnSetJob += (id, whitelisted) => SendMessage(new SetJobWhitelistedMessage(id, whitelisted));
Window.OnSetGhostRole += (id, whitelisted) => SendMessage(new SetGhostRoleWhitelistedMessage(id, whitelisted)); // Frontier
Window.OnSetGlobal += (whitelisted) => SendMessage(new SetGlobalWhitelistMessage(whitelisted)); // Frontier
}

public override void HandleState(EuiStateBase state)
{
if (state is not JobWhitelistsEuiState cast)
return;

Window.HandleState(cast);
}

public override void Opened()
{
base.Opened();

Window.OpenCentered();
}

public override void Closed()
{
base.Closed();

Window.Close();
Window.Dispose();
}
}
20 changes: 20 additions & 0 deletions Content.Client/DeltaV/Administration/UI/JobWhitelistsWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<controls:FancyWindow
xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc player-panel-job-whitelists}" MinSize="750 600">
<BoxContainer Orientation="Vertical">
<Label Name="PlayerName" Margin="4"/>
<BoxContainer Orientation="Horizontal" Margin="4">
<BoxContainer Name="TierButtons" Orientation="Horizontal"/>
</BoxContainer>
<ScrollContainer VerticalExpand="True">
<!-- Frontier: global checkbox -->
<BoxContainer Orientation="Vertical">
<CheckBox Name="Global" Margin="4"/>
<BoxContainer Name="Departments" Orientation="Vertical"/>
<BoxContainer Name="GhostRoles" Orientation="Vertical"/> <!-- Frontier: ghost roles -->
</BoxContainer>
<!-- End Frontier: global checkbox -->
</ScrollContainer>
</BoxContainer>
</controls:FancyWindow>
Loading

0 comments on commit 1055ccb

Please sign in to comment.