MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / loadKeeperVoices

Method loadKeeperVoices

source/utils/ConfigManager.cpp:1690–1717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1688}
1689
1690void ConfigManager::loadKeeperVoices(const std::string& soundPath)
1691{
1692 std::vector<std::string> directories;
1693 std::string parentPath = soundPath + "Relative";
1694 if(!Helper::fillDirList(parentPath, directories, false))
1695 {
1696 OD_LOG_ERR("Error while loading sounds in directory=" + parentPath);
1697 return;
1698 }
1699
1700 for(const std::string& directory : directories)
1701 {
1702 // We add the keeper voice
1703 OD_LOG_INF("Keeper voice found=" + directory);
1704 mKeeperVoices.push_back(directory);
1705 }
1706
1707 if(mKeeperVoices.empty())
1708 {
1709 OD_LOG_ERR("No keeper voice found. Relative sounds will not work");
1710 return;
1711 }
1712
1713 if(std::find(mKeeperVoices.begin(), mKeeperVoices.end(), ConfigManager::DEFAULT_KEEPER_VOICE) == mKeeperVoices.end())
1714 {
1715 OD_LOG_ERR("No default keeper voice found");
1716 }
1717}

Callers

nothing calls this directly

Calls 1

fillDirListFunction · 0.85

Tested by

no test coverage detected