-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Aidenkrz/upstreammerge
Upstream Merge
- Loading branch information
Showing
451 changed files
with
18,382 additions
and
6,912 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Content.Client/Administration/UI/DepartmentWhitelistPanel.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.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> |
49 changes: 49 additions & 0 deletions
49
Content.Client/Administration/UI/DepartmentWhitelistPanel.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
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.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) | ||
{ | ||
RobustXamlLoader.Load(this); | ||
|
||
var allWhitelisted = true; | ||
var grey = Color.FromHex("#ccc"); | ||
foreach (var id in department.Roles) | ||
{ | ||
var thisJob = id; // closure capturing funny | ||
var button = new CheckBox(); | ||
button.Text = proto.Index<JobPrototype>(id).LocalizedName; | ||
if (!proto.Index<JobPrototype>(id).Whitelisted) | ||
button.Modulate = grey; // Let admins know whitelisting this job is only for futureproofing. | ||
button.Pressed = whitelists.Contains(id); | ||
button.OnPressed += _ => OnSetJob?.Invoke(thisJob, button.Pressed); | ||
JobsContainer.AddChild(button); | ||
|
||
allWhitelisted &= button.Pressed; | ||
} | ||
|
||
Department.Text = Loc.GetString(department.ID); | ||
Department.Modulate = department.Color; | ||
Department.Pressed = allWhitelisted; | ||
Department.OnPressed += args => | ||
{ | ||
foreach (var id in department.Roles) | ||
{ | ||
// only request to whitelist roles that aren't already whitelisted, and vice versa | ||
if (whitelists.Contains(id) != Department.Pressed) | ||
OnSetJob?.Invoke(id, Department.Pressed); | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Content.Client.Eui; | ||
using Content.Shared.Administration; | ||
using Content.Shared.Eui; | ||
|
||
namespace Content.Client.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)); | ||
} | ||
|
||
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<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"/> | ||
<ScrollContainer VerticalExpand="True"> | ||
<BoxContainer Name="Departments" Orientation="Vertical"/> <!-- Populated with DepartmentWhitelistPanel --> | ||
</ScrollContainer> | ||
</BoxContainer> | ||
</controls:FancyWindow> |
46 changes: 46 additions & 0 deletions
46
Content.Client/Administration/UI/JobWhitelistsWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Content.Client.UserInterface.Controls; | ||
using Content.Shared.Database; | ||
using Content.Shared.Administration; | ||
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.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 JobWhitelistsWindow() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
IoCManager.InjectDependencies(this); | ||
|
||
PlayerName.Text = "???"; | ||
} | ||
|
||
public void HandleState(JobWhitelistsEuiState state) | ||
{ | ||
PlayerName.Text = state.PlayerName; | ||
|
||
Departments.RemoveAllChildren(); | ||
foreach (var proto in _proto.EnumeratePrototypes<DepartmentPrototype>()) | ||
{ | ||
var panel = new DepartmentWhitelistPanel(proto, _proto, state.Whitelists); | ||
panel.OnSetJob += (id, whitelisting) => OnSetJob?.Invoke(id, whitelisting); | ||
Departments.AddChild(panel); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using Content.Shared.Chapel; | ||
|
||
namespace Content.Client.Chapel; | ||
|
||
public sealed class SacrificialAltarSystem : SharedSacrificialAltarSystem; |
2 changes: 1 addition & 1 deletion
2
Content.Client/Arachne/CocoonSystem.cs → Content.Client/Cocoon/CocoonSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.