Merge branch 'main' into update-items
This commit is contained in:
commit
2908009e92
@ -226,6 +226,7 @@ void AssetsLoader::addDefaults(AssetsLoader& loader, const Content* content) {
|
|||||||
loader.tryAddSound(material.stepsSound);
|
loader.tryAddSound(material.stepsSound);
|
||||||
loader.tryAddSound(material.placeSound);
|
loader.tryAddSound(material.placeSound);
|
||||||
loader.tryAddSound(material.breakSound);
|
loader.tryAddSound(material.breakSound);
|
||||||
|
loader.tryAddSound(material.hitSound);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& entry : content->getPacks()) {
|
for (auto& entry : content->getPacks()) {
|
||||||
|
|||||||
@ -587,6 +587,10 @@ void ContentLoader::loadBlockMaterial(
|
|||||||
root.at("steps-sound").get(def.stepsSound);
|
root.at("steps-sound").get(def.stepsSound);
|
||||||
root.at("place-sound").get(def.placeSound);
|
root.at("place-sound").get(def.placeSound);
|
||||||
root.at("break-sound").get(def.breakSound);
|
root.at("break-sound").get(def.breakSound);
|
||||||
|
root.at("hit-sound").get(def.hitSound);
|
||||||
|
if (def.hitSound.empty()) {
|
||||||
|
def.hitSound = def.stepsSound;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentLoader::loadContent(const dv::value& root) {
|
void ContentLoader::loadContent(const dv::value& root) {
|
||||||
|
|||||||
@ -13,7 +13,8 @@ dv::value BlockMaterial::serialize() const {
|
|||||||
{"name", name},
|
{"name", name},
|
||||||
{"stepsSound", stepsSound},
|
{"stepsSound", stepsSound},
|
||||||
{"placeSound", placeSound},
|
{"placeSound", placeSound},
|
||||||
{"breakSound", breakSound}
|
{"breakSound", breakSound},
|
||||||
|
{"hitSound", hitSound}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -109,9 +109,10 @@ using BoxModel = AABB;
|
|||||||
/// @brief Common kit of block properties applied to groups of blocks
|
/// @brief Common kit of block properties applied to groups of blocks
|
||||||
struct BlockMaterial {
|
struct BlockMaterial {
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string stepsSound {""};
|
std::string stepsSound;
|
||||||
std::string placeSound {""};
|
std::string placeSound;
|
||||||
std::string breakSound {""};
|
std::string breakSound;
|
||||||
|
std::string hitSound;
|
||||||
|
|
||||||
dv::value serialize() const;
|
dv::value serialize() const;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user