From 9506f4160f0bd351f0853e6e8263ea927d9ec771 Mon Sep 17 00:00:00 2001 From: Nemrav <> Date: Mon, 22 Apr 2024 17:30:21 -0300 Subject: Music and Sound Effect loading and playing almost working music loading music list sent to godot wav loading not working mp3 metadata load wav initial load and play title theme first fix errors not related to nodetools working wav define loading and music playlists fixup error handling and playlist load song chances code style progress switch mp3 metadata addon to MusicMetadata add id3v1 mp3 metadata handling to MusicMetadata remove commented code from id3v1 sounds gd styling fix dataloader conflicts clean up commented code move MusicChance to dataloader remove reference to old addon move sfx defines loader add self to credits feedback on soundSingleton include subfolders in sound singleton sfx map replace space tabs replace std_view_to_godot_string with std_to_godot_string revise singleton files revise gd side sound final revisions --- .../src/openvic-extension/singletons/GameSingleton.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'extension/src/openvic-extension/singletons/GameSingleton.cpp') diff --git a/extension/src/openvic-extension/singletons/GameSingleton.cpp b/extension/src/openvic-extension/singletons/GameSingleton.cpp index 4960b4f..5268789 100644 --- a/extension/src/openvic-extension/singletons/GameSingleton.cpp +++ b/extension/src/openvic-extension/singletons/GameSingleton.cpp @@ -37,7 +37,9 @@ StringName const& GameSingleton::_signal_clock_state_changed() { void GameSingleton::_bind_methods() { OV_BIND_SMETHOD(setup_logger); - OV_BIND_METHOD(GameSingleton::load_defines_compatibility_mode, { "file_paths" }); + OV_BIND_METHOD(GameSingleton::load_defines_compatibility_mode); + OV_BIND_METHOD(GameSingleton::set_compatibility_mode_roots, { "file_paths" }); + OV_BIND_SMETHOD(search_for_game_path, { "hint_path" }, DEFVAL(String {})); OV_BIND_METHOD(GameSingleton::lookup_file_path, { "path" }); @@ -582,16 +584,21 @@ Error GameSingleton::_load_flag_sheet() { return ret; } -Error GameSingleton::load_defines_compatibility_mode(PackedStringArray const& file_paths) { +Error GameSingleton::set_compatibility_mode_roots(PackedStringArray const& file_paths) { Dataloader::path_vector_t roots; for (String const& path : file_paths) { roots.push_back(Utilities::godot_to_std_string(path)); } - Error err = OK; + ERR_FAIL_COND_V_MSG(!game_manager.set_roots(roots), FAILED, "Failed to set dataloader roots!"); + return OK; +} +Error GameSingleton::load_defines_compatibility_mode() { + Error err = OK; auto add_message = std::bind_front(&LoadLocalisation::add_message, LoadLocalisation::get_singleton()); - if (!game_manager.load_definitions(roots, add_message)) { + + if (!game_manager.load_definitions(add_message)) { UtilityFunctions::push_error("Failed to load defines!"); err = FAILED; } -- cgit v1.2.3-56-ga3b1