Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Апстримчик #103

Merged
merged 53 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7fbbcb8
Nerf scrapbot on asteroids (#2535)
ErhardSteinhauer Dec 8, 2024
6533755
Automatic Changelog (#2535)
FrontierATC Dec 8, 2024
f9ae04f
NFSD Outpost Criminal Records Fix (#2440)
Qulibly Dec 8, 2024
40556b5
Automatic Changelog (#2440)
FrontierATC Dec 8, 2024
bcbd6e6
Allow linking defaults on conveyors (#2486)
Alkheemist Dec 8, 2024
9dac684
Automatic Changelog (#2486)
FrontierATC Dec 8, 2024
704ad86
Dehydratable Sharkminnow (#2529)
whatston3 Dec 8, 2024
6149dd0
Makes coins stackable (#2534)
whatston3 Dec 8, 2024
2989b39
More toy-like emotional support RPG sprites & sounds (#2532)
whatston3 Dec 8, 2024
bf42561
Automatic Changelog (#2534)
FrontierATC Dec 8, 2024
738c958
Automatic Changelog (#2532)
FrontierATC Dec 8, 2024
3d10c2e
Disable hostile ai on protected grids (#2398)
GreaseMonk Dec 9, 2024
083f6a2
Automatic Changelog (#2398)
FrontierATC Dec 9, 2024
c45e5c5
Directional fans (#2368)
PeccNeck Dec 9, 2024
e5dd93f
Charon (New Shuttle) (#2119)
chrome-cirrus Dec 9, 2024
975437a
Automatic Changelog (#2119)
FrontierATC Dec 9, 2024
2f5369e
Science Rebalance: The Point of Points (#2537)
whatston3 Dec 9, 2024
ab9ce59
Automatic Changelog (#2537)
FrontierATC Dec 9, 2024
5399a7f
New shade for 100k bills (#2536)
Unkn0wnGh0st333 Dec 9, 2024
68c1acf
Technology disks: cleanup, removing references, upstream values (#2418)
dvir001 Dec 10, 2024
46c8438
BuckleSystem: stop setting every interaction as handled (#2538)
whatston3 Dec 10, 2024
951e83d
Automatic Changelog (#2538)
FrontierATC Dec 10, 2024
157cb01
Whitelists Panel (DeltaV) (#2152)
dvir001 Dec 10, 2024
a96da60
Update base_borg_chassis.yml (#2539)
dvir001 Dec 10, 2024
cc69ddd
Automatic Changelog (#2539)
FrontierATC Dec 10, 2024
0c94a1c
Restore AutoWakeUpComponent function (#2540)
whatston3 Dec 10, 2024
2fd8cc6
Automatic Changelog (#2540)
FrontierATC Dec 10, 2024
c09e8e3
Fix publish indentation (#2548)
whatston3 Dec 11, 2024
8883a60
Fix Empress Double Thruster (#2550)
Myzumi Dec 11, 2024
c842996
Automatic Changelog (#2550)
FrontierATC Dec 11, 2024
4874ec2
Chem Dispenser: Upgradable number of slots (#2544)
whatston3 Dec 11, 2024
72cc6bb
Bluespace Jug (#2549)
whatston3 Dec 11, 2024
5c2bda2
Automatic Changelog (#2544)
FrontierATC Dec 11, 2024
12f94e4
Automatic Changelog (#2549)
FrontierATC Dec 11, 2024
d070943
Add an auto-labeller to the chem dispenser (#2542)
whatston3 Dec 11, 2024
a704d36
Automatic Changelog (#2542)
FrontierATC Dec 11, 2024
30833e7
Blue wreck loot rework (#2531)
dvir001 Dec 12, 2024
f0338aa
Automatic Changelog (#2531)
FrontierATC Dec 12, 2024
ce71708
SalvageMobRestrictions: don't warn/log safe mobs (#2552)
whatston3 Dec 12, 2024
7d13e63
Automatic Changelog (#2552)
FrontierATC Dec 12, 2024
17b74ae
Port researchable syringe gun (DeltaV#2169, DeltaV#2249) (#2528)
whatston3 Dec 12, 2024
bd4a80f
Automatic Changelog (#2528)
FrontierATC Dec 12, 2024
453699f
make the shuttles compatible with MapRenderer (#2556)
lermal Dec 13, 2024
6ef7a45
Automatic Changelog (#2556)
FrontierATC Dec 13, 2024
72c906d
Dungeons hotfix (#2560)
dvir001 Dec 13, 2024
5d4db82
Automatic Changelog (#2560)
FrontierATC Dec 13, 2024
c96d0af
Faction Revisions (#2561)
whatston3 Dec 14, 2024
6a12841
Automatic Changelog (#2561)
FrontierATC Dec 14, 2024
26e962e
conflicts
Zekins3366 Dec 14, 2024
d5cddba
conflicts
Zekins3366 Dec 14, 2024
d16447e
minifix
Zekins3366 Dec 14, 2024
97ec82f
minifix
Zekins3366 Dec 14, 2024
19d8bcf
fix' minor
mersen-tyn Dec 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:
on:
workflow_dispatch:
# Frontier: re-enabled autopublish
schedule:
schedule:
- cron: '0 10 * * *'

jobs:
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
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>
108 changes: 108 additions & 0 deletions Content.Client/DeltaV/Administration/UI/JobWhitelistsWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.Database;
using Content.Shared.DeltaV.Administration;
using Content.Shared.Roles;
using Content.Shared.DeltaV.Whitelist;
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;
using Content.Shared.Ghost.Roles;

namespace Content.Client.DeltaV.Administration.UI;

/// <summary>
/// An admin panel to toggle whitelists for individual jobs or entire departments.
/// This should generally be preferred to a blanket whitelist (Whitelisted: True) since
/// being good with a batong doesn't mean you know engineering and vice versa.
/// </summary>
[GenerateTypedNameReferences]
public sealed partial class JobWhitelistsWindow : FancyWindow
{
[Dependency] private readonly IPrototypeManager _proto = default!;

public Action<ProtoId<JobPrototype>, bool>? OnSetJob;
public Action<ProtoId<GhostRolePrototype>, bool>? OnSetGhostRole; // Frontier
public Action<bool>? OnSetGlobal; // Frontier

public JobWhitelistsWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

PlayerName.Text = "???";
InitializeTierButtons();

// Frontier: global whitelist button
Global.Text = Loc.GetString("player-panel-global-whitelist");
Global.OnPressed += _ => OnSetGlobal?.Invoke(Global.Pressed);
Global.Modulate = Color.FromHex("#f0c65d");
// End Frontier
}

private void InitializeTierButtons()
{
foreach (var tier in _proto.EnumeratePrototypes<WhitelistTierPrototype>())
{
var button = new Button
{
Text = Loc.GetString(tier.Name),
Modulate = tier.Color
};

button.OnPressed += _ => ApplyWhitelistTier(tier);
TierButtons.AddChild(button);
}
}

private void ApplyWhitelistTier(WhitelistTierPrototype tier)
{
foreach (var jobId in tier.Jobs)
{
OnSetJob?.Invoke(jobId, true);
}

// Frontier: ghost role prototypes
foreach (var ghostRoleId in tier.GhostRoles)
{
OnSetGhostRole?.Invoke(ghostRoleId, true);
}
// End Frontier
}

public void HandleState(JobWhitelistsEuiState state)
{
PlayerName.Text = state.PlayerName;

// Frontier: global whitelist
Global.Pressed = state.GlobalWhitelist;
// End Frontier

Departments.RemoveAllChildren();
foreach (var proto in _proto.EnumeratePrototypes<DepartmentPrototype>())
{
// Frontier: skip empty departments
if (proto.Roles.Count <= 0)
continue;
// End Frontier

var panel = new DepartmentWhitelistPanel(proto, _proto, state.Whitelists, state.GlobalWhitelist);
panel.OnSetJob += (id, whitelisting) => OnSetJob?.Invoke(id, whitelisting);
Departments.AddChild(panel);
}
// Frontier: ghost role prototypes
GhostRoles.RemoveAllChildren();
List<ProtoId<GhostRolePrototype>> ghostRoles = new();
foreach (var proto in _proto.EnumeratePrototypes<GhostRolePrototype>())
{
if (proto.Whitelisted)
ghostRoles.Add(proto.ID);
}
var ghostRolePanel = new GhostRoleSetWhitelistPanel(ghostRoles, Loc.GetString("player-panel-ghost-role-whitelists"), Color.FromHex("#71f0ca"), _proto, state.GhostRoleWhitelists, state.GlobalWhitelist);
ghostRolePanel.OnSetGhostRole += (id, whitelisting) => OnSetGhostRole?.Invoke(id, whitelisting);
GhostRoles.AddChild(ghostRolePanel);
// End Frontier
}
}
Loading
Loading