2022-05-04 17:55:21 +01:00
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Content.Client.Resources;
|
|
|
|
|
using Content.Client.IoC;
|
|
|
|
|
using Robust.Client.Graphics;
|
2023-09-11 19:18:06 +10:00
|
|
|
using Robust.Shared.Graphics;
|
2022-05-04 17:55:21 +01:00
|
|
|
using Robust.Shared.Utility;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.Parallax.Data;
|
|
|
|
|
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
[DataDefinition]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class ImageParallaxTextureSource : IParallaxTextureSource
|
2022-05-04 17:55:21 +01:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Texture path.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("path", required: true)]
|
2023-08-22 18:14:33 -07:00
|
|
|
public ResPath Path { get; private set; } = default!;
|
2022-05-04 17:55:21 +01:00
|
|
|
|
2022-08-14 07:28:34 +02:00
|
|
|
Task<Texture> IParallaxTextureSource.GenerateTexture(CancellationToken cancel)
|
2022-05-04 17:55:21 +01:00
|
|
|
{
|
2022-08-14 07:28:34 +02:00
|
|
|
return Task.FromResult(StaticIoC.ResC.GetTexture(Path));
|
2022-05-04 17:55:21 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|