1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Use ResourcePath for audio files

This commit is contained in:
Ivan Savenko
2023-09-04 13:03:15 +03:00
parent 97b7d44c88
commit 8dfdfffd87
59 changed files with 195 additions and 192 deletions

View File

@@ -83,13 +83,13 @@ void AObjectTypeHandler::init(const JsonNode & input)
}
for(const JsonNode & node : input["sounds"]["ambient"].Vector())
sounds.ambient.push_back(node.String());
sounds.ambient.push_back(AudioPath::fromJson(node));
for(const JsonNode & node : input["sounds"]["visit"].Vector())
sounds.visit.push_back(node.String());
sounds.visit.push_back(AudioPath::fromJson(node));
for(const JsonNode & node : input["sounds"]["removal"].Vector())
sounds.removal.push_back(node.String());
sounds.removal.push_back(AudioPath::fromJson(node));
if(input["aiValue"].isNull())
aiValue = std::nullopt;

View File

@@ -9,13 +9,15 @@
*/
#pragma once
#include "../filesystem/ResourcePath.h"
VCMI_LIB_NAMESPACE_BEGIN
struct SObjectSounds
{
std::vector<std::string> ambient;
std::vector<std::string> visit;
std::vector<std::string> removal;
std::vector<AudioPath> ambient;
std::vector<AudioPath> visit;
std::vector<AudioPath> removal;
template <typename Handler> void serialize(Handler &h, const int version)
{