Files
RobustToolbox/Robust.Shared/ContentPack/ModLoaderExt.cs
Moony 538535db9a Engine default stylesheet + debug connect screen (#4017)
* Debug connection screen

* [ContentAccessAllowed] so I can use IStateManager on engine types.

* Implement a default engine stylesheet.

* awa

* Fix an issue that can cause hangs when resolving a color.

---------

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2023-05-11 06:38:50 -05:00

21 lines
666 B
C#

using System;
using System.Reflection;
namespace Robust.Shared.ContentPack
{
public static class ModLoaderExt
{
public static bool IsContentType(this IModLoader modLoader, Type type)
{
// It should be noted that this method is circumventable IF content could inherit Type.
// it cannot, luckily.
return modLoader.IsContentAssembly(type.Assembly);
}
public static bool IsContentTypeAccessAllowed(this IModLoader modLoader, Type type)
{
return modLoader.IsContentType(type) || type.GetCustomAttribute(typeof(ContentAccessAllowedAttribute)) != null;
}
}
}