-
Notifications
You must be signed in to change notification settings - Fork 596
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 accentless-gobbos
- Loading branch information
Showing
1,843 changed files
with
47,598 additions
and
15,587 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
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
41 changes: 41 additions & 0 deletions
41
Content.Client/Stack/StackCustomSplitBoundUserInterface.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,41 @@ | ||
// Cherry-picked from space-station-14#32938 courtesy of Ilya246 | ||
using JetBrains.Annotations; | ||
using Content.Shared.Stacks; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.UserInterface; | ||
|
||
namespace Content.Client.Stack | ||
{ | ||
[UsedImplicitly] | ||
public sealed class StackCustomSplitBoundUserInterface : BoundUserInterface | ||
{ | ||
private IEntityManager _entManager; | ||
private EntityUid _owner; | ||
[ViewVariables] | ||
private StackCustomSplitWindow? _window; | ||
|
||
public StackCustomSplitBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
_owner = owner; | ||
_entManager = IoCManager.Resolve<IEntityManager>(); | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
_window = this.CreateWindow<StackCustomSplitWindow>(); | ||
|
||
if (_entManager.TryGetComponent<StackComponent>(_owner, out var comp)) | ||
_window.SetMax(comp.Count); | ||
|
||
_window.ApplyButton.OnPressed += _ => | ||
{ | ||
if (int.TryParse(_window.AmountLineEdit.Text, out var i)) | ||
{ | ||
SendMessage(new StackCustomSplitAmountMessage(i)); | ||
_window.Close(); | ||
} | ||
}; | ||
} | ||
} | ||
} |
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,15 @@ | ||
<DefaultWindow xmlns="https://spacestation14.io" | ||
Title="{Loc 'ui-custom-stack-split-title'}" | ||
Resizable="False"> | ||
<!--Cherry-picked from space-station-14#32938 courtesy of Ilya246--> | ||
|
||
<BoxContainer Orientation="Vertical" SeparationOverride="4" MinSize="240 80"> | ||
<BoxContainer Orientation="Horizontal"> | ||
<LineEdit Name="AmountLineEdit" Access="Public" HorizontalExpand="True" PlaceHolder="{Loc 'ui-custom-stack-split-line-edit-placeholder'}"/> | ||
</BoxContainer> | ||
<BoxContainer Orientation="Horizontal"> | ||
<Label Name="MaximumAmount" Access="Public" /> | ||
</BoxContainer> | ||
<Button Name="ApplyButton" Access="Public" Text="{Loc 'ui-custom-stack-split-apply'}"/> | ||
</BoxContainer> | ||
</DefaultWindow> |
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,35 @@ | ||
// Cherry-picked from space-station-14#32938 courtesy of Ilya246 | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.CustomControls; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client.Stack | ||
{ | ||
[GenerateTypedNameReferences] | ||
public sealed partial class StackCustomSplitWindow : DefaultWindow | ||
{ | ||
private int _max = Int32.MaxValue; | ||
private int _min = 1; | ||
|
||
public StackCustomSplitWindow() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
AmountLineEdit.OnTextChanged += OnValueChanged; | ||
} | ||
|
||
public void SetMax(int max) | ||
{ | ||
_max = max; | ||
MaximumAmount.Text = Loc.GetString("comp-stack-split-size", ("size", _max)); | ||
} | ||
|
||
private void OnValueChanged(LineEdit.LineEditEventArgs args) | ||
{ | ||
if (!int.TryParse(AmountLineEdit.Text, out var amount) || amount > _max || amount < _min) | ||
ApplyButton.Disabled = true; | ||
else | ||
ApplyButton.Disabled = false; | ||
} | ||
} | ||
} |
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
4 changes: 2 additions & 2 deletions
4
...ltaV/Abilities/CrawlUnderObjectsSystem.cs → .../_DV/Abilities/CrawlUnderObjectsSystem.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
11 changes: 11 additions & 0 deletions
11
Content.Client/_DV/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._DV.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/_DV/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._DV.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/_DV/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._DV.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> |
Oops, something went wrong.