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

Merge for fixing a conflict #1

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
dcc1c38
Engine Update v237.2.0 (#1270)
sleepyyapril Nov 24, 2024
613e793
[QoL] Show Oni Damage Bonus In Damage Examine (#1268)
angelofallars Nov 24, 2024
5fe4b1e
Automatic Changelog Update (#1268)
SimpleStation14 Nov 24, 2024
f046306
Loadouts V4 (#1164)
DEATHB4DEFEAT Nov 25, 2024
57917a7
Automatic Changelog Update (#1164)
SimpleStation14 Nov 25, 2024
1d65d54
[Fix] Added Robust.Xaml to the Project Solution (#1266)
Remuchi Nov 26, 2024
39f4ad8
Update Credits (#1274)
github-actions[bot] Nov 26, 2024
6c2b2a8
Fixes Make Cultist Admin Verb to Act on Target Not Self (#1289)
rbertoche Nov 27, 2024
f133b9b
IPC Instrument Menu Fix (#1287)
sleepyyapril Nov 27, 2024
92a6e09
Automatic Changelog Update (#1287)
SimpleStation14 Nov 27, 2024
b040760
Fix Bug with Opening Storage Containers (#1292)
sleepyyapril Nov 29, 2024
9a40c37
Automatic Changelog Update (#1292)
SimpleStation14 Nov 29, 2024
3272475
Change Target Doll Icon For Ashen Theme (#1282)
DocNITE Nov 29, 2024
d4879f9
Fix Applicable Medication Stack Bug (#1278)
Tmanzxd Nov 29, 2024
8d485e8
Automatic Changelog Update (#1278)
SimpleStation14 Nov 29, 2024
1a97635
Re-Enable Language Color and Font (#1294)
angelofallars Nov 29, 2024
7d802e3
Automatic Changelog Update (#1294)
SimpleStation14 Nov 29, 2024
2eafa0d
Shitmed Update 2 - [Insert Snarky Remark] (#1271)
gluesniffler Nov 30, 2024
b8e75da
Admin Tooling Cherry Picks (#1290)
sleepyyapril Nov 30, 2024
d58d397
Automatic Changelog Update (#1271)
SimpleStation14 Nov 30, 2024
0bd9a9e
More Loadout Equipment (#1281)
VMSolidus Nov 30, 2024
c7f1b4f
Automatic Changelog Update (#1281)
SimpleStation14 Nov 30, 2024
de98c2a
Dynamic Hostname System (#1296)
sleepyyapril Nov 30, 2024
e46a863
Religious Headgear For Character Customization (#1297)
VMSolidus Nov 30, 2024
56be690
Automatic Changelog Update (#1297)
SimpleStation14 Nov 30, 2024
f287188
Don't Require Running in Release to Test Mood (#1257)
DEATHB4DEFEAT Nov 30, 2024
dfb12e5
Start of Lore Documents
VMSolidus Nov 30, 2024
2a8bf58
Finally Done
VMSolidus Dec 1, 2024
9ef8252
Update Credits (#1300)
github-actions[bot] Dec 1, 2024
386fd77
Merge branch 'master' into Lore-Documentation
sleepyyapril Dec 1, 2024
a535d98
Loadouts Lore Documentation (#1298)
sleepyyapril Dec 1, 2024
8a368bb
Automatic Changelog Update (#1298)
SimpleStation14 Dec 1, 2024
932f9e3
Fashion Update: Earrings & Makeup (#1299)
angelofallars Dec 1, 2024
b05ab8e
Automatic Changelog Update (#1299)
SimpleStation14 Dec 1, 2024
1bab6b8
♂️ Add Male Arachne (#1301)
angelofallars Dec 1, 2024
5476ee0
Automatic Changelog Update (#1301)
SimpleStation14 Dec 1, 2024
4bf7624
Add Localization for Senior Physician and Senior Engineer (#1302)
zelezniciar1 Dec 1, 2024
9169818
Automatic Changelog Update (#1302)
SimpleStation14 Dec 1, 2024
8573914
Make Cultist Constructs Speak Eldritch (#1303)
angelofallars Dec 2, 2024
114ecde
Automatic Changelog Update (#1303)
SimpleStation14 Dec 2, 2024
1895f3a
Fix Lobotomy (#1306)
angelofallars Dec 3, 2024
71c6412
Automatic Changelog Update (#1306)
SimpleStation14 Dec 3, 2024
82b2b28
You Can Now Drag People Into Deep Friers (#1279)
Erisfiregamer1 Dec 3, 2024
cbc76ef
Automatic Changelog Update (#1279)
SimpleStation14 Dec 3, 2024
7c0c16e
Emp Flashlight (#5) (#1189)
VMSolidus Dec 4, 2024
7beea89
Automatic Changelog Update (#1189)
SimpleStation14 Dec 4, 2024
831a7b3
Add Europa Map to Rotation (#1152)
Ichaie Dec 4, 2024
b1c3703
Automatic Changelog Update (#1152)
SimpleStation14 Dec 4, 2024
c223259
Update medicine.yml (#1210)
Suraru Dec 4, 2024
e2ee77d
Atmospheric Alerts Computer Upgrades (#1313)
zelezniciar1 Dec 5, 2024
6c9270d
Automatic Changelog Update (#1313)
SimpleStation14 Dec 5, 2024
978173e
More Bug Fixes (#1311)
sleepyyapril Dec 5, 2024
1b15668
Automatic Changelog Update (#1311)
SimpleStation14 Dec 5, 2024
32e17a6
ChemMaster Sorting (#1310)
sleepyyapril Dec 5, 2024
01a13e3
Automatic Changelog Update (#1310)
SimpleStation14 Dec 5, 2024
d69b516
Port Shipyards (#1314)
VMSolidus Dec 6, 2024
36cd6ca
Automatic Changelog Update (#1314)
SimpleStation14 Dec 6, 2024
1016a08
Port UserActivateInWorldEvent and BypassInteractionChecksComponent (#…
sleepyyapril Dec 6, 2024
54d15c0
Inverts the Check for Material Whitelist in CanChangeMaterialAmount (…
rbertoche Dec 6, 2024
f1b8f96
Build Your Own TEG! (#1316)
zelezniciar1 Dec 6, 2024
3d2cdd7
Automatic Changelog Update (#1316)
SimpleStation14 Dec 6, 2024
50eb217
Several Small Map Fixes to Europa (#1319)
rbertoche Dec 6, 2024
f4152a5
Automatic Changelog Update (#1319)
SimpleStation14 Dec 6, 2024
06a8cee
Fix Rules (#1321)
VMSolidus Dec 6, 2024
9989c4d
Automatic Changelog Update (#1321)
SimpleStation14 Dec 6, 2024
ec650c4
Uplink: Remove Deception Category (#1309)
sleepyyapril Dec 7, 2024
5d64873
Automatic Changelog Update (#1309)
SimpleStation14 Dec 7, 2024
0c60671
[Feat] Bring Back Die Glorious Death, Hijack And Ian's Meat Traitor O…
Remuchi Dec 7, 2024
3ae4370
Automatic Changelog Update (#1323)
SimpleStation14 Dec 7, 2024
c40af73
The Throwing Update (#1307)
angelofallars Dec 8, 2024
33f80d6
Automatic Changelog Update (#1307)
SimpleStation14 Dec 8, 2024
1044cae
Merge branch 'einstein-engines' into feat/blood-cult-dlc-1
rbertoche Dec 9, 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
  •  
  •  
  •  
26 changes: 13 additions & 13 deletions Content.Client/Access/UI/AccessOverriderWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public AccessOverriderWindow(AccessOverriderBoundUserInterface owner, IPrototype
{
if (!prototypeManager.TryIndex(access, out var accessLevel))
{
logMill.Error($"Unable to find accesslevel for {access}");
logMill.Error($"Unable to find access level for {access}");
continue;
}

Expand Down Expand Up @@ -66,11 +66,11 @@ public void UpdateState(AccessOverriderBoundUserInterfaceState state)

if (state.MissingPrivilegesList != null && state.MissingPrivilegesList.Any())
{
List<string> missingPrivileges = new List<string>();
var missingPrivileges = new List<string>();

foreach (string tag in state.MissingPrivilegesList)
{
string privilege = Loc.GetString(_prototypeManager.Index<AccessLevelPrototype>(tag)?.Name ?? "generic-unknown");
var privilege = Loc.GetString(_prototypeManager.Index<AccessLevelPrototype>(tag)?.Name ?? "generic-unknown");
missingPrivileges.Add(privilege);
}

Expand All @@ -83,20 +83,20 @@ public void UpdateState(AccessOverriderBoundUserInterfaceState state)
foreach (var (accessName, button) in _accessButtons)
{
button.Disabled = !interfaceEnabled;
if (interfaceEnabled)
{
button.Pressed = state.TargetAccessReaderIdAccessList?.Contains(accessName) ?? false;
button.Disabled = (!state.AllowedModifyAccessList?.Contains(accessName)) ?? true;
}
if (!interfaceEnabled)
return;

button.Pressed = state.TargetAccessReaderIdAccessList?.Contains<ProtoId<AccessLevelPrototype>>(accessName) ?? false;
button.Disabled = (!state.AllowedModifyAccessList?.Contains<ProtoId<AccessLevelPrototype>>(accessName)) ?? true;
}
}

private void SubmitData()
{
private void SubmitData() =>
_owner.SubmitData(

// Iterate over the buttons dictionary, filter by `Pressed`, only get key from the key/value pair
_accessButtons.Where(x => x.Value.Pressed).Select(x => new ProtoId<AccessLevelPrototype>(x.Key)).ToList());
}
_accessButtons.Where(x => x.Value.Pressed)
.Select(x => new ProtoId<AccessLevelPrototype>(x.Key))
.ToList()
);
}
}
21 changes: 14 additions & 7 deletions Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ public BwoinkWindow()

Bwoink.ChannelSelector.OnSelectionChanged += sel =>
{
if (sel is not null)
if (sel is null)
{
Title = $"{sel.CharacterName} / {sel.Username}";
Title = Loc.GetString("bwoink-none-selected");
return;
}

Title = $"{sel.CharacterName} / {sel.Username}";

if (sel.OverallPlaytime != null)
{
Title += $" | {Loc.GetString("generic-playtime-title")}: {sel.PlaytimeString}";
}
if (sel.OverallPlaytime != null)
{
Title += $" | {Loc.GetString("generic-playtime-title")}: {sel.PlaytimeString}";
}
};

OnOpen += () => Bwoink.PopulateList();
OnOpen += () =>
{
Bwoink.ChannelSelector.StopFiltering();
Bwoink.PopulateList();
};
}
}
}
230 changes: 119 additions & 111 deletions Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,147 +4,155 @@
using Content.Client.Verbs.UI;
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Input;
using Robust.Shared.Utility;

namespace Content.Client.Administration.UI.CustomControls
namespace Content.Client.Administration.UI.CustomControls;

[GenerateTypedNameReferences]
public sealed partial class PlayerListControl : BoxContainer
{
[GenerateTypedNameReferences]
public sealed partial class PlayerListControl : BoxContainer
{
private readonly AdminSystem _adminSystem;
private readonly AdminSystem _adminSystem;

private List<PlayerInfo> _playerList = new();
private readonly List<PlayerInfo> _sortedPlayerList = new();
private readonly IEntityManager _entManager;
private readonly IUserInterfaceManager _uiManager;

private PlayerInfo? _selectedPlayer;

public event Action<PlayerInfo>? OnSelectionChanged;
public IReadOnlyList<PlayerInfo> PlayerInfo => _playerList;
private List<PlayerInfo> _playerList = new();
private readonly List<PlayerInfo> _sortedPlayerList = new();

public Func<PlayerInfo, string, string>? OverrideText;
public Comparison<PlayerInfo>? Comparison;
public Comparison<PlayerInfo>? Comparison;
public Func<PlayerInfo, string, string>? OverrideText;

private IEntityManager _entManager;
private IUserInterfaceManager _uiManager;
public PlayerListControl()
{
_entManager = IoCManager.Resolve<IEntityManager>();
_uiManager = IoCManager.Resolve<IUserInterfaceManager>();
_adminSystem = _entManager.System<AdminSystem>();
RobustXamlLoader.Load(this);
// Fill the Option data
PlayerListContainer.ItemPressed += PlayerListItemPressed;
PlayerListContainer.ItemKeyBindDown += PlayerListItemKeyBindDown;
PlayerListContainer.GenerateItem += GenerateButton;
PlayerListContainer.NoItemSelected += PlayerListNoItemSelected;
PopulateList(_adminSystem.PlayerList);
FilterLineEdit.OnTextChanged += _ => FilterList();
_adminSystem.PlayerListChanged += PopulateList;
BackgroundPanel.PanelOverride = new StyleBoxFlat { BackgroundColor = new Color(32, 32, 40) };
}

private PlayerInfo? _selectedPlayer;
public IReadOnlyList<PlayerInfo> PlayerInfo => _playerList;

public PlayerListControl()
{
_entManager = IoCManager.Resolve<IEntityManager>();
_uiManager = IoCManager.Resolve<IUserInterfaceManager>();
_adminSystem = _entManager.System<AdminSystem>();
RobustXamlLoader.Load(this);
// Fill the Option data
PlayerListContainer.ItemPressed += PlayerListItemPressed;
PlayerListContainer.ItemKeyBindDown += PlayerListItemKeyBindDown;
PlayerListContainer.GenerateItem += GenerateButton;
PopulateList(_adminSystem.PlayerList);
FilterLineEdit.OnTextChanged += _ => FilterList();
_adminSystem.PlayerListChanged += PopulateList;
BackgroundPanel.PanelOverride = new StyleBoxFlat {BackgroundColor = new Color(32, 32, 40)};
}
public event Action<PlayerInfo?>? OnSelectionChanged;

private void PlayerListItemPressed(BaseButton.ButtonEventArgs? args, ListData? data)
{
if (args == null || data is not PlayerListData {Info: var selectedPlayer})
return;
private void PlayerListNoItemSelected()
{
_selectedPlayer = null;
OnSelectionChanged?.Invoke(null);
}

if (selectedPlayer == _selectedPlayer)
return;
private void PlayerListItemPressed(BaseButton.ButtonEventArgs? args, ListData? data)
{
if (args == null || data is not PlayerListData { Info: var selectedPlayer })
return;

if (args.Event.Function != EngineKeyFunctions.UIClick)
return;
if (selectedPlayer == _selectedPlayer)
return;

OnSelectionChanged?.Invoke(selectedPlayer);
_selectedPlayer = selectedPlayer;
if (args.Event.Function != EngineKeyFunctions.UIClick)
return;

// update label text. Only required if there is some override (e.g. unread bwoink count).
if (OverrideText != null && args.Button.Children.FirstOrDefault()?.Children?.FirstOrDefault() is Label label)
label.Text = GetText(selectedPlayer);
}
OnSelectionChanged?.Invoke(selectedPlayer);
_selectedPlayer = selectedPlayer;

private void PlayerListItemKeyBindDown(GUIBoundKeyEventArgs? args, ListData? data)
{
if (args == null || data is not PlayerListData { Info: var selectedPlayer })
return;
// update label text. Only required if there is some override (e.g. unread bwoink count).
if (OverrideText != null && args.Button.Children.FirstOrDefault()?.Children?.FirstOrDefault() is Label label)
label.Text = GetText(selectedPlayer);
}

if (args.Function != EngineKeyFunctions.UIRightClick || selectedPlayer.NetEntity == null)
return;
private void PlayerListItemKeyBindDown(GUIBoundKeyEventArgs? args, ListData? data)
{
if (args == null || data is not PlayerListData { Info: var selectedPlayer })
return;

_uiManager.GetUIController<VerbMenuUIController>().OpenVerbMenu(selectedPlayer.NetEntity.Value, true);
args.Handle();
}
if (args.Function != EngineKeyFunctions.UIRightClick || selectedPlayer.NetEntity == null)
return;

public void StopFiltering()
{
FilterLineEdit.Text = string.Empty;
}
_uiManager.GetUIController<VerbMenuUIController>().OpenVerbMenu(selectedPlayer.NetEntity.Value, true);
args.Handle();
}

private void FilterList()
public void StopFiltering()
{
FilterLineEdit.Text = string.Empty;
}

private void FilterList()
{
_sortedPlayerList.Clear();
foreach (var info in _playerList)
{
_sortedPlayerList.Clear();
foreach (var info in _playerList)
{
var displayName = $"{info.CharacterName} ({info.Username})";
if (info.IdentityName != info.CharacterName)
displayName += $" [{info.IdentityName}]";
if (!string.IsNullOrEmpty(FilterLineEdit.Text)
&& !displayName.ToLowerInvariant().Contains(FilterLineEdit.Text.Trim().ToLowerInvariant()))
continue;
_sortedPlayerList.Add(info);
}

if (Comparison != null)
_sortedPlayerList.Sort((a, b) => Comparison(a, b));

PlayerListContainer.PopulateList(_sortedPlayerList.Select(info => new PlayerListData(info)).ToList());
if (_selectedPlayer != null)
PlayerListContainer.Select(new PlayerListData(_selectedPlayer));
var displayName = $"{info.CharacterName} ({info.Username})";
if (info.IdentityName != info.CharacterName)
displayName += $" [{info.IdentityName}]";
if (!string.IsNullOrEmpty(FilterLineEdit.Text)
&& !displayName.ToLowerInvariant().Contains(FilterLineEdit.Text.Trim().ToLowerInvariant()))
continue;
_sortedPlayerList.Add(info);
}

public void PopulateList(IReadOnlyList<PlayerInfo>? players = null)
{
players ??= _adminSystem.PlayerList;
if (Comparison != null)
_sortedPlayerList.Sort((a, b) => Comparison(a, b));

_playerList = players.ToList();
if (_selectedPlayer != null && !_playerList.Contains(_selectedPlayer))
_selectedPlayer = null;
// Ensure pinned players are always at the top
_sortedPlayerList.Sort((a, b) => a.IsPinned != b.IsPinned && a.IsPinned ? -1 : 1);

FilterList();
}
PlayerListContainer.PopulateList(_sortedPlayerList.Select(info => new PlayerListData(info)).ToList());
if (_selectedPlayer != null)
PlayerListContainer.Select(new PlayerListData(_selectedPlayer));
}

private string GetText(PlayerInfo info)
{
var text = $"{info.CharacterName} ({info.Username})";
if (OverrideText != null)
text = OverrideText.Invoke(info, text);
return text;
}
public void PopulateList(IReadOnlyList<PlayerInfo>? players = null)
{
players ??= _adminSystem.PlayerList;

private void GenerateButton(ListData data, ListContainerButton button)
{
if (data is not PlayerListData { Info: var info })
return;

button.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
new Label
{
ClipText = true,
Text = GetText(info)
}
}
});

button.AddStyleClass(ListContainer.StyleClassListContainerButton);
}
_playerList = players.ToList();
if (_selectedPlayer != null && !_playerList.Contains(_selectedPlayer))
_selectedPlayer = null;

FilterList();
}

public record PlayerListData(PlayerInfo Info) : ListData;

private string GetText(PlayerInfo info)
{
var text = $"{info.CharacterName} ({info.Username})";
if (OverrideText != null)
text = OverrideText.Invoke(info, text);
return text;
}

private void GenerateButton(ListData data, ListContainerButton button)
{
if (data is not PlayerListData { Info: var info })
return;

var entry = new PlayerListEntry();
entry.Setup(info, OverrideText);
entry.OnPinStatusChanged += _ =>
{
FilterList();
};

button.AddChild(entry);
button.AddStyleClass(ListContainer.StyleClassListContainerButton);
}
}

public record PlayerListData(PlayerInfo Info) : ListData;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Horizontal" HorizontalExpand="true">
<Label Name="PlayerEntryLabel" Text="" ClipText="True" HorizontalExpand="True" />
<TextureButton Name="PlayerEntryPinButton"
HorizontalAlignment="Right" />
</BoxContainer>
Loading
Loading