From 88575e228627cd01c83bfb63350d714c4975ab71 Mon Sep 17 00:00:00 2001 From: Deserty0 Date: Sun, 5 Oct 2025 16:48:09 +1000 Subject: [PATCH] I am become Death, the Code Destroyer --- .../_CP14/Fishing/CP14FishingSystem.cs | 204 ++---------------- .../UI/CP14FishingBoundUserInterface.cs | 59 +++++ .../_CP14/Fishing/UI/CP14FishingWindow.xaml | 11 + .../Fishing/UI/CP14FishingWindow.xaml.cs | 70 ++++++ .../_CP14/Fishing/CP14FishingSerializable.cs | 21 ++ .../_CP14/Fishing/CP14SharedFishingSystem.cs | 106 ++++----- .../Fishing/Components/CP14FishComponent.cs | 4 +- .../Components/CP14FishingRodComponent.cs | 2 +- .../Entities/Objects/Tools/fishing_rod.yml | 4 + 9 files changed, 226 insertions(+), 255 deletions(-) create mode 100644 Content.Client/_CP14/Fishing/UI/CP14FishingBoundUserInterface.cs create mode 100644 Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml create mode 100644 Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml.cs create mode 100644 Content.Shared/_CP14/Fishing/CP14FishingSerializable.cs diff --git a/Content.Client/_CP14/Fishing/CP14FishingSystem.cs b/Content.Client/_CP14/Fishing/CP14FishingSystem.cs index 729d43264c..baa90fb8d9 100644 --- a/Content.Client/_CP14/Fishing/CP14FishingSystem.cs +++ b/Content.Client/_CP14/Fishing/CP14FishingSystem.cs @@ -1,42 +1,29 @@ -using System.Numerics; using Content.Client.Hands.Systems; -using Content.Client.Resources; -using Content.Client.UserInterface.Screens; using Content.Shared._CP14.Fishing; using Content.Shared._CP14.Fishing.Components; using Content.Shared._CP14.Input; -using Content.Shared.CombatMode; -using Content.Shared.Interaction; using Robust.Client.GameObjects; -using Robust.Client.Graphics; using Robust.Client.Player; -using Robust.Client.ResourceManagement; -using Robust.Client.UserInterface; -using Robust.Client.UserInterface.Controls; using Robust.Shared.Input; -using Robust.Shared.Prototypes; using Robust.Shared.Timing; namespace Content.Client._CP14.Fishing; public sealed class CP14FishingSystem : CP14SharedFishingSystem { - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; - [Dependency] private readonly IResourceCache _resourceCache = default!; [Dependency] private readonly InputSystem _input = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly HandsSystem _hands = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - - private Popup? _fishingPopup; + [Dependency] private readonly UserInterfaceSystem _userInterface = default!; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnFishingStatusChanged); + SubscribeLocalEvent(OnFishingRodState); } + public override void Update(float dt) { base.Update(dt); @@ -53,7 +40,14 @@ public sealed class CP14FishingSystem : CP14SharedFishingSystem return; UpdatePressedButtons(fishingRodComponent, player); - UpdateUserInterface(fishingRodComponent); + } + + private void OnFishingRodState(Entity entity, ref AfterAutoHandleStateEvent args) + { + if (_userInterface.TryGetOpenUi(entity.Owner, CP14FishingUiKey.Key, out var bui)) + { + bui.Update(); + } } private void UpdatePressedButtons(CP14FishingRodComponent fishingRodComponent, EntityUid player) @@ -67,180 +61,6 @@ public sealed class CP14FishingSystem : CP14SharedFishingSystem return; fishingRodComponent.Reeling = reelKey; - RaiseNetworkEvent(new FishingReelKeyMessage(reelKey)); - } - - private void UpdateUserInterface(CP14FishingRodComponent fishingRodComponent) - { - if (_fishingPopup is null) - return; - - if (_fishingPopup.Visible == false) - return; - - var fish = fishingRodComponent.CaughtFish; - - if (fish is null) - return; - - TryComp(fish, out CP14FishComponent? fishComponent); - - if (fishComponent is null) - return; - - if (!_prototypeManager.Resolve(fishingRodComponent.FishingMinigame, out var minigameStyle)) - return; - - var floatUI = minigameStyle.Float; - var progressbar = minigameStyle.Progressbar; - var fishIcon = minigameStyle.FishIcon; - - var firstLayer = _fishingPopup!.GetChild(0); - var secondLayer = _fishingPopup!.GetChild(1); - - var progressbarContainer = firstLayer.GetChild(0); - var floatContainer = firstLayer.GetChild(1); - var fishContainer = secondLayer.GetChild(0); - - floatContainer.Margin = new Thickness(floatUI.Offset.X, 0, floatUI.Offset.Y + fishingRodComponent.FloatPosition, 0); - fishContainer.Margin = new Thickness(fishIcon.Offset.X, 0, fishIcon.Offset.Y + fishComponent.FishPosAndDestination.X, 0); - } - - private void OnFishingStatusChanged(FishingUIStatus status) - { - if (status.UIStatus) - { - OpenFishingPopup(status.Component); - } - else - { - CloseFishingPopup(); - } - } - - private void OpenFishingPopup(CP14FishingRodComponent component) - { - // Getting data - if (!_prototypeManager.Resolve(component.FishingMinigame, out var minigameStyle)) - return; - - var background = minigameStyle.Background; - var floatUI = minigameStyle.Float; - var progressbar = minigameStyle.Progressbar; - var fishIcon = minigameStyle.FishIcon; - - // Generating popup - _fishingPopup = new Popup - { - CloseOnClick = false, - CloseOnEscape = false, - MinSize = new Vector2(background.Size.X, background.Size.Y), - MaxSize = new Vector2(background.Size.X, background.Size.Y), - }; - - var screenCenter = new Vector2(); - switch (_userInterfaceManager.ActiveScreen) - { - case DefaultGameScreen gameScreen: - gameScreen.AddChild(_fishingPopup); - screenCenter = gameScreen.Size / 2; - break; - - case SeparatedChatGameScreen gameScreen: - gameScreen.AddChild(_fishingPopup); - screenCenter = gameScreen.Size / 2; - break; - } - - // Generating layers - var backgroundTexture = _resourceCache.GetTexture(background.Texture); - var firstLayer = new PanelContainer - { - PanelOverride = new StyleBoxTexture - { - Texture = backgroundTexture, - }, - MinSize = new Vector2(background.Size.X, background.Size.Y), - MaxSize = new Vector2(background.Size.X, background.Size.Y), - }; - _fishingPopup.AddChild(firstLayer); - - var secondLayer = new PanelContainer - { - MinSize = new Vector2(background.Size.X, background.Size.Y), - MaxSize = new Vector2(background.Size.X, background.Size.Y), - }; - _fishingPopup.AddChild(secondLayer); - - // Filling first layer - var progressbarTexture = _resourceCache.GetTexture(progressbar.Texture); - var progressbarContainer = new PanelContainer - { - PanelOverride = new StyleBoxTexture - { - Texture = progressbarTexture, - }, - MinSize = new Vector2(progressbar.Size.X, 0), - SetSize = new Vector2(progressbar.Size.X, 0), - MaxSize = new Vector2(progressbar.Size.X, progressbar.Size.Y), - Margin = new Thickness(progressbar.Offset.X, 0, 0, progressbar.Offset.Y), - HorizontalAlignment = Control.HAlignment.Left, - VerticalAlignment = Control.VAlignment.Bottom, - }; - firstLayer.AddChild(progressbarContainer); - - var floatTexture = _resourceCache.GetTexture(floatUI.Texture); - var floatContainer = new PanelContainer - { - PanelOverride = new StyleBoxTexture - { - Texture = floatTexture, - }, - MinSize = new Vector2(floatUI.Size.X, floatUI.Size.Y), - MaxSize = new Vector2(floatUI.Size.X, floatUI.Size.Y), - Margin = new Thickness(floatUI.Offset.X, 0, 0, floatUI.Offset.Y), - HorizontalAlignment = Control.HAlignment.Left, - VerticalAlignment = Control.VAlignment.Bottom, - }; - firstLayer.AddChild(floatContainer); - - // Filling second layer - var fishTexture = _resourceCache.GetTexture(fishIcon.Texture); - var fishIconContainer = new PanelContainer - { - PanelOverride = new StyleBoxTexture - { - Texture = fishTexture, - }, - MinSize = new Vector2(fishIcon.Size.X, fishIcon.Size.Y), - MaxSize = new Vector2(fishIcon.Size.X, fishIcon.Size.Y), - Margin = new Thickness(fishIcon.Offset.X, 0, 0, fishIcon.Offset.Y), - HorizontalAlignment = Control.HAlignment.Left, - VerticalAlignment = Control.VAlignment.Bottom, - }; - secondLayer.AddChild(fishIconContainer); - - _fishingPopup.Open(UIBox2.FromDimensions(new Vector2(screenCenter.X - background.Size.X, - screenCenter.Y - background.Size.Y), - background.Size)); - } - - private void CloseFishingPopup() - { - if (_fishingPopup is null) - return; - - switch (_userInterfaceManager.ActiveScreen) - { - case DefaultGameScreen gameScreen: - gameScreen.RemoveChild(_fishingPopup); - break; - - case SeparatedChatGameScreen gameScreen: - gameScreen.RemoveChild(_fishingPopup); - break; - } - - _fishingPopup = null; + RaiseNetworkEvent(new CP14FishingReelKeyMessage(reelKey)); } } diff --git a/Content.Client/_CP14/Fishing/UI/CP14FishingBoundUserInterface.cs b/Content.Client/_CP14/Fishing/UI/CP14FishingBoundUserInterface.cs new file mode 100644 index 0000000000..ddb9773065 --- /dev/null +++ b/Content.Client/_CP14/Fishing/UI/CP14FishingBoundUserInterface.cs @@ -0,0 +1,59 @@ +using Content.Shared._CP14.Fishing.Components; +using JetBrains.Annotations; +using Robust.Client.UserInterface; + +namespace Content.Client._CP14.Fishing.UI; + +[UsedImplicitly] +public sealed class CP14FishingBoundUserInterface : BoundUserInterface +{ + [ViewVariables] + private CP14FishingWindow? _fishingWindow; + + public CP14FishingBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + + if (!EntMan.TryGetComponent(Owner, out var rodComponent)) + return; + + _fishingWindow = this.CreateWindow(); + _fishingWindow.InitVisuals(rodComponent); + } + + public override void Update() + { + base.Update(); + + if (_fishingWindow is null || !EntMan.TryGetComponent(Owner, out var rodComponent)) + return; + + var fish = rodComponent.CaughtFish; + + if (fish is null) + return; + + if (!EntMan.TryGetComponent(fish, out var fishComponent)) + return; + + var backgroundContainer = _fishingWindow.GetChild(0); + + var progressbar = backgroundContainer.GetChild(0); + var floatContainer = backgroundContainer.GetChild(1); + var fishContainer = backgroundContainer.GetChild(2); + + floatContainer.Margin = new Thickness(floatContainer.Margin.Left, + 0, + floatContainer.Margin.Right + rodComponent.FloatPosition, + 0); + + fishContainer.Margin = new Thickness(fishContainer.Margin.Left, + 0, + fishContainer.Margin.Right + fishComponent.FishPosAndDestination.X, + 0); + } +} diff --git a/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml b/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml new file mode 100644 index 0000000000..bbfacdc27b --- /dev/null +++ b/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml.cs b/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml.cs new file mode 100644 index 0000000000..d304bd418c --- /dev/null +++ b/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml.cs @@ -0,0 +1,70 @@ +using Content.Client.Resources; +using Content.Shared._CP14.Fishing.Components; +using Robust.Client.AutoGenerated; +using Robust.Client.Graphics; +using Robust.Client.ResourceManagement; +using Robust.Client.UserInterface.CustomControls; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Prototypes; + +namespace Content.Client._CP14.Fishing.UI; + +[GenerateTypedNameReferences] +public sealed partial class CP14FishingWindow : BaseWindow +{ + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + public CP14FishingWindow() + { + IoCManager.InjectDependencies(this); + RobustXamlLoader.Load(this); + } + + public void InitVisuals(CP14FishingRodComponent component) + { + // Getting data + if (!_prototypeManager.Resolve(component.FishingMinigame, out var minigameStyle)) + return; + + var background = minigameStyle.Background; + var floatUI = minigameStyle.Float; + var progressbar = minigameStyle.Progressbar; + var fishIcon = minigameStyle.FishIcon; + + FishingWindow.SetSize = background.Size; + + Progressbar.MaxSize = progressbar.Size; + Progressbar.Margin = new Thickness(progressbar.Offset.X, 0, 0, progressbar.Offset.Y); + + Float.SetSize = floatUI.Size; + Float.Margin = new Thickness(floatUI.Offset.X, 0, 0, floatUI.Offset.Y); + + FishIcon.SetSize = fishIcon.Size; + FishIcon.Margin = new Thickness(fishIcon.Offset.X, 0, 0, fishIcon.Offset.Y); + + var backgroundTexture = _resourceCache.GetTexture(background.Texture); + FishingBackground.PanelOverride = new StyleBoxTexture + { + Texture = backgroundTexture, + }; + + var progressbarTexture = _resourceCache.GetTexture(progressbar.Texture); + Progressbar.PanelOverride = new StyleBoxTexture + { + Texture = progressbarTexture, + }; + + var floatTexture = _resourceCache.GetTexture(floatUI.Texture); + Float.PanelOverride = new StyleBoxTexture + { + Texture = floatTexture, + }; + + var fishTexture = _resourceCache.GetTexture(fishIcon.Texture); + FishIcon.PanelOverride = new StyleBoxTexture + { + Texture = fishTexture, + }; + } +} + diff --git a/Content.Shared/_CP14/Fishing/CP14FishingSerializable.cs b/Content.Shared/_CP14/Fishing/CP14FishingSerializable.cs new file mode 100644 index 0000000000..4c3a75e43e --- /dev/null +++ b/Content.Shared/_CP14/Fishing/CP14FishingSerializable.cs @@ -0,0 +1,21 @@ +using Robust.Shared.Serialization; + +namespace Content.Shared._CP14.Fishing +{ + [Serializable, NetSerializable] + public enum CP14FishingUiKey : byte + { + Key, + } + + [Serializable, NetSerializable] + public sealed class CP14FishingReelKeyMessage : EntityEventArgs + { + public bool Reeling { get; } + + public CP14FishingReelKeyMessage(bool reeling) + { + Reeling = reeling; + } + } +} diff --git a/Content.Shared/_CP14/Fishing/CP14SharedFishingSystem.cs b/Content.Shared/_CP14/Fishing/CP14SharedFishingSystem.cs index 780819b31d..7403780348 100644 --- a/Content.Shared/_CP14/Fishing/CP14SharedFishingSystem.cs +++ b/Content.Shared/_CP14/Fishing/CP14SharedFishingSystem.cs @@ -6,6 +6,8 @@ using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; using Content.Shared.Throwing; +using Robust.Client.GameObjects; +using Robust.Client.UserInterface; using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Network; @@ -26,6 +28,7 @@ public abstract class CP14SharedFishingSystem : EntitySystem [Dependency] private readonly SharedHandsSystem _hands = default!; [Dependency] private readonly ThrowingSystem _throwing = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private readonly UserInterfaceSystem _userInterface = default!; [Dependency] private readonly SharedInteractionSystem _interaction = default!; [Dependency] private readonly ISharedPlayerManager _playerManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; @@ -41,7 +44,7 @@ public abstract class CP14SharedFishingSystem : EntitySystem SubscribeLocalEvent(OnInteract); SubscribeLocalEvent(OnDropEvent); - SubscribeNetworkEvent(OnReelingMessage); + SubscribeNetworkEvent(OnReelingMessage); } public override void Update(float frameTime) @@ -65,6 +68,9 @@ public abstract class CP14SharedFishingSystem : EntitySystem private void UpdatePositions(EntityUid fishingRod, CP14FishingRodComponent fishingRodComponent, TimeSpan curTime) { + if (_netManager.IsClient && _gameTiming.IsFirstTimePredicted) + return; + if (fishingRodComponent.CaughtFish is null) return; @@ -158,8 +164,7 @@ public abstract class CP14SharedFishingSystem : EntitySystem { fishingRodComponent.FishHooked = true; - var user = fishingRodComponent.User; - RaiseLocalEvent(user!.Value, new FishingUIStatus(true, fishingRodComponent)); + _userInterface.OpenUi(fishingRod, CP14FishingUiKey.Key); DirtyField(fishingRod, fishingRodComponent, nameof(CP14FishingRodComponent.FishHooked)); return; @@ -178,6 +183,9 @@ public abstract class CP14SharedFishingSystem : EntitySystem if (!_netManager.IsServer) return; + if (fishingRodComponent.CaughtFish is not null) + return; + if (curTime < fishingRodComponent.FishingTime) return; @@ -226,29 +234,33 @@ public abstract class CP14SharedFishingSystem : EntitySystem DirtyField(fish, fishComponent, nameof(CP14FishComponent.FishGetAwayTime)); } - private void RevalidateFishing(EntityUid fishingRod, CP14FishingRodComponent component) + private void RevalidateFishing(EntityUid fishingRod, CP14FishingRodComponent fishingRodComponent) { - if (component.FishingFloat is null) + if (fishingRodComponent.FishingFloat is null) return; - if (_transform.InRange(fishingRod, component.FishingFloat.Value, component.MaxFishingDistance * 1.5f)) + if (_transform.InRange(fishingRod, fishingRodComponent.FishingFloat.Value, fishingRodComponent.MaxFishingDistance * 1.5f)) return; - PredictedDel(component.FishingFloat); + PredictedDel(fishingRodComponent.FishingFloat); - component.FishingFloat = null; - component.Target = null; - component.User = null; + fishingRodComponent.FishHooked = false; + fishingRodComponent.CaughtFish = null; + fishingRodComponent.FishingFloat = null; + fishingRodComponent.Target = null; + fishingRodComponent.User = null; DirtyFields(fishingRod, - component, + fishingRodComponent, null, nameof(CP14FishingRodComponent.FishingFloat), nameof(CP14FishingRodComponent.Target), - nameof(CP14FishingRodComponent.User)); + nameof(CP14FishingRodComponent.User), + nameof(CP14FishingRodComponent.CaughtFish), + nameof(CP14FishingRodComponent.FishHooked)); } - private void OnReelingMessage(FishingReelKeyMessage msg, EntitySessionEventArgs args) + private void OnReelingMessage(CP14FishingReelKeyMessage msg, EntitySessionEventArgs args) { if (args.SenderSession.AttachedEntity is not { } player) return; @@ -261,7 +273,7 @@ public abstract class CP14SharedFishingSystem : EntitySystem DirtyField(activeItem.Value, fishingRodComponent, nameof(CP14FishingRodComponent.Reeling)); } - private void OnInteract(EntityUid uid, CP14FishingRodComponent component, AfterInteractEvent args) + private void OnInteract(EntityUid fishingRod, CP14FishingRodComponent fishingRodComponent, AfterInteractEvent args) { if (args.Handled) return; @@ -269,50 +281,48 @@ public abstract class CP14SharedFishingSystem : EntitySystem if (args.Target is not { Valid: true }) return; - if (component.FishingFloat is not null) + if (fishingRodComponent.FishingFloat is not null) return; if (!TryComp(args.Target, out _)) return; - if (!_interaction.InRangeUnobstructed(uid, args.Target.Value, component.MaxFishingDistance)) + if (!_interaction.InRangeUnobstructed(fishingRod, args.Target.Value, fishingRodComponent.MaxFishingDistance)) return; args.Handled = true; - component.FishingTime = _gameTiming.CurTime; - component.FishingTime += TimeSpan.FromSeconds(_random.NextDouble(component.MinAwaitTime, component.MaxAwaitTime)); - component.User = args.User; + fishingRodComponent.FishingTime = _gameTiming.CurTime; + fishingRodComponent.FishingTime += TimeSpan.FromSeconds(_random.NextDouble(fishingRodComponent.MinAwaitTime, fishingRodComponent.MaxAwaitTime)); + fishingRodComponent.User = args.User; - DirtyFields(uid, component, null, nameof(CP14FishingRodComponent.FishingTime), nameof(CP14FishingRodComponent.User)); + DirtyFields(fishingRod, fishingRodComponent, null, nameof(CP14FishingRodComponent.FishingTime), nameof(CP14FishingRodComponent.User)); - CastFloat(args.Used, component, args.Target.Value); + CastFloat(fishingRod, fishingRodComponent, args.Target.Value); } - private void OnDropEvent(EntityUid entity, CP14FishingRodComponent component, DroppedEvent ev) + private void OnDropEvent(EntityUid fishingRod, CP14FishingRodComponent fishingRodComponent, DroppedEvent ev) { - component.User = null; - DirtyField(entity, component, nameof(CP14FishingRodComponent.User)); + fishingRodComponent.User = null; + DirtyField(fishingRod, fishingRodComponent, nameof(CP14FishingRodComponent.User)); } - private void CastFloat(EntityUid uid, CP14FishingRodComponent component, EntityUid target) + private void CastFloat(EntityUid fishingRod, CP14FishingRodComponent fishingRodComponent, EntityUid fishingPond) { - var rodCoords = Transform(uid).Coordinates; - var targetCoords = Transform(target).Coordinates; + var rodCoords = Transform(fishingRod).Coordinates; + var targetCoords = Transform(fishingPond).Coordinates; - var fishingFloat = PredictedSpawnAtPosition(component.FloatPrototype, rodCoords); + var fishingFloat = PredictedSpawnAtPosition(fishingRodComponent.FloatPrototype, rodCoords); - component.FishingFloat = fishingFloat; - component.Target = target; - component.User = uid; - DirtyFields(uid, - component, + fishingRodComponent.FishingFloat = fishingFloat; + fishingRodComponent.Target = fishingPond; + DirtyFields(fishingRod, + fishingRodComponent, null, nameof(CP14FishingRodComponent.FishingFloat), - nameof(CP14FishingRodComponent.Target), - nameof(CP14FishingRodComponent.User)); + nameof(CP14FishingRodComponent.Target)); - _throwing.TryThrow(fishingFloat, targetCoords, component.ThrowPower, recoil: false, doSpin: false); + _throwing.TryThrow(fishingFloat, targetCoords, fishingRodComponent.ThrowPower, recoil: false, doSpin: false); } private void EnsurePausedMap() @@ -328,28 +338,4 @@ public abstract class CP14SharedFishingSystem : EntitySystem _mapId = newMapId; _map.SetPaused(mapUid, true); } - - [Serializable, NetSerializable] - public sealed class FishingReelKeyMessage : EntityEventArgs - { - public bool Reeling { get; } - - public FishingReelKeyMessage(bool reeling) - { - Reeling = reeling; - } - } - - public sealed class FishingUIStatus : EntityEventArgs - { - public bool UIStatus { get; } - - public CP14FishingRodComponent Component { get; } - - public FishingUIStatus(bool uiStatus, CP14FishingRodComponent component) - { - UIStatus = uiStatus; - Component = component; - } - } } diff --git a/Content.Shared/_CP14/Fishing/Components/CP14FishComponent.cs b/Content.Shared/_CP14/Fishing/Components/CP14FishComponent.cs index 7cdacfbcf9..61009d2476 100644 --- a/Content.Shared/_CP14/Fishing/Components/CP14FishComponent.cs +++ b/Content.Shared/_CP14/Fishing/Components/CP14FishComponent.cs @@ -20,8 +20,8 @@ public sealed partial class CP14FishComponent : Component public Vector2 FishPosAndDestination; [DataField] - public double MinAwaitTime = 1; + public double MinAwaitTime = 5; [DataField] - public double MaxAwaitTime = 4; + public double MaxAwaitTime = 10; } diff --git a/Content.Shared/_CP14/Fishing/Components/CP14FishingRodComponent.cs b/Content.Shared/_CP14/Fishing/Components/CP14FishingRodComponent.cs index f33acd195b..48a6b1d6fc 100644 --- a/Content.Shared/_CP14/Fishing/Components/CP14FishingRodComponent.cs +++ b/Content.Shared/_CP14/Fishing/Components/CP14FishingRodComponent.cs @@ -6,7 +6,7 @@ namespace Content.Shared._CP14.Fishing.Components; /// /// Allows to fish with this item /// -[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true), AutoGenerateComponentPause] +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true, true), AutoGenerateComponentPause] public sealed partial class CP14FishingRodComponent : Component { // Vars diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Tools/fishing_rod.yml b/Resources/Prototypes/_CP14/Entities/Objects/Tools/fishing_rod.yml index 69fe88b233..2a9b356149 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Tools/fishing_rod.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Tools/fishing_rod.yml @@ -44,6 +44,10 @@ slots: - neck - type: CP14FishingRod + - type: UserInterface + interfaces: + enum.CP14FishingUiKey.Key: + type: CP14FishingBoundUserInterface - type: entity parent: BaseItem