diff --git a/Scenes and Scripts/Scenes/Main Menu/MainMenu.tscn b/Scenes and Scripts/Scenes/Main Menu/MainMenu.tscn index d2001f8a..3de6fb99 100644 --- a/Scenes and Scripts/Scenes/Main Menu/MainMenu.tscn +++ b/Scenes and Scripts/Scenes/Main Menu/MainMenu.tscn @@ -372,7 +372,7 @@ grow_horizontal = 2 grow_vertical = 2 metadata/_edit_use_anchors_ = true -[node name="Version" type="Label" parent="Camera3D/MainLayer"] +[node name="Version_LBL" type="Label" parent="Camera3D/MainLayer"] modulate = Color(1, 1, 1, 0.259) anchors_preset = 1 anchor_left = 1.0 @@ -384,7 +384,7 @@ offset_bottom = 39.0 grow_horizontal = 0 theme = ExtResource("4_grlcg") theme_override_font_sizes/font_size = 26 -text = "v0.4.0" +text = "v0.4.5" [node name="FadeOut" type="ColorRect" parent="Camera3D/MainLayer"] anchors_preset = 15 diff --git a/Scenes and Scripts/Scenes/Player/Inventory/InventorySlot_SCRIPT.gd b/Scenes and Scripts/Scenes/Player/Inventory/InventorySlot_SCRIPT.gd index c85e056a..92054277 100644 --- a/Scenes and Scripts/Scenes/Player/Inventory/InventorySlot_SCRIPT.gd +++ b/Scenes and Scripts/Scenes/Player/Inventory/InventorySlot_SCRIPT.gd @@ -50,6 +50,7 @@ extends StaticBody2D @export var is_touching_draggable = false @export var populated = false +@export var reserved_for_populating = false func _ready(): modulate = Color(1, 1, 1, 0.05) @@ -74,6 +75,21 @@ func set_populated(populatedValue : bool): print("{LOCAL} [InventorySlot_SCRIPT.gd] Empty, Slot: " + str(name)) populated = false +func is_reserved_for_populating(): + if reserved_for_populating: + return true + else: + return false + +func set_reserved_for_populating(value : bool): + if value: + reserved_for_populating = true + print("{LOCAL} [InventorySlot_SCRIPT.gd] Reserved for populating, Slot: " + str(name)) + else: + print("{LOCAL} [InventorySlot_SCRIPT.gd] Cleared reservation for populating, Slot: " + str(name)) + reserved_for_populating = false + + func _on_draggable_detector_area_entered(area: Area2D) -> void: if area.is_in_group("draggable"): if $AlreadyPopulatedChecker.time_left > 0.0: diff --git a/Scenes and Scripts/Scenes/Player/Player.tscn b/Scenes and Scripts/Scenes/Player/Player.tscn index f2c67ec8..fed02ee6 100644 --- a/Scenes and Scripts/Scenes/Player/Player.tscn +++ b/Scenes and Scripts/Scenes/Player/Player.tscn @@ -88,7 +88,7 @@ size = Vector2(1101.5, 236) [sub_resource type="RectangleShape2D" id="RectangleShape2D_47l1q"] size = Vector2(417.75, 819) -[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("head", "camera", "Inventory_Item_Ref_Label", "Is_Raycast_Colliding_Label", "Is_Inside_Settings_Label", "Is_Moving_Label", "Is_Walking_Label", "Is_Sprinting_Label", "Is_Crouching_Label", "Showing_Interaction_Notification_Label", "Current_Time_Label", "Current_FPS_Label", "Player_Position_Label", "Player_VelocityY_Label", "Player_VelocityY_Accurate_Label", "Is_On_Floor_Label", "Inputs_Currently_Pressing_Label") groups=["PlayerBody"]] +[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("head", "camera", "Slot1_Ref", "Slot2_Ref", "Slot3_Ref", "Slot4_Ref", "Slot5_Ref", "Slot6_Ref", "Slot7_Ref", "Slot8_Ref", "Slot9_Ref", "Inventory_Item_Ref_Label", "Is_Raycast_Colliding_Label", "Is_Inside_Settings_Label", "Is_Moving_Label", "Is_Walking_Label", "Is_Sprinting_Label", "Is_Crouching_Label", "Showing_Interaction_Notification_Label", "Current_Time_Label", "Current_FPS_Label", "Player_Position_Label", "Player_VelocityY_Label", "Player_VelocityY_Accurate_Label", "Is_On_Floor_Label", "Inputs_Currently_Pressing_Label") groups=["PlayerBody"]] collision_mask = 3 script = ExtResource("1_5mhs1") Fade_In = true @@ -97,6 +97,15 @@ CROUCH_SPEED = 2.0 CROUCH_INTERPOLATION = 8.0 head = NodePath("Head") camera = NodePath("Head/Camera3D") +Slot1_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot1") +Slot2_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot2") +Slot3_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot3") +Slot4_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot4") +Slot5_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot5") +Slot6_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot6") +Slot7_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot7") +Slot8_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot8") +Slot9_Ref = NodePath("Head/Camera3D/InventoryLayer/Slot9") Inventory_Item_Ref_Label = NodePath("Head/Camera3D/DebugLayer/item_ref_LBL") Is_Raycast_Colliding_Label = NodePath("Head/Camera3D/DebugLayer/is_raycast_colliding") Is_Inside_Settings_Label = NodePath("Head/Camera3D/DebugLayer/is_inside_settings") diff --git a/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd b/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd index 8def1bd3..e7194a52 100644 --- a/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd +++ b/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd @@ -172,6 +172,17 @@ var is_crouching = false @export var head : Node3D # Reference to the head of the player scene. (used for mouse movement and looking around) @export var camera : Camera3D # Reference to the camera of the player (used for mouse movement and looking around) +@export_subgroup("Inventory") +@export var Slot1_Ref : StaticBody2D +@export var Slot2_Ref : StaticBody2D +@export var Slot3_Ref : StaticBody2D +@export var Slot4_Ref : StaticBody2D +@export var Slot5_Ref : StaticBody2D +@export var Slot6_Ref : StaticBody2D +@export var Slot7_Ref : StaticBody2D +@export var Slot8_Ref : StaticBody2D +@export var Slot9_Ref : StaticBody2D + @export_subgroup("Debug") @export var Inventory_Item_Ref_Label : Label @export var Is_Raycast_Colliding_Label : Label @@ -554,29 +565,29 @@ func _on_boundary_area_exited(area): func _on_pickup_object_detector_area_entered(area: Area3D) -> void: if area.is_in_group("pickup_player_detector"): var slots = [ - $Head/Camera3D/InventoryLayer/Slot1, - $Head/Camera3D/InventoryLayer/Slot2, - $Head/Camera3D/InventoryLayer/Slot3, - $Head/Camera3D/InventoryLayer/Slot4, - $Head/Camera3D/InventoryLayer/Slot5, - $Head/Camera3D/InventoryLayer/Slot6, - $Head/Camera3D/InventoryLayer/Slot7, - $Head/Camera3D/InventoryLayer/Slot8, - $Head/Camera3D/InventoryLayer/Slot9 + Slot1_Ref, + Slot2_Ref, + Slot3_Ref, + Slot4_Ref, + Slot5_Ref, + Slot6_Ref, + Slot7_Ref, + Slot8_Ref, + Slot9_Ref, ] var free_slot = null - + + # Get the free slot for i in range(slots.size()): if not slots[i].is_populated(): free_slot = slots[i] break - + + if free_slot != null: - # Use the free_slot variable as needed - print("{LOCAL} [Player_SCRIPT.gd] Free slot found: " + free_slot.name) - + print("{LOCAL} [Player_SCRIPT.gd] Free slot found: " + free_slot.name) var PickupObject = area.get_parent() var PickupItemType = PickupObject.get_ITEM_TYPE() @@ -584,11 +595,12 @@ func _on_pickup_object_detector_area_entered(area: Area3D) -> void: print("{LOCAL} [Player_SCRIPT.gd] Collided with pickup player detector! Item: " + PickupItemType) - var tween = get_tree().create_tween().set_parallel() - + var tween = get_tree().create_tween() tween.tween_property(PickupObject, "position", PlayerPos, 0.2).set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_SINE) await get_tree().create_timer(0.2).timeout + tween.stop() + tween.kill() delete_pickup_object(PickupObject) InventoryManager.spawn_inventory_dropable(free_slot.position, PickupItemType, free_slot) diff --git a/Scenes and Scripts/Scenes/Startup Notice/StartupNotice.tscn b/Scenes and Scripts/Scenes/Startup Notice/StartupNotice.tscn index 235bb5f5..28932067 100644 --- a/Scenes and Scripts/Scenes/Startup Notice/StartupNotice.tscn +++ b/Scenes and Scripts/Scenes/Startup Notice/StartupNotice.tscn @@ -38,7 +38,7 @@ grow_vertical = 2 theme = ExtResource("2_og75x") theme_override_font_sizes/font_size = 35 text = "This is a pre-release version of Expland! -You are currently playing v0.4.0." +You are currently playing v0.4.5." horizontal_alignment = 1 vertical_alignment = 1 diff --git a/project.godot b/project.godot index b6ddec5f..67b6c76f 100644 --- a/project.godot +++ b/project.godot @@ -13,7 +13,7 @@ config_version=5 config/name="Expland" config/description="Expland " -config/version="0.4.0" +config/version="0.4.5" config/tags=PackedStringArray("3d", "noeco", "official") run/main_scene="res://Scenes and Scripts/Scenes/Main Menu/MainMenu.tscn" config/features=PackedStringArray("4.3", "Forward Plus")