-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Newplayerguide
- Loading branch information
Showing
770 changed files
with
84,532 additions
and
13,943 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
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
11 changes: 11 additions & 0 deletions
11
Content.Client/DeltaV/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.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> |
82 changes: 82 additions & 0 deletions
82
Content.Client/DeltaV/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,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 | ||
} |
11 changes: 11 additions & 0 deletions
11
Content.Client/DeltaV/Administration/UI/GhostRoleSetWhitelistPanel.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.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> |
67 changes: 67 additions & 0 deletions
67
Content.Client/DeltaV/Administration/UI/GhostRoleSetWhitelistPanel.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,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
42
Content.Client/DeltaV/Administration/UI/JobWhitelistsEui.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,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
20
Content.Client/DeltaV/Administration/UI/JobWhitelistsWindow.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,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> |
Oops, something went wrong.