add reusable menu music helpers
This commit is contained in:
19
README.md
19
README.md
@@ -11,6 +11,7 @@ Reusable NVGT helpers for Storm projects.
|
||||
- `speech_history.nvgt`: `speak_with_history()` wrapper plus comma/period history navigation.
|
||||
- `notifications.nvgt`: Queued notifications with history and optional sound playback.
|
||||
- `menu_helpers.nvgt`: Simple menu runner + filter helpers with `sounds/menu` defaults.
|
||||
- `menu_music.nvgt`: Reusable menu music start/pause/stop helpers with blocking fade-out pause by default.
|
||||
- `audio_paths.nvgt`: Shared `.ogg` / `.wav` audio path resolution helper.
|
||||
- `learn_sounds.nvgt`: Reusable learn-sounds browser with project-level exclusion/description hooks.
|
||||
- `docs_browser.nvgt`: Reusable document discovery/opening helpers for menus.
|
||||
@@ -30,6 +31,7 @@ Reusable NVGT helpers for Storm projects.
|
||||
#include "libstorm-nvgt/speech_history.nvgt"
|
||||
#include "libstorm-nvgt/notifications.nvgt"
|
||||
#include "libstorm-nvgt/menu_helpers.nvgt"
|
||||
#include "libstorm-nvgt/menu_music.nvgt"
|
||||
#include "libstorm-nvgt/learn_sounds.nvgt"
|
||||
#include "libstorm-nvgt/docs_browser.nvgt"
|
||||
#include "libstorm-nvgt/dict_utils.nvgt"
|
||||
@@ -85,6 +87,23 @@ menu_apply_prefix_filter(filterText, options, filteredIndices, filteredOptions);
|
||||
bool changed = menu_update_prefix_filter(filterText, options, filteredIndices, filteredOptions, selection);
|
||||
```
|
||||
|
||||
## menu_music Example
|
||||
|
||||
```nvgt
|
||||
#include "music.nvgt"
|
||||
#include "libstorm-nvgt/menu_music.nvgt"
|
||||
|
||||
music_manager mainMenuMusic;
|
||||
|
||||
void start_main_menu_music() {
|
||||
menu_music_resume_or_play(mainMenuMusic, "sounds/menu/theme.ogg; loop; f=1", 1);
|
||||
}
|
||||
|
||||
void stop_main_menu_music() {
|
||||
menu_music_pause(mainMenuMusic, 800);
|
||||
}
|
||||
```
|
||||
|
||||
## file_viewer Example
|
||||
|
||||
```nvgt
|
||||
|
||||
Reference in New Issue
Block a user