add gamestate, doc and fix

This commit is contained in:
2026-04-16 11:01:04 +02:00
parent dc0bf0ba37
commit e02bd1819f
29 changed files with 466 additions and 71 deletions

View File

@@ -5,7 +5,8 @@
[ext_resource type="PackedScene" uid="uid://bmkxt6btcx8qr" path="res://core/photo_mode/collectible.tscn" id="2_48mla"]
[ext_resource type="Script" uid="uid://bj34o0org55ei" path="res://core/photo_mode/collectible_resource.gd" id="3_hh1ka"]
[ext_resource type="Texture2D" uid="uid://c3grftlmap4q5" path="res://docs/museums/daynight/scenes/grain_test/leaf_test.png" id="4_fan5s"]
[ext_resource type="PackedScene" uid="uid://bvw086glfpcba" path="res://core/photo_mode/collection_compendium.tscn" id="5_ws0fy"]
[ext_resource type="PackedScene" uid="uid://bvw086glfpcba" path="res://core/photo_mode/collectible_gallery.tscn" id="5_ws0fy"]
[ext_resource type="PackedScene" uid="uid://b6r787sik5yil" path="res://core/photo_mode/photo_gallery.tscn" id="7_fh4km"]
[sub_resource type="Environment" id="Environment_48mla"]
@@ -67,14 +68,70 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="Button" type="Button" parent="Control" unique_id=539195532]
[node name="ButtonGallery" type="Button" parent="Control" unique_id=539195532]
layout_mode = 0
offset_right = 8.0
offset_bottom = 8.0
text = "Compendium"
offset_left = 50.0
offset_top = 50.0
offset_right = 163.0
offset_bottom = 81.0
text = "Menu"
[node name="CollectionCompendium" parent="Control" unique_id=354419843 instance=ExtResource("5_ws0fy")]
[node name="Gallery" type="HSplitContainer" parent="Control" unique_id=1388833682]
unique_name_in_owner = true
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 420.0
grow_horizontal = 2
grow_vertical = 2
[connection signal="pressed" from="Control/Button" to="." method="_on_button_pressed"]
[node name="CollectibleGallery" parent="Control/Gallery" unique_id=354419843 instance=ExtResource("5_ws0fy")]
layout_mode = 2
size_flags_horizontal = 3
[node name="PhotoGallery" parent="Control/Gallery" unique_id=263414560 instance=ExtResource("7_fh4km")]
layout_mode = 2
size_flags_horizontal = 3
[node name="PanelContainer" type="PanelContainer" parent="Control" unique_id=2015953740]
layout_mode = 0
offset_left = 50.0
offset_top = 150.0
offset_right = 400.0
offset_bottom = 927.0
[node name="ScrollContainer" type="ScrollContainer" parent="Control/PanelContainer" unique_id=1474258594]
layout_mode = 2
[node name="Label" type="Label" parent="Control/PanelContainer/ScrollContainer" unique_id=1982569320]
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
size_flags_horizontal = 3
text = "System Logic:
- The system allows players to toggle a free camera mode to photograph and collect museum items.
- Game Pause: Activating the mode pauses the SceneTree, freezing the world while allowing the camera to remain functional.
- It uses a raycasting check to verify if a collectible is visible and unobstructed before unlocking it.
- The CollectionManager acts as a global singleton to track unlocked IDs and manage the library data.
- Save Collectibles and Photo
Photo Mode Actions:
- Toggle Mode(P): Switches between normal gameplay and the photo camera, capturing or releasing the mouse, and toggles the global pause state.
- Orbit & Pan(Mouse): The camera rotates around a target and can be panned horizontally or vertically.
- Capture(F): Performs a frustum check and a raycast to identify the target in view.
Core Components:
- PhotoModeController: Manages camera inputs, movement logic, and the photo-taking process.
- Collectible: An Area3D node placed on objects to make them identifiable by the camera.
- CollectionManager: Handles the logic for unlocking items and provides data to the UI.
- CollectionCompendium: A UI grid that displays all items and visually highlights unlocked ones.
Parameters:
- Pan & Rotation Speed: Defines how fast the camera moves and rotates.
- Movement Bounds: An AABB that restricts the camera's panning area.
- Collectible Data: Resource files containing the ID, title, and image for each item.
- Library: A central list of all CollectibleResources registered in the game."
autowrap_mode = 2
[connection signal="pressed" from="Control/ButtonGallery" to="." method="_on_button_gallery_pressed"]