Update AccessLevelControl.xaml.cs to use ISawmill (#29987)

* Update AccessLevelControl.xaml.cs to use ISawmill

* Update

* Silly me

* Update
This commit is contained in:
Winkarst
2024-07-14 13:24:26 +03:00
committed by GitHub
parent bdf7293cfb
commit 960cc806cc

View File

@@ -12,11 +12,17 @@ namespace Content.Client.Access.UI;
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public sealed partial class AccessLevelControl : GridContainer public sealed partial class AccessLevelControl : GridContainer
{ {
[Dependency] private readonly ILogManager _logManager = default!;
private ISawmill _sawmill = default!;
public readonly Dictionary<ProtoId<AccessLevelPrototype>, Button> ButtonsList = new(); public readonly Dictionary<ProtoId<AccessLevelPrototype>, Button> ButtonsList = new();
public AccessLevelControl() public AccessLevelControl()
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
_sawmill = _logManager.GetSawmill("accesslevelcontrol");
} }
public void Populate(List<ProtoId<AccessLevelPrototype>> accessLevels, IPrototypeManager prototypeManager) public void Populate(List<ProtoId<AccessLevelPrototype>> accessLevels, IPrototypeManager prototypeManager)
@@ -25,7 +31,7 @@ public sealed partial class AccessLevelControl : GridContainer
{ {
if (!prototypeManager.TryIndex(access, out var accessLevel)) if (!prototypeManager.TryIndex(access, out var accessLevel))
{ {
Logger.Error($"Unable to find accesslevel for {access}"); _sawmill.Error($"Unable to find accesslevel for {access}");
continue; continue;
} }