Revert "Revert "Replace ResourcePath with ResPath (#15308)" (#155… (#15566)

This commit is contained in:
metalgearsloth
2023-04-20 20:16:01 +10:00
committed by GitHub
parent 0c38a6db8d
commit ae01618874
125 changed files with 279 additions and 276 deletions

View File

@@ -8,27 +8,27 @@ namespace Content.Client.Resources
[PublicAPI]
public static class ResourceCacheExtensions
{
public static Texture GetTexture(this IResourceCache cache, ResourcePath path)
public static Texture GetTexture(this IResourceCache cache, ResPath path)
{
return cache.GetResource<TextureResource>(path);
}
public static Texture GetTexture(this IResourceCache cache, string path)
{
return GetTexture(cache, new ResourcePath(path));
return GetTexture(cache, new ResPath(path));
}
public static Font GetFont(this IResourceCache cache, ResourcePath path, int size)
public static Font GetFont(this IResourceCache cache, ResPath path, int size)
{
return new VectorFont(cache.GetResource<FontResource>(path), size);
}
public static Font GetFont(this IResourceCache cache, string path, int size)
{
return cache.GetFont(new ResourcePath(path), size);
return cache.GetFont(new ResPath(path), size);
}
public static Font GetFont(this IResourceCache cache, ResourcePath[] path, int size)
public static Font GetFont(this IResourceCache cache, ResPath[] path, int size)
{
var fs = new Font[path.Length];
for (var i = 0; i < path.Length; i++)
@@ -39,9 +39,9 @@ namespace Content.Client.Resources
public static Font GetFont(this IResourceCache cache, string[] path, int size)
{
var rp = new ResourcePath[path.Length];
var rp = new ResPath[path.Length];
for (var i = 0; i < path.Length; i++)
rp[i] = new ResourcePath(path[i]);
rp[i] = new ResPath(path[i]);
return cache.GetFont(rp, size);
}