Files
draugnorak/src/learn_sounds.nvgt
T
Storm Dragon 4d5bb7c2fa Wire Draugnorak to reusable libstorm modules
Replace local ui/speech/text reader/notification modules with libstorm-nvgt integrations, keeping game-specific terrain lookup local via a new module.\n\nAdd compatibility layers for notifications and text_reader callsites, switch menu prefix filtering to shared menu helpers, and update the libstorm-nvgt submodule to include the learn_sounds select-sound toggle.
2026-02-16 20:25:43 -05:00

53 lines
1.5 KiB
Plaintext

#include "libstorm-nvgt/learn_sounds.nvgt"
#include "libstorm-nvgt/docs_browser.nvgt"
#include "excluded_sounds.nvgt"
bool learnSoundsConfigured = false;
bool docsBrowserConfigured = false;
void learn_sounds_bridge_speak(const string &in message, bool interrupt) {
speak_with_history(message, interrupt);
}
void learn_sounds_bridge_tick() {
handle_global_volume_keys();
}
void configure_docs_browser_if_needed() {
if (docsBrowserConfigured) return;
docs_browser_set_speak_callback(learn_sounds_bridge_speak);
docs_browser_set_tick_callback(learn_sounds_bridge_tick);
docs_browser_set_docs_dir("files");
docs_browser_set_menu_sound_dir("sounds/menu");
docs_browser_set_wrap(true);
docs_browser_reset_default_extensions();
docsBrowserConfigured = true;
}
void add_doc_entries(string[]@ labels, string[]@ paths, int[]@ types) {
configure_docs_browser_if_needed();
docs_browser_add_entries(labels, paths, types, 1);
}
void configure_learn_sounds_if_needed() {
if (learnSoundsConfigured) return;
learn_sounds_set_speak_callback(learn_sounds_bridge_speak);
learn_sounds_set_tick_callback(learn_sounds_bridge_tick);
learn_sounds_set_root_dir("sounds");
learn_sounds_set_menu_sound_dir("sounds/menu");
learn_sounds_set_wrap(true);
learn_sounds_set_play_select_sound(false);
configure_project_learn_sounds();
learnSoundsConfigured = true;
}
void run_learn_sounds_menu() {
configure_learn_sounds_if_needed();
learn_sounds_run_menu();
}