From 0dfbd7397879859caf9e98ff193595879456909e Mon Sep 17 00:00:00 2001 From: Katharina Ziolkowski Date: Tue, 3 Feb 2026 17:59:38 +0100 Subject: [PATCH] Reverted ItemOnGround to make everything compile again --- scenes/entity_scenes/farm_outside.tscn | 16 +++++- .../CSharp/Common/Inventory/ItemOnGround2D.cs | 51 ++++++++++--------- 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/scenes/entity_scenes/farm_outside.tscn b/scenes/entity_scenes/farm_outside.tscn index 63103cf..02bd765 100644 --- a/scenes/entity_scenes/farm_outside.tscn +++ b/scenes/entity_scenes/farm_outside.tscn @@ -2545,7 +2545,7 @@ visible = false texture = ExtResource("83_50rxh") [node name="TrashPlacer3" type="Node2D" parent="."] -position = Vector2(10825, 3362) +position = Vector2(9897, 3328) script = ExtResource("82_ec5sc") [node name="icon" type="Sprite2D" parent="TrashPlacer3"] @@ -2554,13 +2554,27 @@ texture = ExtResource("83_50rxh") [connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"] [connection signal="InteractedTool" from="YSorted/Well/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"] +[connection signal="area_entered" from="YSorted/Well/InteractionArea/Area2D" to="YSorted/Well/InteractionArea" method="OnPlayerEntered"] +[connection signal="area_exited" from="YSorted/Well/InteractionArea/Area2D" to="YSorted/Well/InteractionArea" method="OnPlayerExited"] [connection signal="SuccessfulPickUp" from="YSorted/CanGenericPickup" to="YSorted/Vesna" method="HandlePickUp"] +[connection signal="area_entered" from="YSorted/CanGenericPickup/PickupInteractionArea/Area2D" to="YSorted/CanGenericPickup/PickupInteractionArea" method="OnPlayerEntered"] +[connection signal="area_exited" from="YSorted/CanGenericPickup/PickupInteractionArea/Area2D" to="YSorted/CanGenericPickup/PickupInteractionArea" method="OnPlayerExited"] [connection signal="SuccessfulPickUp" from="YSorted/RakeGenericPickup" to="YSorted/Vesna" method="HandlePickUp"] +[connection signal="area_entered" from="YSorted/RakeGenericPickup/PickupInteractionArea/Area2D" to="YSorted/RakeGenericPickup/PickupInteractionArea" method="OnPlayerEntered"] +[connection signal="area_exited" from="YSorted/RakeGenericPickup/PickupInteractionArea/Area2D" to="YSorted/RakeGenericPickup/PickupInteractionArea" method="OnPlayerExited"] [connection signal="SuccessfulPickUp" from="YSorted/SeedPickup" to="YSorted/Vesna" method="HandlePickUp"] +[connection signal="area_entered" from="YSorted/SeedPickup/PickupInteractionArea/Area2D" to="YSorted/SeedPickup/PickupInteractionArea" method="OnPlayerEntered"] +[connection signal="area_exited" from="YSorted/SeedPickup/PickupInteractionArea/Area2D" to="YSorted/SeedPickup/PickupInteractionArea" method="OnPlayerExited"] [connection signal="SuccessfulPickUp" from="YSorted/BeetPickup" to="YSorted/Vesna" method="HandlePickUp"] +[connection signal="area_entered" from="YSorted/BeetPickup/PickupInteractionArea/Area2D" to="YSorted/BeetPickup/PickupInteractionArea" method="OnPlayerEntered"] +[connection signal="area_exited" from="YSorted/BeetPickup/PickupInteractionArea/Area2D" to="YSorted/BeetPickup/PickupInteractionArea" method="OnPlayerExited"] [connection signal="SuccessfulPickUp" from="YSorted/SeedPickup2" to="YSorted/Vesna" method="HandlePickUp"] +[connection signal="area_entered" from="YSorted/SeedPickup2/PickupInteractionArea/Area2D" to="YSorted/SeedPickup2/PickupInteractionArea" method="OnPlayerEntered"] +[connection signal="area_exited" from="YSorted/SeedPickup2/PickupInteractionArea/Area2D" to="YSorted/SeedPickup2/PickupInteractionArea" method="OnPlayerExited"] [connection signal="InteractedTool" from="YSorted/Farm visuals/Static/EnterHouseInteraction" to="." method="LoadSceneAtIndex"] [connection signal="InteractedTool" from="YSorted/Blocker/Fence Door/InteractionArea" to="." method="LoadSceneAtIndex"] +[connection signal="area_entered" from="YSorted/Blocker/Fence Door/InteractionArea/Area2D" to="YSorted/Blocker/Fence Door/InteractionArea" method="OnPlayerEntered"] +[connection signal="area_exited" from="YSorted/Blocker/Fence Door/InteractionArea/Area2D" to="YSorted/Blocker/Fence Door/InteractionArea" method="OnPlayerExited"] [connection signal="GoalReached" from="YSorted/ducks" to="YSorted/ducks/DialogicToggle" method="ToggleDialogue"] [connection signal="DuckCollected" from="YSorted/ducks/Duck2" to="YSorted/ducks" method="Increment"] [connection signal="DuckCollected" from="YSorted/ducks/Duck3" to="YSorted/ducks" method="Increment"] diff --git a/scripts/CSharp/Common/Inventory/ItemOnGround2D.cs b/scripts/CSharp/Common/Inventory/ItemOnGround2D.cs index b49e4e6..c13f4e8 100644 --- a/scripts/CSharp/Common/Inventory/ItemOnGround2D.cs +++ b/scripts/CSharp/Common/Inventory/ItemOnGround2D.cs @@ -1,19 +1,23 @@ using Babushka.scripts.CSharp.Common.Savegame; -using Babushka.scripts.CSharp.GameEntity.Entities; -using Babushka.scripts.CSharp.GameEntity.LoadSave; using Godot; using Godot.Collections; -using Newtonsoft.Json.Linq; namespace Babushka.scripts.CSharp.Common.Inventory; -public partial class ItemOnGround2D : Node2D +public partial class ItemOnGround2D : Node, ISaveable { private ItemInstance _itemInstance; - [Signal] public delegate void SuccessfulPickUpEventHandler(); + [Export] public bool IsActive = true; + [Export] private bool _infiniteSupply = false; + [Export] private int _finiteSupply = 1; + [Export] private bool _saveToDisk = true; + + private int pickUpCounter = 0; + [Signal] public delegate void SuccessfulPickUpEventHandler(); + private Label _itemLabel => GetNode