Removed all outside connection to and from the Vesna prefabs

This commit is contained in:
jonathan
2026-02-04 19:43:49 +01:00
parent 2cbf7e15a4
commit 89321e917a
5 changed files with 37 additions and 42 deletions
@@ -8,11 +8,11 @@ public partial class FarmingControls2D : Node2D
{
[Export] private VariableResource _sceneKeyProvider;
[Export] private Node2D _movingPlayer;
[Export] private Camera2D _camera;
//[Export] private Camera2D _camera; // can be replaced with GetViewport().GetCamera2D()
[Export] private float _wateringCanParticlesVerticalOffset = 50f;
[Export] private Vector2I _fieldOffsetVector = new Vector2I(735, 651);
[Export] private Node2D _fieldParent;
//[Export] private Node2D _fieldParent; // never used
private int _toolId = -1;
private bool _wateringCanFilled = false;
@@ -51,7 +51,8 @@ public partial class FarmingControls2D : Node2D
private Vector2I GetAdjustedMousePosition()
{
Vector2 mousePosition = _camera.GetGlobalMousePosition();
var camera = GetViewport().GetCamera2D();
Vector2 mousePosition = camera.GetGlobalMousePosition();
Vector2I mousePositionInteger = (Vector2I) mousePosition;
Vector2I adjustedPosition = AdjustValue(mousePositionInteger, _fieldOffsetVector);
return adjustedPosition;
@@ -6,7 +6,7 @@ using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
public partial class VesnaBehaviour2D : Node
public partial class VesnaBehaviour2D : Node2D // EntityNode
{
[ExportGroup("Farming")]
[Export] private FarmingControls2D _farmingControls;
@@ -39,11 +39,11 @@ public partial class VesnaBehaviour2D : Node
/// Called when picking up an item.
/// Makes sure that item animations are also updated when they are occupying a currently empty spot.
/// </summary>
public void HandlePickUp()
{
//Calls the same event handler as the inventory to ensure the currently selected item is updated in the animation.
HandleInventorySelectedSlotIndexChanged(0);
}
//public void HandlePickUp()
//{
// //Calls the same event handler as the inventory to ensure the currently selected item is updated in the animation.
// HandleInventorySelectedSlotIndexChanged(0);
//}
private void HandleInventorySelectedSlotIndexChanged(int newIndex = 0)
{