(Cleanup) Fix logger obsolete warnings (#40553)
* Switched obsolete logger usages to use Sawmill Fix the majority of obsolete logger usages outside the engine code. * Fix injection in ChatManager and revert BuildMech changes * Removed extra manual injection * Reduced extra static injection and reverted changes to CommandButton as it needs engine changes. * Removed two more cases of double injection and an extra using * Reverted changes for Inventory Display * Moved sawmill setup outside constructor in Table to resolve test failure
This commit is contained in:
@@ -7,7 +7,6 @@ using Robust.Client.UserInterface;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Reflection;
|
||||
using Robust.Shared.Sandboxing;
|
||||
using Robust.Shared.Utility;
|
||||
using static Pidgin.Parser;
|
||||
|
||||
@@ -21,7 +20,7 @@ public sealed partial class DocumentParsingManager
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflectionManager = default!;
|
||||
[Dependency] private readonly IResourceManager _resourceManager = default!;
|
||||
[Dependency] private readonly ISandboxHelper _sandboxHelper = default!;
|
||||
[Dependency] private readonly IDynamicTypeFactory _dynamicTypeFactory = default!;
|
||||
|
||||
private readonly Dictionary<string, Parser<char, Control>> _tagControlParsers = new();
|
||||
private Parser<char, Control> _controlParser = default!;
|
||||
@@ -43,7 +42,7 @@ public sealed partial class DocumentParsingManager
|
||||
|
||||
foreach (var typ in _reflectionManager.GetAllChildren<IDocumentTag>())
|
||||
{
|
||||
_tagControlParsers.Add(typ.Name, CreateTagControlParser(typ.Name, typ, _sandboxHelper));
|
||||
_tagControlParsers.Add(typ.Name, CreateTagControlParser(typ.Name, typ, _dynamicTypeFactory));
|
||||
}
|
||||
|
||||
ControlParser = whitespaceAndCommentParser.Then(_controlParser.Many());
|
||||
@@ -87,14 +86,14 @@ public sealed partial class DocumentParsingManager
|
||||
return true;
|
||||
}
|
||||
|
||||
private Parser<char, Control> CreateTagControlParser(string tagId, Type tagType, ISandboxHelper sandbox)
|
||||
private Parser<char, Control> CreateTagControlParser(string tagId, Type tagType, IDynamicTypeFactory typeFactory)
|
||||
{
|
||||
return Map(
|
||||
(args, controls) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var tag = (IDocumentTag) sandbox.CreateInstance(tagType);
|
||||
var tag = (IDocumentTag) typeFactory.CreateInstance(tagType);
|
||||
if (!tag.TryParseTag(args, out var control))
|
||||
{
|
||||
_sawmill.Error($"Failed to parse {tagId} args");
|
||||
|
||||
Reference in New Issue
Block a user