Ajout de la cinématique de début et refonte du système audio

Et toujours un peu de correction de bug par ci par là
This commit is contained in:
2026-02-11 21:11:32 +01:00
parent 4b8e59ee56
commit c992950789
54 changed files with 1186 additions and 882 deletions

View File

@@ -4,4 +4,5 @@ class_name Scene
@export var scene_id : String
@export_file_path() var scene_path : String
@export var mouse_captured := false
@export var need_terrain_generated := false
@export var need_terrain_generated := false
@export var need_to_be_saved = true

View File

@@ -5,6 +5,7 @@ extends Node
signal scene_loaded(scene : Scene)
signal scene_node_ready(scene : Scene)
var actual_scene = null
var loading_scene = false
var generating_node = false
var next_scene_node : Node
@@ -20,16 +21,21 @@ func search_scenes(scene_id : String) -> Scene:
else :
return scenes[scene_pos]
func change_scene(scene_id : String, with_loading = true):
if loading_scene or generating_node:
await scene_node_ready
func change_to_scene_id(scene_id : String, with_loading = true):
var scene = search_scenes(scene_id)
if not scene:
printerr("Scene %s not found" % scene_id)
return
GameInfo.game_data.actual_scene = scene
change_to_scene(scene, with_loading)
func change_to_scene(scene : Scene, with_loading = true):
if loading_scene or generating_node:
await scene_node_ready
actual_scene = scene
loading_scene = true
var scene_path_to_load = scene.scene_path
ResourceLoader.load_threaded_request(scene_path_to_load)
@@ -64,17 +70,21 @@ func change_scene(scene_id : String, with_loading = true):
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED if scene.mouse_captured else Input.MOUSE_MODE_VISIBLE
GameInfo.update_inputs()
if actual_scene.need_to_be_saved:
GameInfo.game_data.last_game_scene = scene
GameInfo.save_game_data()
if with_loading:
LoadingScreen.hide_loading_screen()
func _process(_delta):
if loading_scene:
var progress = []
var load_status := ResourceLoader.load_threaded_get_status(GameInfo.game_data.actual_scene.scene_path, progress)
var load_status := ResourceLoader.load_threaded_get_status(actual_scene.scene_path, progress)
LoadingScreen.loading_value = progress[0]
if load_status == ResourceLoader.THREAD_LOAD_LOADED:
loading_scene = false
scene_loaded.emit(GameInfo.game_data.actual_scene)
scene_loaded.emit(actual_scene)
if load_status == ResourceLoader.THREAD_LOAD_FAILED or load_status == ResourceLoader.THREAD_LOAD_INVALID_RESOURCE:
printerr()
elif generating_node:
@@ -85,4 +95,4 @@ func _process(_delta):
scene_node_ready.emit()
elif next_scene_node.is_node_ready():
generating_node = false
scene_node_ready.emit(GameInfo.game_data.actual_scene)
scene_node_ready.emit(actual_scene)