mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Add playMinimapPing() to UiSoundManager with MapPing.wav (falls back to target select sound). Play the ping sound in MSG_MINIMAP_PING handler when the sender is not the local player. Provides audio feedback for party member map pings, matching WoW behavior.
144 lines
3.6 KiB
C++
144 lines
3.6 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <cstdint>
|
|
|
|
namespace wowee {
|
|
namespace pipeline {
|
|
class AssetManager;
|
|
}
|
|
|
|
namespace audio {
|
|
|
|
class UiSoundManager {
|
|
public:
|
|
UiSoundManager() = default;
|
|
~UiSoundManager() = default;
|
|
|
|
// Initialization
|
|
bool initialize(pipeline::AssetManager* assets);
|
|
void shutdown();
|
|
|
|
// Volume control
|
|
void setVolumeScale(float scale);
|
|
float getVolumeScale() const { return volumeScale_; }
|
|
|
|
// Window sounds
|
|
void playBagOpen();
|
|
void playBagClose();
|
|
void playQuestLogOpen();
|
|
void playQuestLogClose();
|
|
void playCharacterSheetOpen();
|
|
void playCharacterSheetClose();
|
|
void playAuctionHouseOpen();
|
|
void playAuctionHouseClose();
|
|
void playGuildBankOpen();
|
|
void playGuildBankClose();
|
|
|
|
// Button sounds
|
|
void playButtonClick();
|
|
void playMenuButtonClick();
|
|
|
|
// Quest sounds
|
|
void playQuestActivate();
|
|
void playQuestComplete();
|
|
void playQuestFailed();
|
|
void playQuestUpdate();
|
|
|
|
// Loot sounds
|
|
void playLootCoinSmall();
|
|
void playLootCoinLarge();
|
|
void playLootItem();
|
|
|
|
// Item sounds
|
|
void playDropOnGround();
|
|
void playPickupBag();
|
|
void playPickupBook();
|
|
void playPickupCloth();
|
|
void playPickupFood();
|
|
void playPickupGem();
|
|
|
|
// Eating/drinking
|
|
void playEating();
|
|
void playDrinking();
|
|
|
|
// Level up
|
|
void playLevelUp();
|
|
|
|
// Achievement
|
|
void playAchievementAlert();
|
|
|
|
// Error/feedback
|
|
void playError();
|
|
void playTargetSelect();
|
|
void playTargetDeselect();
|
|
|
|
// Chat notifications
|
|
void playWhisperReceived();
|
|
|
|
// Minimap ping
|
|
void playMinimapPing();
|
|
|
|
private:
|
|
struct UISample {
|
|
std::string path;
|
|
std::vector<uint8_t> data;
|
|
bool loaded;
|
|
};
|
|
|
|
// Sound libraries
|
|
std::vector<UISample> bagOpenSounds_;
|
|
std::vector<UISample> bagCloseSounds_;
|
|
std::vector<UISample> questLogOpenSounds_;
|
|
std::vector<UISample> questLogCloseSounds_;
|
|
std::vector<UISample> characterSheetOpenSounds_;
|
|
std::vector<UISample> characterSheetCloseSounds_;
|
|
std::vector<UISample> auctionOpenSounds_;
|
|
std::vector<UISample> auctionCloseSounds_;
|
|
std::vector<UISample> guildBankOpenSounds_;
|
|
std::vector<UISample> guildBankCloseSounds_;
|
|
|
|
std::vector<UISample> buttonClickSounds_;
|
|
std::vector<UISample> menuButtonSounds_;
|
|
|
|
std::vector<UISample> questActivateSounds_;
|
|
std::vector<UISample> questCompleteSounds_;
|
|
std::vector<UISample> questFailedSounds_;
|
|
std::vector<UISample> questUpdateSounds_;
|
|
|
|
std::vector<UISample> lootCoinSmallSounds_;
|
|
std::vector<UISample> lootCoinLargeSounds_;
|
|
std::vector<UISample> lootItemSounds_;
|
|
|
|
std::vector<UISample> dropSounds_;
|
|
std::vector<UISample> pickupBagSounds_;
|
|
std::vector<UISample> pickupBookSounds_;
|
|
std::vector<UISample> pickupClothSounds_;
|
|
std::vector<UISample> pickupFoodSounds_;
|
|
std::vector<UISample> pickupGemSounds_;
|
|
|
|
std::vector<UISample> eatingSounds_;
|
|
std::vector<UISample> drinkingSounds_;
|
|
|
|
std::vector<UISample> levelUpSounds_;
|
|
std::vector<UISample> achievementSounds_;
|
|
|
|
std::vector<UISample> errorSounds_;
|
|
std::vector<UISample> selectTargetSounds_;
|
|
std::vector<UISample> deselectTargetSounds_;
|
|
std::vector<UISample> whisperSounds_;
|
|
std::vector<UISample> minimapPingSounds_;
|
|
|
|
// State tracking
|
|
float volumeScale_ = 1.0f;
|
|
bool initialized_ = false;
|
|
|
|
// Helper methods
|
|
bool loadSound(const std::string& path, UISample& sample, pipeline::AssetManager* assets);
|
|
void playSound(const std::vector<UISample>& library);
|
|
};
|
|
|
|
} // namespace audio
|
|
} // namespace wowee
|