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

Wizmerge for Station AI #1351

Merged
merged 384 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
384 commits
Select commit Hold shift + click to select a range
1e57b68
Add croissant recipe (#30825)
themias Aug 17, 2024
65f2633
Add butter slices (#30789)
themias Aug 8, 2024
058f8d5
yeag
sleepyyapril Dec 16, 2024
41450eb
Add Donk Co. microwave board to Combat Bakery Kit (#31239)
themias Sep 2, 2024
d978ef3
Donk co. microwave + microwave tweaks (#28951)
Vermidia Jun 15, 2024
8487f1c
try fix errors
sleepyyapril Dec 16, 2024
b0837ed
Add data field for id card microwave behaviour (#28087)
DrSmugleaf May 17, 2024
442ab28
Uplink: Combat Bakery Kit (#31179)
themias Aug 19, 2024
098529d
yeag
sleepyyapril Dec 16, 2024
1538bb0
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
sleepyyapril Dec 16, 2024
6d1fd45
Cook-able cutlets for kebabs/tacos (#31048)
themias Aug 15, 2024
ab36db6
The Shelfs Update (#27858)
SphiraI Jul 21, 2024
93e0f26
Shiny Diamonds (#25750)
TheShuEd Jul 13, 2024
bf4a937
Pipebombs and IED rework (#25705)
Dutch-VanDerLinde Mar 14, 2024
fedbf2f
Add diamond mining drills, buff regular mining drills (#30814)
Blackern5000 Aug 12, 2024
3845b3d
Meow
sleepyyapril Dec 16, 2024
34d463b
hm!
sleepyyapril Dec 16, 2024
e1de660
bwah
sleepyyapril Dec 16, 2024
3589ab9
Adding a holy watermelon helmet (#32272)
ravage123321 Sep 22, 2024
09e6aa8
remove duplicate mining drill
sleepyyapril Dec 16, 2024
b8bac27
Add haloperidol, potassium iodide (#27454)
slarticodefast Aug 2, 2024
4de3556
maaaow
sleepyyapril Dec 16, 2024
e877ccd
yeag!
sleepyyapril Dec 16, 2024
fa96dd4
fix PotencyDivisors capitalization
sleepyyapril Dec 16, 2024
c362b9c
Chem master UI (#33328)
Intoxicating-Innocence Dec 16, 2024
4e8bca4
Fix test threading (#31669)
metalgearsloth Aug 31, 2024
f9f8a79
Fix random test fail in DeleteAllThenGhost (#32753)
Errant-4 Oct 11, 2024
2905bae
integration test fails
sleepyyapril Dec 16, 2024
430a8c6
build fail...
sleepyyapril Dec 16, 2024
ed68f2d
Add a test for sliceable cargo bounty exploits (#28357)
Tayrtahn Jun 3, 2024
e01d6ba
more fixes
sleepyyapril Dec 16, 2024
76cdddb
use IsBlacklistPass
sleepyyapril Dec 16, 2024
06d8918
Sliceable
sleepyyapril Dec 16, 2024
d2ed345
Fix slices
sleepyyapril Dec 16, 2024
bd3206d
Fix tests?
metalgearsloth Feb 14, 2024
b4f7093
hm
sleepyyapril Dec 16, 2024
4a6e365
Yeag!
sleepyyapril Dec 16, 2024
72ddf80
construction is weird
sleepyyapril Dec 16, 2024
b96307e
Fix AtmosDeviceSystem debug assert Heisenbug (#29752)
Tayrtahn Jul 11, 2024
bbb1b85
Fix SpawnAndDeleteAllEntitiesInTheSameSpot heisentest (#32330)
slarticodefast Oct 12, 2024
7e44cf9
Don't error on missing component in ChangeHeat (#32451)
slarticodefast Oct 12, 2024
94ac824
Update TemperatureSystem.cs
sleepyyapril Dec 16, 2024
55d9581
test stuff
sleepyyapril Dec 17, 2024
2fa78d3
i could be The Stupid
sleepyyapril Dec 17, 2024
2615eab
Fix gun...
sleepyyapril Dec 17, 2024
af118ce
Prevent executions if the bullet chambered is rubber.
sleepyyapril Dec 17, 2024
2b5ac70
fix executions
sleepyyapril Dec 17, 2024
310c0d0
cleanup so I can read this
sleepyyapril Dec 17, 2024
de62b3a
fix(SharedGunSystem): Return and debug log on CreateEffect. (#29656)
CaasGit Jul 13, 2024
26bc502
Rework the HoS's Energy Shotgun (Varying energy consumption depending…
BramvanZijp Dec 11, 2024
0ce6bd3
New head of security weapon:Energy Shotgun (#30643)
Boaz1111 Aug 19, 2024
59bd7c1
remove energy shotgun objective
sleepyyapril Dec 17, 2024
b985bc9
remove whitelist fail message
sleepyyapril Dec 17, 2024
9133bf9
updates
sleepyyapril Dec 17, 2024
76df82d
Resolve `'TransformComponent.MapPosition' is obsolete` in content (#2…
mirrorcult May 12, 2024
c79a710
fix lint errors, remove secret documents
sleepyyapril Dec 17, 2024
c4c003d
fix error!
sleepyyapril Dec 17, 2024
5b660d4
lmao
sleepyyapril Dec 17, 2024
ebc00fa
remove some obsolete code
sleepyyapril Dec 17, 2024
d70261a
project zero... errors?
sleepyyapril Dec 17, 2024
936dd05
Add ItemToggleComponent to translator
sleepyyapril Dec 19, 2024
881e5c4
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
sleepyyapril Dec 19, 2024
97fc912
Fix ghost roles
sleepyyapril Dec 19, 2024
a371d3e
Remove debug
sleepyyapril Dec 19, 2024
da58e8d
retest
sleepyyapril Dec 19, 2024
b7d3d71
the tests are only running online so ill just push this here
sleepyyapril Dec 19, 2024
c833622
Revert "the tests are only running online so ill just push this here"
sleepyyapril Dec 19, 2024
aacd5c9
Replace obsolete EntityWhitelist IsValid usages part 2 (#28506)
Plykiya Jun 3, 2024
ba90348
Remove every usage of EntityWhitelist.IsValid
sleepyyapril Dec 19, 2024
1890369
Fix Whitelist not existing.
sleepyyapril Dec 19, 2024
bbd11f9
does naming matter?
sleepyyapril Dec 19, 2024
27bdd7f
Add EntityWhitelistSystem to IoC
sleepyyapril Dec 19, 2024
6a369c8
Add TagSystem to SharedContentIoC (dependency of EntityWhitelistSystem)
sleepyyapril Dec 19, 2024
51899df
genuinely absurd that this is a bug. who wrote this? why did you writ…
sleepyyapril Dec 19, 2024
a3ee923
Rework the Flare Gun & add a Security Shell Gun. (#32829)
BramvanZijp Nov 6, 2024
c79c886
HOTFIX: Fix Security Shell Gun being uncraftable. (#33247)
BramvanZijp Nov 11, 2024
f2499f9
Remove obsolete
sleepyyapril Dec 19, 2024
802cb4d
Fix guns appearing to cycle bolt when wielded (#28756)
Doomsdrayk Jun 13, 2024
51b0ad5
tweak(GunRequiresWield): State the requirement for gun wielding in th…
Brandon-Huu Jul 24, 2024
dda66b6
Flare gun fix
sleepyyapril Dec 19, 2024
846f51a
Bugfix: Wielding now uses identity system. (#33134)
Plykiya Nov 3, 2024
737d1bb
silly.
sleepyyapril Dec 19, 2024
4110c63
Prevent round failing to start due to missing content.
sleepyyapril Dec 20, 2024
ed37a67
No tag for v238, lmao.
sleepyyapril Dec 21, 2024
ea0359e
Implement some field-level deltas (#28242)
SlamBamActionman Jun 30, 2024
b912917
Use EntityEffect
sleepyyapril Dec 21, 2024
67ed4c3
Implement field-deltas for melee
metalgearsloth Dec 21, 2024
bf23534
Humans can no longer honk on command (#28566)
Vermidia Jun 3, 2024
d49e8f6
SyndieBorgs can laugh again.
sleepyyapril Dec 21, 2024
490ab08
fix conflict?
sleepyyapril Dec 21, 2024
f32080b
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
sleepyyapril Dec 21, 2024
4d2e51e
v238.0.0
sleepyyapril Dec 21, 2024
50426cc
Fix admin notes and database time nonsense. (#25280)
PJB3005 Feb 20, 2024
8478f83
Add test to check that there are no pending database model changes (#…
DrSmugleaf Mar 2, 2024
9b2067b
Fix preference loading bugs (#27742)
PJB3005 May 7, 2024
f776bee
Kick on ban for entire server group (#28649)
juliangiebel Aug 20, 2024
ac9d75c
Implement BlacklistedRange exempt flag (#29258)
nikthechampiongr Jun 21, 2024
6b009d4
Fix Admin Object tab sorting and search (#28609)
Titian3 Jun 6, 2024
a6bdab4
Fix Admin Object tab sorting and search - Part 2 (#28681)
Titian3 Jun 28, 2024
7ea5800
Fix baby jail (#29896)
Chief-Engineer Jul 11, 2024
c8fca5a
Implement a playerpanel (#30238)
nikthechampiongr Aug 9, 2024
1d068e3
Integrate Modern HWID into content
PJB3005 Nov 12, 2024
463c90a
Fix sandbox error with new HWID code. (#33461)
PJB3005 Nov 22, 2024
4f5fb40
Re-add IAdminRemarksCommon to DB model for SS14.Admin (#27028)
PJB3005 Apr 16, 2024
76ba115
add 👷 JobCondition system for reagents (#29023)
icekot8 Jun 15, 2024
a91f66a
Fixes client having authority over rules popup cvars (#28655)
AJCM-git Jun 7, 2024
061fb26
this class is awful
sleepyyapril Dec 21, 2024
948728f
Fix role ban loading bugs (#32725)
PJB3005 Oct 14, 2024
fff3cb0
Toolshed refactor (#33598)
ElectroJr Dec 21, 2024
2d8ddc6
Switch to use proper method
sleepyyapril Dec 21, 2024
a17c28a
Round event frequency simulation command (#27718)
mirrorcult May 6, 2024
e061b5e
Prevent admin-frozen players from ghosting or suiciding, add "Freeze …
pissdemon May 12, 2024
8038c5f
Fix all errors
sleepyyapril Dec 21, 2024
ebd00f5
tags
sleepyyapril Dec 21, 2024
cfb1fdf
Cleans up tag system (#28272)
Tornado-Technology Jun 2, 2024
78bfce2
Fix air alarms (#29172)
osjarw Jun 19, 2024
9bb4c93
Fix melee and DB errors
sleepyyapril Dec 21, 2024
c1b272a
Revert "Implement field-deltas for melee"
sleepyyapril Dec 21, 2024
db0cd2c
Revert "Implement some field-level deltas (#28242)"
sleepyyapril Dec 21, 2024
b4520d0
Reapply "Implement some field-level deltas (#28242)"
sleepyyapril Dec 21, 2024
6b463d6
Reapply "Implement field-deltas for melee"
sleepyyapril Dec 21, 2024
309a549
Wrong imports
sleepyyapril Dec 21, 2024
9e1bee4
v237.4.0
sleepyyapril Dec 22, 2024
032c4eb
test
sleepyyapril Dec 22, 2024
ace7412
Avoid using EntityUid as a networked dictionary's key until hotfix.
sleepyyapril Dec 22, 2024
119322b
Does fix?
sleepyyapril Dec 22, 2024
fea3cd2
This does fix
sleepyyapril Dec 22, 2024
c306a3f
No, this does fix.
sleepyyapril Dec 22, 2024
dc1883e
Use probability, not prob
sleepyyapril Dec 22, 2024
d1bd845
Merge branch 'master' into wizmerge
sleepyyapril Dec 22, 2024
fc94a19
Add debug logs to baby jail and fix playtime logic (#30158)
Chief-Engineer Jul 20, 2024
4bcdee9
Automated whitelists (#23985)
Simyon264 Aug 27, 2024
bf75328
Add time index to connection log (#29281)
PJB3005 Jun 21, 2024
c198ef2
Merge branch 'wizmerge' of https://github.com/sleepyyapril/Einstein-E…
sleepyyapril Dec 22, 2024
c769e77
Fix missing semicolon after migration. (#26337)
PJB3005 Mar 22, 2024
6352f51
Ban template system (#29365)
PJB3005 Jun 23, 2024
ecc7c6b
ConnectionManager stuff
sleepyyapril Dec 22, 2024
d791123
Alert shared connections (#29405)
Chief-Engineer Jun 26, 2024
f959344
Use hours
sleepyyapril Dec 22, 2024
0a9ebf0
Migrationmaxxing?
sleepyyapril Dec 22, 2024
cb7df67
migration changes
sleepyyapril Dec 22, 2024
0fac658
Only drop if it exists, stupid.
sleepyyapril Dec 22, 2024
d24876d
Wait, silly.
sleepyyapril Dec 22, 2024
0fbd8da
scuffed
sleepyyapril Dec 23, 2024
13b9ad9
sillyyy
sleepyyapril Dec 23, 2024
c2704bc
Fix some rounds failing to end due to mind roles (#32792)
PJB3005 Oct 13, 2024
b5ab695
Make tests automatically reset modified cvars (#28219)
ElectroJr May 31, 2024
9b6527b
Add random seed options to tests (#30735)
ElectroJr Aug 9, 2024
5f6701b
Test parallelization stuff. (#31650)
PJB3005 Sep 1, 2024
df49cff
Check
sleepyyapril Dec 23, 2024
4b1e01e
v238.0...1?
sleepyyapril Dec 23, 2024
2e038d9
Merge branch 'master' into wizmerge
sleepyyapril Dec 23, 2024
b3f5797
hm
sleepyyapril Dec 23, 2024
6a5865a
Merge branch 'wizmerge' of https://github.com/sleepyyapril/Einstein-E…
sleepyyapril Dec 23, 2024
2337463
Fix ERT becoming sleeper agents and add sleeper agent preferences (#2…
Dutch-VanDerLinde Jun 20, 2024
7ce56b2
fix lint?
sleepyyapril Dec 24, 2024
0181930
oops
sleepyyapril Dec 24, 2024
82c3f2e
Revert "Avoid using EntityUid as a networked dictionary's key until h…
sleepyyapril Dec 25, 2024
f2cbb27
Yeeeeeeeeeeeah.
sleepyyapril Dec 25, 2024
899c791
Fixed IP bans preventing non-banned players from connecting to SQLite…
TGRCdev Aug 18, 2024
197b065
Add CCVar
sleepyyapril Dec 25, 2024
670feb4
I fixed it!
sleepyyapril Dec 25, 2024
06bf52a
Partial port
sleepyyapril Dec 25, 2024
77f4c99
im so silly!
sleepyyapril Dec 25, 2024
acc59cb
woah
sleepyyapril Dec 25, 2024
b42ad79
No error
sleepyyapril Dec 25, 2024
5049739
pda messaging real (#2362)
MilonPL Nov 6, 2024
ec8f9f5
make cargo balance ui updating its own component (#28295)
deltanedas Jul 13, 2024
67e917d
stocks trading (#2103)
MilonPL Dec 10, 2024
0c70547
yeag
sleepyyapril Dec 25, 2024
3383b84
feat: now when research is unlocked in console, approver of reasearch…
Fildrance Sep 3, 2024
3876fce
Job title localization (#32338)
chavonadelal Oct 9, 2024
1931832
Automatic ACO procedure (#2351)
ewokswagger Dec 9, 2024
fee041e
fix auto aco timing (#2431)
ewokswagger Dec 12, 2024
57675a0
pass Actor to cartridge messages (#33210)
deltanedas Nov 8, 2024
b4f332a
Play deny sound if failed
sleepyyapril Dec 26, 2024
2cf5c10
Solar assembly crate buff (#33019)
K-Dynamic Nov 16, 2024
7179184
Fix utensils not being thrown away (#33326)
SaphireLattice Nov 16, 2024
e398c9c
Add StartDelay to actions (#33026)
lzk228 Oct 28, 2024
754275e
OnUIOpenAttempt!
sleepyyapril Dec 26, 2024
470d7ce
fix all rider errors
sleepyyapril Dec 26, 2024
a54aa83
small
sleepyyapril Dec 26, 2024
3a45387
fix locale
sleepyyapril Dec 26, 2024
ad52051
oops
sleepyyapril Dec 26, 2024
16a58d7
yeag
sleepyyapril Dec 26, 2024
4579c05
Revert "yeag"
sleepyyapril Dec 26, 2024
2a54f4f
fix?
sleepyyapril Dec 26, 2024
702cf74
waow
sleepyyapril Dec 26, 2024
4adc9b2
silly
sleepyyapril Dec 26, 2024
69510ab
Waow
sleepyyapril Dec 26, 2024
166dc62
oops
sleepyyapril Dec 26, 2024
6ec6789
siiigh
sleepyyapril Dec 26, 2024
b3a5d1c
yeag
sleepyyapril Dec 26, 2024
f684930
yeag
sleepyyapril Dec 26, 2024
91ca7e3
Update message for failing to spawn.
sleepyyapril Dec 26, 2024
8ae7651
Merge branch 'master' into wizmerge
sleepyyapril Dec 26, 2024
50bb5b7
remove bad cartridges
sleepyyapril Dec 26, 2024
a3df482
Merge branch 'wizmerge' of https://github.com/sleepyyapril/Einstein-E…
sleepyyapril Dec 26, 2024
6629ec7
salvage points shop (#2510)
deltanedas Dec 27, 2024
edf5038
MedTek Cartridge (#32450)
ArchRBX Oct 2, 2024
03e3092
AstroNav GPS Cartridge (#32194)
ArchRBX Sep 24, 2024
711367e
Added admin assistant
Radezolid Dec 25, 2024
54583f5
add mining points (#2419)
deltanedas Dec 13, 2024
3db9e75
Add space debris to salvage magnet (#31113)
EmoGarbage404 Aug 17, 2024
210d2f2
as an fyi, last commit is named wrong.
sleepyyapril Dec 28, 2024
007fa57
fix error
sleepyyapril Dec 28, 2024
f3cfe1f
i dunno
sleepyyapril Dec 28, 2024
0e9ed51
admin assistant
sleepyyapril Dec 28, 2024
3fe34da
fix test fails
sleepyyapril Dec 28, 2024
8322ccf
Use tag to avoid accidentally updates now that it's added.
sleepyyapril Dec 28, 2024
ad59231
Add codeword highlighting (#30092)
SlamBamActionman Aug 23, 2024
9753d46
Rubber should be rubber.
sleepyyapril Dec 28, 2024
395582e
Station Anchor (#26098)
juliangiebel Aug 31, 2024
c169f5a
Two additional checks to prevent FTLing stations (#32558)
Plykiya Oct 4, 2024
92b64de
Allow shuttles on planets to make FTL jump (#33507)
MilenVolf Nov 24, 2024
7044f01
Station Anchor (#26098)
lzk228 Sep 4, 2024
122508e
Last commit is: Add disabled station anchors version (#31794)
sleepyyapril Dec 28, 2024
69f6992
Adds Station Anchor Beacon (#33711)
IamVelcroboy Dec 6, 2024
51258ee
fix yml lint
sleepyyapril Dec 28, 2024
7818749
Inertia dampeners (#1620)
neuPanda Aug 7, 2024
c6bee33
fix build fails
sleepyyapril Dec 28, 2024
3363ddd
Merge branch 'master' into wizmerge
sleepyyapril Dec 29, 2024
60aa348
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
sleepyyapril Dec 30, 2024
2c55f0a
Merge branch 'wizmerge' of https://github.com/sleepyyapril/Einstein-E…
sleepyyapril Dec 30, 2024
56e4037
Rename several cyber-eyes traits
sleepyyapril Dec 30, 2024
e18d2aa
Fix communication console menu (#33655)
VlaDOS1408 Dec 20, 2024
cd08bb2
fix some bugs:tm:
sleepyyapril Dec 30, 2024
b099c37
Fix communications console.
sleepyyapril Dec 30, 2024
471c3c2
Change CyberEyes name back to original
sleepyyapril Dec 30, 2024
60382e2
NanoChat fixes
sleepyyapril Dec 30, 2024
2d2bfec
Add all ComponentStart features to OnMapInit function
sleepyyapril Dec 30, 2024
179c441
Disable setting to blue with sleeper agents.
sleepyyapril Dec 30, 2024
d8f6082
Fix aHelp menu sorting (#30518)
Titian3 Jul 31, 2024
0115861
Little note
sleepyyapril Dec 30, 2024
78be436
Fix Bwoink Player sorting again.... (#30580)
Titian3 Aug 2, 2024
c2bb333
Psych can scan, added NanoChat to medical.
sleepyyapril Dec 31, 2024
6716d6a
Editing contacts, enter to send messages.
sleepyyapril Dec 31, 2024
b710fda
Enable mail teleporters by default
sleepyyapril Dec 31, 2024
55f8a67
Revert "Enable mail teleporters by default"
sleepyyapril Dec 31, 2024
ffa033e
Reapply "Enable mail teleporters by default"
sleepyyapril Dec 31, 2024
7be5d94
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
sleepyyapril Dec 31, 2024
29b59e5
Fix errors
sleepyyapril Dec 31, 2024
2b57a26
Linter fixes
sleepyyapril Dec 31, 2024
0665242
BlackeyeSpawn doesn't exist, remove trait.
sleepyyapril Jan 1, 2025
103e552
Remove Blackeye
sleepyyapril Jan 1, 2025
ecd416a
Merge branch 'master' into wizmerge
sleepyyapril Jan 1, 2025
b2ac5fd
Notifications are more reliable.
sleepyyapril Jan 2, 2025
f52f88d
Merge branch 'wizmerge' of https://github.com/sleepyyapril/Einstein-E…
sleepyyapril Jan 2, 2025
48b435a
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
sleepyyapril Jan 2, 2025
c626df2
Fix error
sleepyyapril Jan 2, 2025
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
  •  
  •  
  •  
45 changes: 25 additions & 20 deletions Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.Containers.ItemSlots;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;
using static Content.Shared.Access.Components.AccessOverriderComponent;

Expand All @@ -23,45 +24,49 @@ protected override void Open()
{
base.Open();

_window = this.CreateWindow<AccessOverriderWindow>();
RefreshAccess();
_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
_window.OnSubmit += SubmitData;

_window.PrivilegedIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(PrivilegedIdCardSlotId));
}

public override void OnProtoReload(PrototypesReloadedEventArgs args)
{
base.OnProtoReload(args);
if (!args.WasModified<AccessLevelPrototype>())
return;

RefreshAccess();

if (State != null)
_window?.UpdateState(_prototypeManager, (AccessOverriderBoundUserInterfaceState) State);
}

private void RefreshAccess()
{
List<ProtoId<AccessLevelPrototype>> accessLevels;

if (EntMan.TryGetComponent<AccessOverriderComponent>(Owner, out var accessOverrider))
{
accessLevels = accessOverrider.AccessLevels;
accessLevels.Sort();
}

else
{
accessLevels = new List<ProtoId<AccessLevelPrototype>>();
_accessOverriderSystem.Log.Error($"No AccessOverrider component found for {EntMan.ToPrettyString(Owner)}!");
}

_window = new AccessOverriderWindow(this, _prototypeManager, accessLevels)
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName
};

_window.PrivilegedIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(PrivilegedIdCardSlotId));

_window.OnClose += Close;
_window.OpenCentered();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

_window?.Dispose();
_window?.SetAccessLevels(_prototypeManager, accessLevels);
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
var castState = (AccessOverriderBoundUserInterfaceState) state;
_window?.UpdateState(castState);
_window?.UpdateState(_prototypeManager, castState);
}

public void SubmitData(List<ProtoId<AccessLevelPrototype>> newAccessList)
Expand Down
39 changes: 17 additions & 22 deletions Content.Client/Access/UI/AccessOverriderWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,24 @@ namespace Content.Client.Access.UI
[GenerateTypedNameReferences]
public sealed partial class AccessOverriderWindow : DefaultWindow
{
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

private readonly AccessOverriderBoundUserInterface _owner;
private readonly Dictionary<string, Button> _accessButtons = new();

public AccessOverriderWindow(AccessOverriderBoundUserInterface owner, IPrototypeManager prototypeManager,
List<ProtoId<AccessLevelPrototype>> accessLevels)
public event Action<List<ProtoId<AccessLevelPrototype>>>? OnSubmit;

public AccessOverriderWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
var logMill = _logManager.GetSawmill(SharedAccessOverriderSystem.Sawmill);
}

_owner = owner;
public void SetAccessLevels(IPrototypeManager protoManager, List<ProtoId<AccessLevelPrototype>> accessLevels)
{
_accessButtons.Clear();
AccessLevelGrid.DisposeAllChildren();

foreach (var access in accessLevels)
{
if (!prototypeManager.TryIndex(access, out var accessLevel))
if (!protoManager.TryIndex(access, out var accessLevel))
{
logMill.Error($"Unable to find access level for {access}");
continue;
}

Expand All @@ -44,11 +42,16 @@ public AccessOverriderWindow(AccessOverriderBoundUserInterface owner, IPrototype

AccessLevelGrid.AddChild(newButton);
_accessButtons.Add(accessLevel.ID, newButton);
newButton.OnPressed += _ => SubmitData();
newButton.OnPressed += _ =>
{
OnSubmit?.Invoke(
// 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());
};
}
}

public void UpdateState(AccessOverriderBoundUserInterfaceState state)
public void UpdateState(IPrototypeManager protoManager, AccessOverriderBoundUserInterfaceState state)
{
PrivilegedIdLabel.Text = state.PrivilegedIdName;
PrivilegedIdButton.Text = state.IsPrivilegedIdPresent
Expand All @@ -70,7 +73,7 @@ public void UpdateState(AccessOverriderBoundUserInterfaceState state)

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

Expand All @@ -90,13 +93,5 @@ public void UpdateState(AccessOverriderBoundUserInterfaceState state)
button.Disabled = (!state.AllowedModifyAccessList?.Contains<ProtoId<AccessLevelPrototype>>(accessName)) ?? true;
}
}

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()
);
}
}
34 changes: 16 additions & 18 deletions Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using Content.Shared.Access.Systems;
using Content.Shared.StatusIcon;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;
using Robust.Shared.Prototypes;

namespace Content.Client.Access.UI
{
Expand All @@ -18,16 +22,18 @@ protected override void Open()
{
base.Open();

_window?.Dispose();
_window = new AgentIDCardWindow(this);
if (State != null)
UpdateState(State);
_window = this.CreateWindow<AgentIDCardWindow>();

_window.OpenCentered();

_window.OnClose += Close;
_window.OnNameChanged += OnNameChanged;
_window.OnJobChanged += OnJobChanged;
_window.OnJobIconChanged += OnJobIconChanged;
_window.OnNumberChanged += OnNumberChanged; // DeltaV
}

// DeltaV - Add number change handler
private void OnNumberChanged(uint newNumber)
{
SendMessage(new AgentIDCardNumberChangedMessage(newNumber));
}

private void OnNameChanged(string newName)
Expand All @@ -40,7 +46,7 @@ private void OnJobChanged(string newJob)
SendMessage(new AgentIDCardJobChangedMessage(newJob));
}

public void OnJobIconChanged(string newJobIconId)
public void OnJobIconChanged(ProtoId<JobIconPrototype> newJobIconId)
{
SendMessage(new AgentIDCardJobIconChangedMessage(newJobIconId));
}
Expand All @@ -57,16 +63,8 @@ protected override void UpdateState(BoundUserInterfaceState state)

_window.SetCurrentName(cast.CurrentName);
_window.SetCurrentJob(cast.CurrentJob);
_window.SetAllowedIcons(cast.Icons, cast.CurrentJobIconId);
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

_window?.Dispose();
_window.SetAllowedIcons(cast.CurrentJobIconId);
_window.SetCurrentNumber(cast.CurrentNumber); // DeltaV
}
}
}
15 changes: 8 additions & 7 deletions Content.Client/Access/UI/AgentIDCardWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
<LineEdit Name="NameLineEdit" />
<Label Name="CurrentJob" Text="{Loc 'agent-id-card-current-job'}" />
<LineEdit Name="JobLineEdit" />
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'agent-id-card-job-icon-label'}"/>
<Control HorizontalExpand="True" MinSize="50 0"/>
<GridContainer Name="IconGrid" Columns="10">
<!-- Job icon buttons are generated in the code -->
</GridContainer>
</BoxContainer>
<!-- DeltaV - Add NanoChat number field -->
<Label Name="CurrentNumber" Text="{Loc 'agent-id-card-current-number'}" />
<LineEdit Name="NumberLineEdit" PlaceHolder="#0000" />
<!-- DeltaV end -->
<Label Text="{Loc 'agent-id-card-job-icon-label'}"/>
<GridContainer Name="IconGrid" Columns="10">
<!-- Job icon buttons are generated in the code -->
</GridContainer>
</BoxContainer>
</DefaultWindow>
67 changes: 49 additions & 18 deletions Content.Client/Access/UI/AgentIDCardWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using System.Numerics;
using System.Linq;

namespace Content.Client.Access.UI
{
Expand All @@ -17,40 +18,72 @@ public sealed partial class AgentIDCardWindow : DefaultWindow
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
private readonly SpriteSystem _spriteSystem;
private readonly AgentIDCardBoundUserInterface _bui;

private const int JobIconColumnCount = 10;

private const int MaxNumberLength = 4; // DeltaV - Same as NewChatPopup

public event Action<string>? OnNameChanged;
public event Action<string>? OnJobChanged;

public AgentIDCardWindow(AgentIDCardBoundUserInterface bui)
public event Action<uint>? OnNumberChanged; // DeltaV - Add event for number changes

public event Action<ProtoId<JobIconPrototype>>? OnJobIconChanged;

public AgentIDCardWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_spriteSystem = _entitySystem.GetEntitySystem<SpriteSystem>();
_bui = bui;

NameLineEdit.OnTextEntered += e => OnNameChanged?.Invoke(e.Text);
NameLineEdit.OnFocusExit += e => OnNameChanged?.Invoke(e.Text);

JobLineEdit.OnTextEntered += e => OnJobChanged?.Invoke(e.Text);
JobLineEdit.OnFocusExit += e => OnJobChanged?.Invoke(e.Text);

// DeltaV - Add handlers for number changes
NumberLineEdit.OnTextEntered += OnNumberEntered;
NumberLineEdit.OnFocusExit += OnNumberEntered;

// DeltaV - Filter to only allow digits
NumberLineEdit.OnTextChanged += args =>
{
if (args.Text.Length > MaxNumberLength)
{
NumberLineEdit.Text = args.Text[..MaxNumberLength];
}

// Filter to digits only
var newText = string.Concat(args.Text.Where(char.IsDigit));
if (newText != args.Text)
NumberLineEdit.Text = newText;
};
}

public void SetAllowedIcons(HashSet<string> icons, string currentJobIconId)
// DeltaV - Add number validation and event
private void OnNumberEntered(LineEdit.LineEditEventArgs args)
{
if (uint.TryParse(args.Text, out var number) && number > 0)
OnNumberChanged?.Invoke(number);
}

// DeltaV - Add setter for current number
public void SetCurrentNumber(uint? number)
{
NumberLineEdit.Text = number?.ToString("D4") ?? "";
}

public void SetAllowedIcons(string currentJobIconId)
{
IconGrid.DisposeAllChildren();

var jobIconGroup = new ButtonGroup();
var jobIconButtonGroup = new ButtonGroup();
var i = 0;
foreach (var jobIconId in icons)
var icons = _prototypeManager.EnumeratePrototypes<JobIconPrototype>().Where(icon => icon.AllowSelection).ToList();
icons.Sort((x, y) => string.Compare(x.LocalizedJobName, y.LocalizedJobName, StringComparison.CurrentCulture));
foreach (var jobIcon in icons)
{
if (!_prototypeManager.TryIndex<StatusIconPrototype>(jobIconId, out var jobIcon))
{
continue;
}

String styleBase = StyleBase.ButtonOpenBoth;
var modulo = i % JobIconColumnCount;
if (modulo == 0)
Expand All @@ -64,25 +97,23 @@ public void SetAllowedIcons(HashSet<string> icons, string currentJobIconId)
Access = AccessLevel.Public,
StyleClasses = { styleBase },
MaxSize = new Vector2(42, 28),
Group = jobIconGroup,
Pressed = i == 0,
Group = jobIconButtonGroup,
Pressed = currentJobIconId == jobIcon.ID,
ToolTip = jobIcon.LocalizedJobName
};

// Generate buttons textures
TextureRect jobIconTexture = new TextureRect
var jobIconTexture = new TextureRect
{
Texture = _spriteSystem.Frame0(jobIcon.Icon),
TextureScale = new Vector2(2.5f, 2.5f),
Stretch = TextureRect.StretchMode.KeepCentered,
};

jobIconButton.AddChild(jobIconTexture);
jobIconButton.OnPressed += _ => _bui.OnJobIconChanged(jobIcon.ID);
jobIconButton.OnPressed += _ => OnJobIconChanged?.Invoke(jobIcon.ID);
IconGrid.AddChild(jobIconButton);

if (jobIconId.Equals(currentJobIconId))
jobIconButton.Pressed = true;

i++;
}
}
Expand Down
Loading
Loading