1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
#include "KingSystem/Sound/sndInfoData.h"
#include "KingSystem/Resource/resLoadRequest.h"
#include "KingSystem/Utils/Byaml/Byaml.h"
namespace ksys::snd {
SEAD_SINGLETON_DISPOSER_IMPL(InfoData)
InfoData::~InfoData() {
if (mRootIter)
delete mRootIter;
}
void InfoData::loadSoundInfo(sead::Heap* heap) {
res::LoadRequest req;
req.mRequester = "snd::InfoData";
req._22 = true;
mResHandle.load("Actor/Sound/SoundInfo.byml", &req);
auto* resource = sead::DynamicCast<sead::DirectResource>(mResHandle.getResource());
if (mRootIter)
delete mRootIter;
mRootIter = new (heap) al::ByamlIter(resource->getRawData());
}
void InfoData::init(sead::Heap* heap) {
loadSoundInfo(heap);
}
al::ByamlIter InfoData::getInfo(const sead::SafeString& key) const {
const auto iter = mRootIter->getIterByKey(key.cstr());
return al::ByamlIter(iter);
}
sead::SafeString InfoData::getSoundSettingUserName(const sead::SafeString& key) const {
const auto iter = getInfo(key);
const char* name = "Dummy";
iter.tryGetStringByKey(&name, "SoundSettingUserName");
return name;
}
sead::SafeString InfoData::getReactionSettingLandType(const al::ByamlIter& iter,
const sead::SafeString& key) const {
const char* value = "Auto";
iter.tryGetStringByKey(&value, "ReactionSettingLandType");
return value;
}
float InfoData::getReactionSettingLandPitch(const al::ByamlIter& iter) const {
float value = 1.0;
iter.tryGetFloatByKey(&value, "ReactionSettingLandPitch");
return value;
}
float InfoData::getReactionSettingLandVolume(const al::ByamlIter& iter) const {
float value = 1.0;
iter.tryGetFloatByKey(&value, "ReactionSettingLandVolume");
return value;
}
float InfoData::getReactionSettingLandVelocityRatio(const al::ByamlIter& iter) const {
float value = 1.0;
iter.tryGetFloatByKey(&value, "ReactionSettingLandVelocityRadio");
return value;
}
sead::SafeString InfoData::getReactionSettingSlideType(const al::ByamlIter& iter) const {
const char* value = "Auto";
iter.tryGetStringByKey(&value, "ReactionSettingSlideType");
return value;
}
sead::SafeString InfoData::getReactionSettingSlideSlideType(const al::ByamlIter& iter) const {
const char* value = "Drag";
iter.tryGetStringByKey(&value, "ReactionSettingSlideSlideType");
return value;
}
float InfoData::getReactionSettingSlidePitch(const al::ByamlIter& iter) const {
float value = 1.0;
iter.tryGetFloatByKey(&value, "ReactionSettingSlidePitch");
return value;
}
float InfoData::getReactionSettingSlideVolume(const al::ByamlIter& iter) const {
float value = 1.0;
iter.tryGetFloatByKey(&value, "ReactionSettingSlideVolume");
return value;
}
float InfoData::getReactionSettingSlideVelocityRatio(const al::ByamlIter& iter) const {
float value = 1.0;
iter.tryGetFloatByKey(&value, "ReactionSettingSlideVelocityRatio");
return value;
}
sead::SafeString InfoData::getWeaponOwnerSettingOwnerType(const al::ByamlIter& iter) const {
const char* value = "None";
iter.tryGetStringByKey(&value, "WeaponOwnerSettingOwnerType");
return value;
}
sead::SafeString InfoData::getEquipSoundSettingEquipMaterial(const al::ByamlIter& iter) const {
const char* value = "Dummy";
iter.tryGetStringByKey(&value, "EquipSoundSettingEquipMaterial");
return value;
}
bool InfoData::getMiscInDoorOcclusion(const al::ByamlIter& iter) const {
bool value = true;
iter.tryGetBoolByKey(&value, "MiscInDoorOcclusion");
return value;
}
sead::SafeString InfoData::getMiscPlantShakeType(const al::ByamlIter& iter) const {
const char* value = "None";
iter.tryGetStringByKey(&value, "MiscPlantShakeType");
return value;
}
} // namespace ksys::snd
|