From 2b0955110b56b2f9da745d3dc6490dfc95b8ffb6 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 6 Feb 2026 21:18:12 -0500 Subject: [PATCH] Pause and equipment menu now available in adventures. --- draugnorak.nvgt | 3 +++ sounds/menu/menu_move.ogg | 3 +++ sounds/menu/menu_select.ogg | 3 +++ src/bosses/adventure_system.nvgt | 5 ++++ src/bosses/bandit_hideout.nvgt | 37 ++++++++++++++++++++++++++++ src/bosses/unicorn/unicorn_boss.nvgt | 33 ++++++++++++++++++++++++- src/crafting/craft_barricade.nvgt | 4 +++ src/crafting/craft_buildings.nvgt | 3 +++ src/crafting/craft_clothing.nvgt | 4 +++ src/crafting/craft_materials.nvgt | 4 +++ src/crafting/craft_runes.nvgt | 7 ++++++ src/crafting/craft_tools.nvgt | 4 +++ src/crafting/craft_weapons.nvgt | 4 +++ src/crafting/crafting_core.nvgt | 3 +++ src/fylgja_system.nvgt | 3 +++ src/menus/action_menu.nvgt | 4 +++ src/menus/altar_menu.nvgt | 4 +++ src/menus/base_info.nvgt | 2 ++ src/menus/equipment_menu.nvgt | 3 +++ src/menus/inventory_core.nvgt | 7 ++++++ src/menus/menu_utils.nvgt | 15 +++++++++++ src/menus/storage_menu.nvgt | 4 +++ src/player.nvgt | 1 + src/quest_system.nvgt | 3 +++ src/save_system.nvgt | 6 +++++ 25 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 sounds/menu/menu_move.ogg create mode 100644 sounds/menu/menu_select.ogg diff --git a/draugnorak.nvgt b/draugnorak.nvgt index 036610c..fe3a4f4 100755 --- a/draugnorak.nvgt +++ b/draugnorak.nvgt @@ -53,18 +53,21 @@ int run_main_menu() { wait(5); if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); return selection; } diff --git a/sounds/menu/menu_move.ogg b/sounds/menu/menu_move.ogg new file mode 100644 index 0000000..cce3dbc --- /dev/null +++ b/sounds/menu/menu_move.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfff60d50e0bb5bcb47b449d6c349dd13bb02538a61de784e29908025801d269 +size 4081 diff --git a/sounds/menu/menu_select.ogg b/sounds/menu/menu_select.ogg new file mode 100644 index 0000000..7c86ce0 --- /dev/null +++ b/sounds/menu/menu_select.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae144ea519d33452915ca7fbd0ff81195a372cfa4f01846845c17dc66c85376b +size 5595 diff --git a/src/bosses/adventure_system.nvgt b/src/bosses/adventure_system.nvgt index d4fa2a8..1e0dec9 100644 --- a/src/bosses/adventure_system.nvgt +++ b/src/bosses/adventure_system.nvgt @@ -59,18 +59,21 @@ void run_adventure_menu(int player_x) { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); start_adventure(adventure_ids[selection]); // Adventure has finished (it blocks until done) // Resume main game ambience @@ -82,9 +85,11 @@ void run_adventure_menu(int player_x) { void start_adventure(int adventure_id) { last_adventure_day = current_day; + menuBackgroundUpdatesEnabled = false; if (adventure_id == 1) { run_unicorn_adventure(); } else if (adventure_id == ADVENTURE_BANDIT_HIDEOUT) { run_bandit_hideout_adventure(); } + menuBackgroundUpdatesEnabled = true; } diff --git a/src/bosses/bandit_hideout.nvgt b/src/bosses/bandit_hideout.nvgt index 89fba0d..555e8ae 100644 --- a/src/bosses/bandit_hideout.nvgt +++ b/src/bosses/bandit_hideout.nvgt @@ -55,6 +55,22 @@ timer hideoutSearchDelayTimer; timer hideoutJumpTimer; bool hideoutSearching = false; +void restart_hideout_adventure_timers() { + hideoutWalkTimer.restart(); + hideoutAttackTimer.restart(); + hideoutSearchTimer.restart(); + hideoutSearchDelayTimer.restart(); + hideoutJumpTimer.restart(); + bow_draw_timer.restart(); + bow_shot_timer.restart(); + sling_charge_timer.restart(); + + for (uint i = 0; i < hideoutBandits.length(); i++) { + hideoutBandits[i].moveTimer.restart(); + hideoutBandits[i].attackTimer.restart(); + } +} + string pick_hideout_terrain() { int roll = random(0, 2); if (roll == 0) return "grass"; @@ -215,6 +231,7 @@ void init_bandit_hideout_adventure() { build_hideout_terrain(); clear_hideout_bandits(); spawn_hideout_bandits_initial(); + restart_hideout_adventure_timers(); } void cleanup_bandit_hideout_adventure() { @@ -241,9 +258,28 @@ void run_bandit_hideout_adventure() { intro.insert_last("Bandits will, of course, not take this lying down."); text_reader_lines(intro, "Adventure", true); + bool adventurePaused = false; while (true) { wait(5); + if (key_pressed(KEY_BACK)) { + adventurePaused = !adventurePaused; + if (adventurePaused) { + p.pause_all(); + speak_with_history("Paused. Press backspace to resume.", true); + } else { + p.resume_all(); + restart_hideout_adventure_timers(); + restart_all_timers(); + speak_with_history("Resumed.", true); + } + continue; + } + + if (adventurePaused) { + continue; + } + if (key_pressed(KEY_ESCAPE)) { cleanup_bandit_hideout_adventure(); speak_with_history("You flee the hideout.", true); @@ -252,6 +288,7 @@ void run_bandit_hideout_adventure() { // Standard game keys check_quick_slot_keys(); + check_equipment_menu(); check_notification_keys(); check_speech_history_keys(); diff --git a/src/bosses/unicorn/unicorn_boss.nvgt b/src/bosses/unicorn/unicorn_boss.nvgt index fa15489..0c4badf 100644 --- a/src/bosses/unicorn/unicorn_boss.nvgt +++ b/src/bosses/unicorn/unicorn_boss.nvgt @@ -52,6 +52,16 @@ bool unicorn_defeated = false; bool unicorn_defeated_by_fall = false; bool unicorn_in_weapon_range = false; +void restart_unicorn_adventure_timers() { + arena_jump_timer.restart(); + arena_walk_timer.restart(); + arena_attack_timer.restart(); + unicorn.move_timer.restart(); + bow_draw_timer.restart(); + bow_shot_timer.restart(); + sling_charge_timer.restart(); +} + void init_unicorn_adventure() { unicorn.reset(); unicorn.x = UNICORN_ARENA_SIZE - 1; // Start at east end @@ -70,6 +80,7 @@ void init_unicorn_adventure() { bridge_supports_health.resize(2); bridge_supports_health[0] = BRIDGE_SUPPORT_MAX_HEALTH; // Left support at BRIDGE_START bridge_supports_health[1] = BRIDGE_SUPPORT_MAX_HEALTH; // Right support at BRIDGE_END + restart_unicorn_adventure_timers(); } void cleanup_unicorn_adventure() { @@ -108,9 +119,28 @@ void run_unicorn_adventure() { text_reader_lines(intro, "Adventure", true); // Adventure Loop + bool adventurePaused = false; while (true) { wait(5); - + + if (key_pressed(KEY_BACK)) { + adventurePaused = !adventurePaused; + if (adventurePaused) { + p.pause_all(); + speak_with_history("Paused. Press backspace to resume.", true); + } else { + p.resume_all(); + restart_unicorn_adventure_timers(); + restart_all_timers(); + speak_with_history("Resumed.", true); + } + continue; + } + + if (adventurePaused) { + continue; + } + // Input Handling if (key_pressed(KEY_ESCAPE)) { cleanup_unicorn_adventure(); @@ -120,6 +150,7 @@ void run_unicorn_adventure() { // Standard game keys check_quick_slot_keys(); + check_equipment_menu(); check_notification_keys(); check_speech_history_keys(); diff --git a/src/crafting/craft_barricade.nvgt b/src/crafting/craft_barricade.nvgt index f1f3632..0d30b85 100644 --- a/src/crafting/craft_barricade.nvgt +++ b/src/crafting/craft_barricade.nvgt @@ -42,18 +42,21 @@ void run_barricade_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); int action = action_types[selection]; if (action == 0) reinforce_barricade_with_sticks(); else if (action == 1) reinforce_barricade_with_vines(); @@ -63,6 +66,7 @@ void run_barricade_menu() { } if (key_pressed(KEY_TAB)) { + play_menu_select_sound(); int action = action_types[selection]; if (action == 0) reinforce_barricade_max_with_sticks(); else if (action == 1) reinforce_barricade_max_with_vines(); diff --git a/src/crafting/craft_buildings.nvgt b/src/crafting/craft_buildings.nvgt index 404013c..4132aae 100644 --- a/src/crafting/craft_buildings.nvgt +++ b/src/crafting/craft_buildings.nvgt @@ -102,18 +102,21 @@ void run_buildings_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); int building = building_types[selection]; if (building == 0) craft_firepit(); else if (building == 1) craft_campfire(); diff --git a/src/crafting/craft_clothing.nvgt b/src/crafting/craft_clothing.nvgt index 80dcd09..d99144e 100644 --- a/src/crafting/craft_clothing.nvgt +++ b/src/crafting/craft_clothing.nvgt @@ -65,18 +65,21 @@ void run_clothing_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); if (selection == 0) craft_skin_hat(); else if (selection == 1) craft_skin_gloves(); else if (selection == 2) craft_skin_pants(); @@ -88,6 +91,7 @@ void run_clothing_menu() { } if (key_pressed(KEY_TAB)) { + play_menu_select_sound(); if (selection == 0) craft_skin_hat_max(); else if (selection == 1) craft_skin_gloves_max(); else if (selection == 2) craft_skin_pants_max(); diff --git a/src/crafting/craft_materials.nvgt b/src/crafting/craft_materials.nvgt index 11e8b11..bdaa57d 100644 --- a/src/crafting/craft_materials.nvgt +++ b/src/crafting/craft_materials.nvgt @@ -20,18 +20,21 @@ void run_materials_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); if (selection == 0) butcher_small_game(); else if (selection == 1) craft_smoke_fish(); else if (selection == 2) craft_arrows(); @@ -41,6 +44,7 @@ void run_materials_menu() { } if (key_pressed(KEY_TAB)) { + play_menu_select_sound(); if (selection == 0) butcher_small_game_max(); else if (selection == 1) craft_smoke_fish_max(); else if (selection == 2) craft_arrows_max(); diff --git a/src/crafting/craft_runes.nvgt b/src/crafting/craft_runes.nvgt index 85765bf..c7d0705 100644 --- a/src/crafting/craft_runes.nvgt +++ b/src/crafting/craft_runes.nvgt @@ -105,18 +105,21 @@ void run_runes_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= int(rune_options.length())) selection = 0; speak_with_history(rune_options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(rune_options.length()) - 1; speak_with_history(rune_options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); int rune_type = rune_types[selection]; run_rune_equipment_menu(rune_type); break; @@ -158,24 +161,28 @@ void run_rune_equipment_menu(int rune_type) { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= int(equipment_options.length())) selection = 0; speak_with_history(equipment_options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(equipment_options.length()) - 1; speak_with_history(equipment_options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); int equip_type = equipment_types[selection]; engrave_rune(equip_type, rune_type); break; } if (key_pressed(KEY_TAB)) { + play_menu_select_sound(); int equip_type = equipment_types[selection]; engrave_rune_max(equip_type, rune_type); break; diff --git a/src/crafting/craft_tools.nvgt b/src/crafting/craft_tools.nvgt index 9cebe4f..66a96ab 100644 --- a/src/crafting/craft_tools.nvgt +++ b/src/crafting/craft_tools.nvgt @@ -24,18 +24,21 @@ void run_tools_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); if (selection == 0) craft_knife(); else if (selection == 1) craft_snare(); else if (selection == 2) craft_axe(); @@ -49,6 +52,7 @@ void run_tools_menu() { } if (key_pressed(KEY_TAB)) { + play_menu_select_sound(); if (selection == 0) craft_knife_max(); else if (selection == 1) craft_snare_max(); else if (selection == 2) craft_axe_max(); diff --git a/src/crafting/craft_weapons.nvgt b/src/crafting/craft_weapons.nvgt index 9fd7401..da6f8e6 100644 --- a/src/crafting/craft_weapons.nvgt +++ b/src/crafting/craft_weapons.nvgt @@ -18,18 +18,21 @@ void run_weapons_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); if (selection == 0) craft_spear(); else if (selection == 1) craft_sling(); else if (selection == 2) craft_bow(); @@ -37,6 +40,7 @@ void run_weapons_menu() { } if (key_pressed(KEY_TAB)) { + play_menu_select_sound(); if (selection == 0) craft_spear_max(); else if (selection == 1) craft_sling_max(); else if (selection == 2) craft_bow_max(); diff --git a/src/crafting/crafting_core.nvgt b/src/crafting/crafting_core.nvgt index e316e64..debeb59 100644 --- a/src/crafting/crafting_core.nvgt +++ b/src/crafting/crafting_core.nvgt @@ -45,18 +45,21 @@ void run_crafting_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= int(categories.length())) selection = 0; speak_with_history(categories[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(categories.length()) - 1; speak_with_history(categories[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); int category = category_types[selection]; if (category == 0) run_weapons_menu(); else if (category == 1) run_tools_menu(); diff --git a/src/fylgja_system.nvgt b/src/fylgja_system.nvgt index dd5aca7..11b5498 100644 --- a/src/fylgja_system.nvgt +++ b/src/fylgja_system.nvgt @@ -143,18 +143,21 @@ void run_fylgja_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= int(options.length())) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(options.length()) - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); int chosenIndex = fylgjaIndices[selection]; if (activate_fylgja(chosenIndex)) { lastFylgjaDay = current_day; diff --git a/src/menus/action_menu.nvgt b/src/menus/action_menu.nvgt index d88f00d..930b452 100644 --- a/src/menus/action_menu.nvgt +++ b/src/menus/action_menu.nvgt @@ -284,6 +284,7 @@ void run_action_menu(int x) { if (key_pressed(KEY_DOWN)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection++; if (selection >= int(filtered_options.length())) selection = 0; speak_with_history(filtered_options[selection], true); @@ -292,6 +293,7 @@ void run_action_menu(int x) { if (key_pressed(KEY_UP)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(filtered_options.length()) - 1; speak_with_history(filtered_options[selection], true); @@ -302,6 +304,7 @@ void run_action_menu(int x) { if (filtered_indices.length() == 0) { continue; } + play_menu_select_sound(); int action = action_types[filtered_indices[selection]]; if (action == 0) { try_place_snare(x); @@ -327,6 +330,7 @@ void run_action_menu(int x) { if (filtered_indices.length() == 0) { continue; } + play_menu_select_sound(); int action = action_types[filtered_indices[selection]]; if (action == 0) { speak_with_history("Can't do that.", true); diff --git a/src/menus/altar_menu.nvgt b/src/menus/altar_menu.nvgt index 1c9a69e..9407459 100644 --- a/src/menus/altar_menu.nvgt +++ b/src/menus/altar_menu.nvgt @@ -109,6 +109,7 @@ void run_altar_menu() { if (key_pressed(KEY_DOWN)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection++; if (selection >= int(filtered_options.length())) selection = 0; speak_with_history(filtered_options[selection], true); @@ -117,6 +118,7 @@ void run_altar_menu() { if (key_pressed(KEY_UP)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(filtered_options.length()) - 1; speak_with_history(filtered_options[selection], true); @@ -125,6 +127,7 @@ void run_altar_menu() { if (key_pressed(KEY_RETURN)) { if (filtered_indices.length() > 0) { + play_menu_select_sound(); sacrifice_item(item_types[filtered_indices[selection]]); build_personal_inventory_options(options, item_types); apply_menu_filter(filter_text, options, filtered_indices, filtered_options); @@ -139,6 +142,7 @@ void run_altar_menu() { if (key_pressed(KEY_TAB)) { if (filtered_indices.length() > 0) { + play_menu_select_sound(); sacrifice_item_max(item_types[filtered_indices[selection]]); build_personal_inventory_options(options, item_types); apply_menu_filter(filter_text, options, filtered_indices, filtered_options); diff --git a/src/menus/base_info.nvgt b/src/menus/base_info.nvgt index 07cc18e..b7210ef 100644 --- a/src/menus/base_info.nvgt +++ b/src/menus/base_info.nvgt @@ -77,6 +77,7 @@ void run_base_info_menu() { if (key_pressed(KEY_DOWN)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection++; if (selection >= int(filtered_options.length())) selection = 0; speak_with_history(filtered_options[selection], true); @@ -85,6 +86,7 @@ void run_base_info_menu() { if (key_pressed(KEY_UP)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(filtered_options.length()) - 1; speak_with_history(filtered_options[selection], true); diff --git a/src/menus/equipment_menu.nvgt b/src/menus/equipment_menu.nvgt index f4de707..580cd66 100644 --- a/src/menus/equipment_menu.nvgt +++ b/src/menus/equipment_menu.nvgt @@ -181,6 +181,7 @@ void run_equipment_menu() { if (key_pressed(KEY_DOWN)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection++; if (selection >= int(filtered_options.length())) selection = 0; speak_with_history(filtered_options[selection], true); @@ -189,6 +190,7 @@ void run_equipment_menu() { if (key_pressed(KEY_UP)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(filtered_options.length()) - 1; speak_with_history(filtered_options[selection], true); @@ -211,6 +213,7 @@ void run_equipment_menu() { if (filtered_indices.length() == 0) { continue; } + play_menu_select_sound(); int equip_type = equipment_types[filtered_indices[selection]]; int rune_type = rune_types[filtered_indices[selection]]; string name = get_full_equipment_name(equip_type, rune_type); diff --git a/src/menus/inventory_core.nvgt b/src/menus/inventory_core.nvgt index 7d72bc3..4ce3790 100644 --- a/src/menus/inventory_core.nvgt +++ b/src/menus/inventory_core.nvgt @@ -88,18 +88,21 @@ void run_inventory_root_menu() { } if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); if (selection == 0) run_inventory_menu(true); else run_storage_menu(); break; @@ -142,6 +145,7 @@ void run_inventory_menu(bool allow_deposit) { if (key_pressed(KEY_DOWN)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection++; if (selection >= int(filtered_options.length())) selection = 0; speak_with_history(filtered_options[selection], true); @@ -150,6 +154,7 @@ void run_inventory_menu(bool allow_deposit) { if (key_pressed(KEY_UP)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(filtered_options.length()) - 1; speak_with_history(filtered_options[selection], true); @@ -168,6 +173,7 @@ void run_inventory_menu(bool allow_deposit) { if (allow_deposit && key_pressed(KEY_RETURN)) { if (filtered_indices.length() > 0) { + play_menu_select_sound(); deposit_item(item_types[filtered_indices[selection]]); build_personal_inventory_options(options, item_types); apply_menu_filter(filter_text, options, filtered_indices, filtered_options); @@ -182,6 +188,7 @@ void run_inventory_menu(bool allow_deposit) { if (allow_deposit && key_pressed(KEY_TAB)) { if (filtered_indices.length() > 0) { + play_menu_select_sound(); deposit_item_max(item_types[filtered_indices[selection]]); build_personal_inventory_options(options, item_types); apply_menu_filter(filter_text, options, filtered_indices, filtered_options); diff --git a/src/menus/menu_utils.nvgt b/src/menus/menu_utils.nvgt index 1ba0e49..43bd85c 100644 --- a/src/menus/menu_utils.nvgt +++ b/src/menus/menu_utils.nvgt @@ -2,6 +2,9 @@ // Helper functions used across multiple menu systems void menu_background_tick() { + if (!menuBackgroundUpdatesEnabled) { + return; + } // Keep this list in sync with the main game loop to avoid pausing ambience/weather/time. update_time(); update_crossfade(); @@ -49,6 +52,18 @@ void menu_background_tick() { } } +void play_menu_move_sound() { + string soundFile = "sounds/menu/menu_move.ogg"; + if (!file_exists(soundFile)) return; + p.play_stationary(soundFile, false); +} + +void play_menu_select_sound() { + string soundFile = "sounds/menu/menu_select.ogg"; + if (!file_exists(soundFile)) return; + p.play_stationary(soundFile, false); +} + string join_string_list(const string[]@ items) { if (@items == null || items.length() == 0) return ""; string result = items[0]; diff --git a/src/menus/storage_menu.nvgt b/src/menus/storage_menu.nvgt index c6cdae3..e5b783d 100644 --- a/src/menus/storage_menu.nvgt +++ b/src/menus/storage_menu.nvgt @@ -326,6 +326,7 @@ void run_storage_menu() { if (key_pressed(KEY_DOWN)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection++; if (selection >= int(filtered_options.length())) selection = 0; speak_with_history(filtered_options[selection], true); @@ -334,6 +335,7 @@ void run_storage_menu() { if (key_pressed(KEY_UP)) { if (filtered_options.length() > 0) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(filtered_options.length()) - 1; speak_with_history(filtered_options[selection], true); @@ -342,6 +344,7 @@ void run_storage_menu() { if (key_pressed(KEY_RETURN)) { if (filtered_indices.length() > 0) { + play_menu_select_sound(); withdraw_item(item_types[filtered_indices[selection]]); build_storage_inventory_options(options, item_types); apply_menu_filter(filter_text, options, filtered_indices, filtered_options); @@ -356,6 +359,7 @@ void run_storage_menu() { if (key_pressed(KEY_TAB)) { if (filtered_indices.length() > 0) { + play_menu_select_sound(); withdraw_item_max(item_types[filtered_indices[selection]]); build_storage_inventory_options(options, item_types); apply_menu_filter(filter_text, options, filtered_indices, filtered_options); diff --git a/src/player.nvgt b/src/player.nvgt index 39cb93c..2309593 100644 --- a/src/player.nvgt +++ b/src/player.nvgt @@ -95,6 +95,7 @@ int last_adventure_day = -1; // Pause state bool game_paused = false; +bool menuBackgroundUpdatesEnabled = true; // Restart all game timers when resuming from pause // Prevents time from accumulating while paused diff --git a/src/quest_system.nvgt b/src/quest_system.nvgt index d07e983..c06f436 100644 --- a/src/quest_system.nvgt +++ b/src/quest_system.nvgt @@ -187,6 +187,7 @@ void run_quest_menu() { string count_str = " " + (selection + 1) + " of " + options.length(); if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; count_str = " " + (selection + 1) + " of " + options.length(); @@ -194,6 +195,7 @@ void run_quest_menu() { } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; count_str = " " + (selection + 1) + " of " + options.length(); @@ -201,6 +203,7 @@ void run_quest_menu() { } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); int quest_type = quest_queue[selection]; quest_queue.remove_at(selection); run_quest(quest_type); diff --git a/src/save_system.nvgt b/src/save_system.nvgt index 1df9555..a00b7f7 100644 --- a/src/save_system.nvgt +++ b/src/save_system.nvgt @@ -362,16 +362,19 @@ bool select_player_sex(int &out sex) { while (true) { wait(5); if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(prompt + " " + options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = options.length() - 1; speak_with_history(prompt + " " + options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); sex = (selection == 1) ? SEX_FEMALE : SEX_MALE; return true; } @@ -435,16 +438,19 @@ bool select_save_file(string &out filename) { while (true) { wait(5); if (key_pressed(KEY_DOWN)) { + play_menu_move_sound(); selection++; if (selection >= options.length()) selection = 0; speak_with_history(options[selection], true); } if (key_pressed(KEY_UP)) { + play_menu_move_sound(); selection--; if (selection < 0) selection = int(options.length()) - 1; speak_with_history(options[selection], true); } if (key_pressed(KEY_RETURN)) { + play_menu_select_sound(); filename = files[selection]; return true; }