Use shared menu_music helper
Switch main menu music start/pause logic to libstorm-nvgt/menu_music.nvgt and update the libstorm-nvgt submodule pointer to include the new reusable helper.
This commit is contained in:
@@ -25,6 +25,7 @@ sound_pool p(300);
|
||||
#include "src/world_state.nvgt"
|
||||
#include "libstorm-nvgt/ui.nvgt"
|
||||
#include "libstorm-nvgt/menu_helpers.nvgt"
|
||||
#include "libstorm-nvgt/menu_music.nvgt"
|
||||
#include "src/terrain_lookup.nvgt"
|
||||
#include "src/inventory.nvgt"
|
||||
#include "src/pet_system.nvgt"
|
||||
@@ -56,18 +57,11 @@ const int MAIN_MENU_LEARN_SOUNDS = 2;
|
||||
const int MAIN_MENU_EXIT = 3;
|
||||
|
||||
void start_main_menu_music() {
|
||||
if (mainMenuMusic.resume(MAIN_MENU_MUSIC_FADE_IN_MS)) return;
|
||||
if (mainMenuMusic.playing) {
|
||||
mainMenuMusic.pause(0);
|
||||
mainMenuMusic.resume(MAIN_MENU_MUSIC_FADE_IN_MS);
|
||||
return;
|
||||
}
|
||||
mainMenuMusic.play(MAIN_MENU_MUSIC_TRACK);
|
||||
menu_music_resume_or_play(mainMenuMusic, MAIN_MENU_MUSIC_TRACK, MAIN_MENU_MUSIC_FADE_IN_MS);
|
||||
}
|
||||
|
||||
void stop_main_menu_music() {
|
||||
if (!mainMenuMusic.playing) return;
|
||||
mainMenuMusic.pause(MAIN_MENU_MUSIC_FADE_OUT_MS);
|
||||
menu_music_pause(mainMenuMusic, MAIN_MENU_MUSIC_FADE_OUT_MS);
|
||||
}
|
||||
|
||||
int run_main_menu() {
|
||||
|
||||
Submodule libstorm-nvgt updated: 104c385ae4...e21ffcd774
Reference in New Issue
Block a user