This commit is contained in:
Tornado Tech
2024-12-15 00:40:43 +10:00
parent c0221b1445
commit 78c711950a
14 changed files with 230 additions and 116 deletions

View File

@@ -22,7 +22,7 @@ public sealed class CP14FishingOverlay : Overlay
private readonly SpriteSystem _sprite;
private readonly TransformSystem _transform;
private readonly CP14FishingProcessSystem _fishingProcess;
private readonly CP14SharedFishingProcessSystem _sharedFishingProcess;
private Texture _backgroundTexture = default!;
private Texture _handleTopTexture = default!;
@@ -48,7 +48,7 @@ public sealed class CP14FishingOverlay : Overlay
_sprite = _entity.System<SpriteSystem>();
_transform = _entity.System<TransformSystem>();
_fishingProcess = _entity.System<CP14FishingProcessSystem>();
_sharedFishingProcess = _entity.System<CP14SharedFishingProcessSystem>();
}
protected override void Draw(in OverlayDrawArgs args)
@@ -56,7 +56,7 @@ public sealed class CP14FishingOverlay : Overlay
if (_player.LocalEntity is not { } localEntity)
return;
if (!_fishingProcess.TryGetByUser(localEntity, out var fishingProcess))
if (!_sharedFishingProcess.TryGetByUser(localEntity, out var fishingProcess))
return;
// Refresh the texture cache, with a new fishing process
@@ -100,7 +100,7 @@ public sealed class CP14FishingOverlay : Overlay
private void DrawProgress(DrawingHandleWorld handle, Vector2 position, Vector2 size, float progress)
{
var vectorA = position;
var vectorB = position + size with { Y = size.Y * progress };
var vectorB = position + new Vector2(size.X, size.Y * progress);
var box = new Box2(vectorA, vectorB);
handle.DrawRect(box, Color.Aqua);

View File

@@ -0,0 +1,5 @@
using Content.Shared._CP14.Fishing.Systems;
namespace Content.Client._CP14.Fishing;
public sealed class CP14FishingProcessSystem : CP14SharedFishingProcessSystem;