2022-10-12 01:16:23 -07:00
|
|
|
|
using Content.Client.Resources;
|
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
|
using Robust.Client.ResourceManagement;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.UserInterface.XamlExtensions;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[PublicAPI]
|
|
|
|
|
|
public sealed class TexExtension
|
|
|
|
|
|
{
|
2023-10-29 15:29:30 +11:00
|
|
|
|
private IResourceCache _resourceCache;
|
2022-10-12 01:16:23 -07:00
|
|
|
|
public string Path { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public TexExtension(string path)
|
|
|
|
|
|
{
|
2023-10-29 15:29:30 +11:00
|
|
|
|
_resourceCache = IoCManager.Resolve<IResourceCache>();
|
2022-10-12 01:16:23 -07:00
|
|
|
|
Path = path;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public object ProvideValue()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _resourceCache.GetTexture(Path);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|