add page flip

This commit is contained in:
2026-06-29 15:55:01 +02:00
parent d0d052f65b
commit 9da7b074d4
46 changed files with 8671 additions and 103 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://kvn5l0n11a3q"
path="res://.godot/imported/page.png-6c8405fbc970a849a62cab2019c549ca.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://core/game_menu/assets/page.png"
dest_files=["res://.godot/imported/page.png-6c8405fbc970a849a62cab2019c549ca.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -19,6 +19,8 @@ func setup() -> void:
_add_collectible(collectible)
if unlocked_collectible_ids.has(collectible.id):
_unlock_collectible(collectible.id)
if is_inside_tree():
await get_tree().process_frame
func on_collectible_unlocked(collectible_id: StringName) -> void:
_unlock_collectible(collectible_id)

View File

@@ -11,6 +11,9 @@ func _ready() -> void:
on_tab_pressed(0, true)
func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
if BookAPI.is_busy() and not disable_animation:
return
for page in pages:
page.hide_page()
@@ -28,6 +31,7 @@ func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
pages[index].show_page()
current_index = index
BookAPI.go_to_page((index + 1) * 2)
func open() -> void:
pages[current_index].show_page()

File diff suppressed because one or more lines are too long

View File

@@ -2,8 +2,6 @@
[ext_resource type="PackedScene" uid="uid://id854u4gh12f" path="res://core/game_menu/page.tscn" id="1_uxih6"]
[ext_resource type="Texture2D" uid="uid://bd80xo2id3xdm" path="res://core/game_menu/assets/decoration_page1.png" id="2_3i50p"]
[ext_resource type="PackedScene" uid="uid://bh1kxsp5jyxfx" path="res://core/game_menu/train_selector.tscn" id="3_ijm38"]
[ext_resource type="PackedScene" uid="uid://bc60gon7fmvbr" path="res://core/game_menu/biome_selector.tscn" id="12_7yi8x"]
[node name="Page1" unique_id=2037261222 instance=ExtResource("1_uxih6")]
anchors_preset = 15
@@ -16,6 +14,7 @@ grow_vertical = 2
mouse_filter = 2
[node name="Background" parent="." index="0" unique_id=1203110384]
visible = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@@ -36,17 +35,3 @@ pivot_offset_ratio = Vector2(0.5, 0.5)
mouse_filter = 2
texture = ExtResource("2_3i50p")
expand_mode = 1
[node name="TrainSelector" parent="." index="2" unique_id=1039769375 instance=ExtResource("3_ijm38")]
layout_mode = 0
offset_left = 211.0
offset_top = 365.0
offset_right = 871.0
offset_bottom = 758.0
[node name="BiomeSelector" parent="." index="3" unique_id=1957954960 instance=ExtResource("12_7yi8x")]
layout_mode = 0
offset_left = 1038.0
offset_top = 365.0
offset_right = 1738.0
offset_bottom = 783.0

View File

@@ -0,0 +1,41 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://core/game_menu/page_interactive.gd" id="1_script"]
[ext_resource type="PackedScene" uid="uid://bh1kxsp5jyxfx" path="res://core/game_menu/train_selector.tscn" id="2_train"]
[ext_resource type="Texture2D" path="res://core/game_menu/assets/page.png" id="3_page_bg"]
[node name="Page1Left" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1160.0
offset_bottom = -506.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_script")
[node name="PageBackground" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 9
anchor_right = 0.0
anchor_bottom = 1.0
offset_right = 760.0
grow_vertical = 2
texture = ExtResource("3_page_bg")
expand_mode = 1
flip_h = true
[node name="TrainSelector" parent="." instance=ExtResource("2_train")]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -346.0
offset_top = -154.5
offset_right = 279.0
offset_bottom = 154.5
grow_horizontal = 2
grow_vertical = 2

View File

@@ -0,0 +1,42 @@
[gd_scene format=3 uid="uid://d06kfd33fgepf"]
[ext_resource type="Script" uid="uid://0yyr318wl7co" path="res://core/game_menu/page_interactive.gd" id="1_script"]
[ext_resource type="PackedScene" uid="uid://bc60gon7fmvbr" path="res://core/game_menu/biome_selector.tscn" id="2_biome"]
[ext_resource type="Texture2D" uid="uid://kvn5l0n11a3q" path="res://core/game_menu/assets/page.png" id="3_page_bg"]
[node name="Page1Right" type="Control" unique_id=2093612752]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1160.0
offset_bottom = -506.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_script")
[node name="PageBackground" type="TextureRect" parent="." unique_id=1432670109]
layout_mode = 1
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -760.0
grow_horizontal = 0
grow_vertical = 2
texture = ExtResource("3_page_bg")
expand_mode = 1
[node name="BiomeSelector" parent="." unique_id=679177937 instance=ExtResource("2_biome")]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -301.0
offset_top = -158.0
offset_right = 368.0
offset_bottom = 158.0
grow_horizontal = 2
grow_vertical = 2

View File

@@ -1,13 +1,7 @@
[gd_scene format=3 uid="uid://4bamw5busnvc"]
[ext_resource type="PackedScene" uid="uid://id854u4gh12f" path="res://core/game_menu/page.tscn" id="1_ka6tx"]
[ext_resource type="Texture2D" uid="uid://xgx0211eo8hi" path="res://core/game_menu/assets/page_2/photocollections_text.png" id="2_4uwhd"]
[ext_resource type="Texture2D" uid="uid://d3qq4ho24phyw" path="res://core/game_menu/assets/decoration_page2.png" id="2_xqdsh"]
[ext_resource type="Texture2D" uid="uid://xfl3ks4dbfaw" path="res://core/game_menu/assets/page_2/achievements_text.png" id="3_4uwhd"]
[ext_resource type="PackedScene" uid="uid://b6r787sik5yil" path="res://core/game_menu/photo_gallery.tscn" id="4_3tfra"]
[ext_resource type="PackedScene" uid="uid://bvw086glfpcba" path="res://core/game_menu/collectible_gallery.tscn" id="5_w0bcg"]
[ext_resource type="PackedScene" uid="uid://c7t3p8sp54apy" path="res://core/game_menu/highlighted_photo.tscn" id="6_2273a"]
[ext_resource type="Texture2D" uid="uid://bx6gsh5uchkge" path="res://core/game_menu/assets/lock.png" id="8_48jk0"]
[node name="Page2" unique_id=2037261222 instance=ExtResource("1_ka6tx")]
anchors_preset = 15
@@ -31,49 +25,4 @@ mouse_filter = 2
texture = ExtResource("2_xqdsh")
expand_mode = 1
[node name="PhotoCollectionText" type="TextureRect" parent="." index="2" unique_id=240014191]
layout_mode = 0
offset_left = 260.0
offset_top = 330.0
offset_right = 827.0
offset_bottom = 415.0
texture = ExtResource("2_4uwhd")
stretch_mode = 3
[node name="AchievementsText" type="TextureRect" parent="." index="3" unique_id=1478291812]
layout_mode = 0
offset_left = 1184.0
offset_top = 330.0
offset_right = 1579.0
offset_bottom = 401.0
texture = ExtResource("3_4uwhd")
stretch_mode = 3
[node name="PhotoGallery" parent="." index="4" unique_id=354419843 instance=ExtResource("4_3tfra")]
layout_mode = 1
offset_left = 244.0
offset_top = 410.0
offset_right = 844.0
offset_bottom = 850.0
[node name="CollectibleGallery" parent="." index="5" unique_id=708445500 instance=ExtResource("5_w0bcg")]
visible = false
layout_mode = 1
offset_left = 1050.0
offset_top = 425.0
offset_right = 1690.0
offset_bottom = 835.0011
[node name="HighlightedPhoto" parent="." index="6" unique_id=888465569 instance=ExtResource("6_2273a")]
visible = false
layout_mode = 1
[node name="LockTexture" type="TextureRect" parent="." index="7" unique_id=1369712242]
layout_mode = 0
offset_left = 1265.0
offset_top = 449.0
offset_right = 1547.0
offset_bottom = 809.6977
texture = ExtResource("8_48jk0")
expand_mode = 1
stretch_mode = 5

View File

@@ -0,0 +1,44 @@
[gd_scene load_steps=4 format=3]
[ext_resource type="Script" path="res://core/game_menu/page_interactive.gd" id="1_script"]
[ext_resource type="Texture2D" uid="uid://xgx0211eo8hi" path="res://core/game_menu/assets/page_2/photocollections_text.png" id="2_text"]
[ext_resource type="PackedScene" uid="uid://b6r787sik5yil" path="res://core/game_menu/photo_gallery.tscn" id="3_gallery"]
[ext_resource type="Texture2D" path="res://core/game_menu/assets/page.png" id="4_page_bg"]
[node name="Page2Left" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1160.0
offset_bottom = -506.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_script")
[node name="PageBackground" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 9
anchor_right = 0.0
anchor_bottom = 1.0
offset_right = 760.0
grow_vertical = 2
texture = ExtResource("4_page_bg")
expand_mode = 1
flip_h = true
[node name="PhotoCollectionText" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 96.0
offset_top = 27.0
offset_right = 663.0
offset_bottom = 112.0
texture = ExtResource("2_text")
stretch_mode = 3
[node name="PhotoGallery" parent="." instance=ExtResource("3_gallery")]
layout_mode = 1
offset_left = 80.0
offset_top = 107.0
offset_right = 680.0
offset_bottom = 547.0

View File

@@ -0,0 +1,65 @@
[gd_scene load_steps=6 format=3]
[ext_resource type="Script" path="res://core/game_menu/page_interactive.gd" id="1_script"]
[ext_resource type="Texture2D" uid="uid://xfl3ks4dbfaw" path="res://core/game_menu/assets/page_2/achievements_text.png" id="3_4uwhd"]
[ext_resource type="PackedScene" uid="uid://bvw086glfpcba" path="res://core/game_menu/collectible_gallery.tscn" id="5_w0bcg"]
[ext_resource type="PackedScene" uid="uid://c7t3p8sp54apy" path="res://core/game_menu/highlighted_photo.tscn" id="6_2273a"]
[ext_resource type="Texture2D" uid="uid://bx6gsh5uchkge" path="res://core/game_menu/assets/lock.png" id="8_48jk0"]
[ext_resource type="Texture2D" path="res://core/game_menu/assets/page.png" id="9_page_bg"]
[node name="Page2Right" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1160.0
offset_bottom = -506.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_script")
[node name="PageBackground" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 11
anchor_left = 1.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -760.0
offset_top = 0.0
offset_right = 0.0
offset_bottom = 0.0
grow_vertical = 2
texture = ExtResource("9_page_bg")
expand_mode = 1
[node name="AchievementsText" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 261.0
offset_top = 34.5
offset_right = 656.0
offset_bottom = 105.5
texture = ExtResource("3_4uwhd")
stretch_mode = 3
[node name="CollectibleGallery" parent="." instance=ExtResource("5_w0bcg")]
visible = false
layout_mode = 1
offset_left = 127.0
offset_top = 129.5
offset_right = 767.0
offset_bottom = 539.5
[node name="HighlightedPhoto" parent="." instance=ExtResource("6_2273a")]
visible = false
layout_mode = 1
[node name="LockTexture" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 342.0
offset_top = 153.5
offset_right = 624.0
offset_bottom = 514.2
texture = ExtResource("8_48jk0")
expand_mode = 1
stretch_mode = 5

View File

@@ -2,9 +2,7 @@
[ext_resource type="PackedScene" uid="uid://id854u4gh12f" path="res://core/game_menu/page.tscn" id="1_ua8fn"]
[ext_resource type="Texture2D" uid="uid://fpnhk1ygcrmu" path="res://core/game_menu/assets/page_3/bg_timbri.png" id="2_ckqcb"]
[ext_resource type="PackedScene" uid="uid://cxf8s80ivwj1p" path="res://core/game_menu/option_menu.tscn" id="2_tymfi"]
[ext_resource type="Texture2D" uid="uid://db2yhovnqq4cp" path="res://core/game_menu/assets/decoration_page3.png" id="2_yx6jr"]
[ext_resource type="PackedScene" uid="uid://caqf471x0kttc" path="res://core/game_menu/settings_menu.tscn" id="4_twko7"]
[node name="Page3" unique_id=2037261222 instance=ExtResource("1_ua8fn")]
anchors_preset = 15
@@ -37,33 +35,4 @@ anchor_bottom = 0.7740741
texture = ExtResource("2_ckqcb")
metadata/_edit_use_anchors_ = true
[node name="OptionMenu" parent="." index="3" unique_id=1055457221 instance=ExtResource("2_tymfi")]
layout_mode = 0
anchors_preset = 0
anchor_left = 0.7213542
anchor_top = 0.5212963
anchor_right = 0.7213542
anchor_bottom = 0.5212963
grow_horizontal = 1
grow_vertical = 1
metadata/_edit_use_anchors_ = true
[node name="PlayButton" parent="OptionMenu/VBoxContainer" parent_id_path=PackedInt32Array(1055457221, 508055524) index="0" unique_id=1990327704]
visible = false
[node name="SettingsButton" parent="OptionMenu/VBoxContainer" parent_id_path=PackedInt32Array(1055457221, 508055524) index="2" unique_id=1931222561]
visible = false
[node name="SettingsMenu" parent="." index="4" unique_id=1639777294 instance=ExtResource("4_twko7")]
layout_mode = 1
anchor_top = 0.5388889
anchor_right = 0.0
anchor_bottom = 0.5388889
offset_left = 278.11
offset_top = -240.0
offset_right = 902.11
offset_bottom = 285.0
grow_vertical = 2
size_flags_horizontal = 6
[editable path="OptionMenu"]

View File

@@ -0,0 +1,35 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://core/game_menu/page_interactive.gd" id="1_script"]
[ext_resource type="PackedScene" uid="uid://caqf471x0kttc" path="res://core/game_menu/settings_menu.tscn" id="2_settings"]
[ext_resource type="Texture2D" path="res://core/game_menu/assets/page.png" id="3_page_bg"]
[node name="Page3Left" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1160.0
offset_bottom = -506.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_script")
[node name="PageBackground" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 9
anchor_right = 0.0
anchor_bottom = 1.0
offset_right = 760.0
grow_vertical = 2
texture = ExtResource("3_page_bg")
expand_mode = 1
flip_h = true
[node name="SettingsMenu" parent="." instance=ExtResource("2_settings")]
layout_mode = 0
offset_left = 68.0
offset_top = 24.5
offset_right = 692.0
offset_bottom = 549.5
size_flags_horizontal = 6

View File

@@ -0,0 +1,53 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://core/game_menu/page_interactive.gd" id="1_script"]
[ext_resource type="PackedScene" uid="uid://cxf8s80ivwj1p" path="res://core/game_menu/option_menu.tscn" id="2_option"]
[ext_resource type="Texture2D" path="res://core/game_menu/assets/page.png" id="3_page_bg"]
[node name="Page3Right" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1160.0
offset_bottom = -506.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_script")
[node name="PageBackground" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 11
anchor_left = 1.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -760.0
offset_top = 0.0
offset_right = 0.0
offset_bottom = 0.0
grow_vertical = 2
texture = ExtResource("3_page_bg")
expand_mode = 1
[node name="OptionMenu" parent="." instance=ExtResource("2_option")]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -181.5
offset_top = -212.0
offset_right = 248.5
offset_bottom = 212.0
grow_horizontal = 2
grow_vertical = 2
[node name="PlayButton" parent="OptionMenu/VBoxContainer" index="0"]
visible = false
[node name="SettingsButton" parent="OptionMenu/VBoxContainer" index="2"]
visible = false
[editable path="OptionMenu"]

View File

@@ -0,0 +1,14 @@
extends Control
signal manage_pageflip(give_control: bool)
func _ready() -> void:
manage_pageflip.connect(_on_manage_pageflip)
func _on_manage_pageflip(give_control: bool) -> void:
var tweens = find_children("*", "ContainerTween", true, false)
for tween in tweens:
if give_control:
tween.start_tween()
else:
tween.stop_tween()

View File

@@ -0,0 +1 @@
uid://0yyr318wl7co

View File

@@ -17,6 +17,8 @@ func load_gallery() -> void:
for file_path in saved_photos:
if FileAccess.file_exists(file_path):
_create_photo_thumbnail(file_path)
if is_inside_tree():
await get_tree().process_frame
func _create_photo_thumbnail(file_path: String) -> void:
var image = Image.load_from_file(file_path)