Removed all outside connection to and from the Vesna prefabs

pull/54/head
jonathan 2 months ago
parent 2cbf7e15a4
commit 89321e917a

@ -1,4 +1,4 @@
[gd_scene load_steps=489 format=3 uid="uid://c25udixd5m6l0"]
[gd_scene load_steps=495 format=3 uid="uid://c25udixd5m6l0"]
[ext_resource type="Script" uid="uid://b05uyj001ehwi" path="res://scripts/CSharp/Common/Farming/VesnaBehaviour2D.cs" id="1_yd5ep"]
[ext_resource type="Script" uid="uid://cjbclkxesh3hc" path="res://scripts/CSharp/Common/CharacterControls/PlayerMovement.cs" id="2_1vqmv"]
@ -286,6 +286,7 @@
[ext_resource type="Script" uid="uid://dj1qjambsa4pg" path="res://scripts/CSharp/Common/Farming/WateringCanSaveHelper.cs" id="472_kduih"]
[ext_resource type="Texture2D" uid="uid://blh0t2ofqj2uq" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0016.png" id="472_wdxsr"]
[ext_resource type="AudioStream" uid="uid://dymoalptxmge" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_04_R.wav" id="473_8hbu5"]
[ext_resource type="Script" uid="uid://ccdhx1lt4n271" path="res://scripts/CSharp/Common/Camera/CameraTarget.cs" id="473_fn3kd"]
[ext_resource type="AudioStream" uid="uid://4555a4w30tda" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_05_R.wav" id="474_t1d6r"]
[ext_resource type="Texture2D" uid="uid://3t1m2xi4ks75" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0018.png" id="474_tu801"]
[ext_resource type="AudioStream" uid="uid://dpqvnogggvgea" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_06_R.wav" id="475_83c4i"]
@ -299,8 +300,12 @@
[ext_resource type="Texture2D" uid="uid://bopxv06co1osl" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0006.png" id="482_wfdif"]
[ext_resource type="Script" uid="uid://iquhbkr7pqeg" path="res://scripts/CSharp/Common/Savegame/SaveCheats.cs" id="483_kduih"]
[ext_resource type="Texture2D" uid="uid://coyggdfwgkeru" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0008.png" id="484_32thn"]
[ext_resource type="AudioStream" uid="uid://fsiypqhql67w" path="res://audio/sfx/Farming/SFX_GettingWater_01.wav" id="484_jb7tm"]
[ext_resource type="Script" uid="uid://ca4s0algeij1h" path="res://scripts/CSharp/Common/Savegame/SaveIDProviderTool.cs" id="484_upuan"]
[ext_resource type="AudioStream" uid="uid://foyw26hq1qp5" path="res://audio/sfx/Farming/SFX_GettingWater_02.wav" id="485_fn3kd"]
[ext_resource type="Texture2D" uid="uid://du6x1h42smp6m" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0010.png" id="486_kobao"]
[ext_resource type="AudioStream" uid="uid://c43a6x43jkikl" path="res://audio/sfx/Farming/SFX_GettingWater_Well_01_Reverb.wav" id="486_ux0r8"]
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer2D.cs" id="487_7qtxa"]
[ext_resource type="Texture2D" uid="uid://bras5gn8ov27l" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0012.png" id="488_ygjj5"]
[ext_resource type="Texture2D" uid="uid://rjmsht4g8dvp" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0014.png" id="490_6603x"]
[ext_resource type="Texture2D" uid="uid://diqnv8ut7lffx" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0016.png" id="492_0tmn6"]
@ -484,7 +489,7 @@
[ext_resource type="Texture2D" uid="uid://b0v61all3tsny" path="res://art/animation/Vesna2D/Vesna Anims Tools/S02-Walk-Gießkanne/0018.png" id="812_sf8kv"]
[ext_resource type="Texture2D" uid="uid://cao7vqax8cblo" path="res://art/animation/Vesna2D/Vesna Anims Tools/S02-Walk-Gießkanne/0020.png" id="814_3uq4g"]
[ext_resource type="Script" uid="uid://bcskt5ckh3rqa" path="res://scripts/CSharp/Common/Farming/FarmingControls2D.cs" id="817_6nrw3"]
[ext_resource type="Script" uid="uid://cvkw4qd2hxksi" path="res://scripts/GdScript/dialogic_toggle.gd" id="819_4na52"]
[ext_resource type="Script" path="res://scripts/GdScript/dialogic_toggle.gd" id="819_4na52"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ssqtd"]
radius = 110.018
@ -2087,6 +2092,12 @@ stream_4/stream = ExtResource("474_t1d6r")
stream_5/stream = ExtResource("475_83c4i")
stream_6/stream = ExtResource("476_deeju")
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_4da77"]
streams_count = 3
stream_0/stream = ExtResource("484_jb7tm")
stream_1/stream = ExtResource("485_fn3kd")
stream_2/stream = ExtResource("486_ux0r8")
[node name="Vesna" type="Node2D" node_paths=PackedStringArray("_farmingControls", "_player2d", "_vesnaAnimations")]
y_sort_enabled = true
script = ExtResource("1_yd5ep")
@ -2175,6 +2186,10 @@ _wateringCanFillStateNode = NodePath("../WateringCanFillState")
[node name="DetectionCross" parent="CharacterBody2D" instance=ExtResource("466_e04c3")]
position = Vector2(0, -260)
[node name="CameraTarget" type="Node2D" parent="CharacterBody2D"]
script = ExtResource("473_fn3kd")
Priority = 10.0
[node name="FarmingControls" type="Node2D" parent="." node_paths=PackedStringArray("_movingPlayer")]
script = ExtResource("817_6nrw3")
_sceneKeyProvider = ExtResource("471_83c4i")
@ -2197,6 +2212,12 @@ script = ExtResource("471_2f15g")
[node name="Timer" type="Timer" parent="SFX/FootstepsAudio"]
wait_time = 0.5
[node name="FillWater SFX2" type="AudioStreamPlayer2D" parent="SFX"]
stream = SubResource("AudioStreamRandomizer_4da77")
max_distance = 20000000.0
playback_type = 2
script = ExtResource("487_7qtxa")
[node name="SaveSystem" type="Node" parent="."]
[node name="SaveGameCheat" type="Node" parent="SaveSystem"]
@ -2206,6 +2227,7 @@ script = ExtResource("483_kduih")
script = ExtResource("484_upuan")
[connection signal="FilledWateringCan" from="." to="CharacterBody2D/WateringCan/WateringCanUI" method="Refill"]
[connection signal="FilledWateringCan" from="." to="SFX/FillWater SFX2" method="PlayOneShot"]
[connection signal="InventorySelectionChanged" from="." to="CharacterBody2D/WateringCan/WateringCanUI" method="IsWateringCanActive"]
[connection signal="PickedUpTool" from="." to="CharacterBody2D/visuals" method="ActivateTool"]
[connection signal="PickedUpTool" from="." to="CharacterBody2D/WateringCan/WateringCanUI" method="IsWateringCanActive"]

@ -11,7 +11,7 @@ config_version=5
[application]
config/name="Babushka"
run/main_scene="uid://bopv10dqm1knc"
run/main_scene="uid://66pmq4efjip8"
config/features=PackedStringArray("4.5", "C#", "Forward Plus")
run/max_fps=120
boot_splash/fullsize=false

@ -1,4 +1,4 @@
[gd_scene load_steps=122 format=3 uid="uid://66pmq4efjip8"]
[gd_scene load_steps=118 format=3 uid="uid://66pmq4efjip8"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_o8nii"]
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="2_mnal7"]
@ -63,9 +63,6 @@
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer2D.cs" id="61_sfnme"]
[ext_resource type="AudioStream" uid="uid://dapsknn486aee" path="res://audio/sfx/Farming/SFX_WateringPlants_01.wav" id="62_38bnv"]
[ext_resource type="AudioStream" uid="uid://dnyne8wov50so" path="res://audio/sfx/Farming/SFX_WateringPlants_02.wav" id="63_cbwuo"]
[ext_resource type="AudioStream" uid="uid://fsiypqhql67w" path="res://audio/sfx/Farming/SFX_GettingWater_01.wav" id="64_netyg"]
[ext_resource type="AudioStream" uid="uid://foyw26hq1qp5" path="res://audio/sfx/Farming/SFX_GettingWater_02.wav" id="65_ujx1u"]
[ext_resource type="AudioStream" uid="uid://c43a6x43jkikl" path="res://audio/sfx/Farming/SFX_GettingWater_Well_01_Reverb.wav" id="66_hokxo"]
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="67_qfkw3"]
[ext_resource type="Resource" uid="uid://cm8kftow8br00" path="res://resources/quests/demo/1_talk_yeli_1.tres" id="68_ukjtk"]
[ext_resource type="Script" uid="uid://c741nyedy26mx" path="res://scripts/CSharp/Common/QuestBehaviour/DetectInventoryContains.cs" id="69_3q2kg"]
@ -264,12 +261,6 @@ streams_count = 2
stream_0/stream = ExtResource("62_38bnv")
stream_1/stream = ExtResource("63_cbwuo")
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_618my"]
streams_count = 3
stream_0/stream = ExtResource("64_netyg")
stream_1/stream = ExtResource("65_ujx1u")
stream_2/stream = ExtResource("66_hokxo")
[sub_resource type="Resource" id="Resource_y820s"]
script = ExtResource("70_i0rxh")
blueprint = ExtResource("33_iuqnb")
@ -284,7 +275,7 @@ metadata/_custom_type_script = "uid://be54lnb6gg81f"
script = ExtResource("1_o8nii")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_indoor_common_room.tscn", "res://scenes/entity_scenes/outside_beets.tscn")
[node name="Camera2D" type="Camera2D" parent="." node_paths=PackedStringArray("_followNode")]
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(3180, 1961)
scale = Vector2(1, 0.993819)
offset = Vector2(0, -500)
@ -295,7 +286,6 @@ limit_right = 16000
limit_bottom = 4700
editor_draw_limits = true
script = ExtResource("2_mnal7")
_followNode = NodePath("../YSorted/Vesna/CharacterBody2D")
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
@ -966,10 +956,6 @@ z_index = 1
position = Vector2(9322, 2018)
_hoe = ExtResource("28_678ve")
[node name="FarmingControls" parent="YSorted/Vesna" index="1" node_paths=PackedStringArray("_camera", "_fieldParent")]
_camera = NodePath("../../../Camera2D")
_fieldParent = NodePath("../../FieldParent")
[node name="Well" type="Sprite2D" parent="YSorted" node_paths=PackedStringArray("_interactionArea")]
z_index = 1
y_sort_enabled = true
@ -2480,12 +2466,6 @@ max_distance = 20000000.0
playback_type = 2
script = ExtResource("61_sfnme")
[node name="FillWater SFX2" type="AudioStreamPlayer2D" parent="Audio/SFX"]
stream = SubResource("AudioStreamRandomizer_618my")
max_distance = 20000000.0
playback_type = 2
script = ExtResource("61_sfnme")
[node name="SpecialQuestTrigger" type="Node" parent="."]
[node name="QuestInstantStart" type="Node" parent="SpecialQuestTrigger"]
@ -2552,23 +2532,16 @@ script = ExtResource("82_ec5sc")
visible = false
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"]
@ -2588,7 +2561,6 @@ texture = ExtResource("83_50rxh")
[connection signal="OnFulfilled" from="SpecialQuestTrigger/FieldWorkTrigger" to="SpecialQuestTrigger/FieldWorkTrigger/StartDialog" method="open"]
[connection signal="tree_entered" from="SceneNameSetter" to="SceneNameSetter" method="Set"]
[editable path="YSorted/Vesna"]
[editable path="YSorted/Well/InteractionArea"]
[editable path="YSorted/CanGenericPickup"]
[editable path="YSorted/CanGenericPickup/PickupInteractionArea"]

@ -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)
{

Loading…
Cancel
Save