fix: Companion wasn't reading/writing Haptic SF values correctly (#1571)
This commit is contained in:
@@ -157,6 +157,9 @@ Node convert<CustomFunctionData>::encode(const CustomFunctionData& rhs)
|
|||||||
case FuncPlaySound:
|
case FuncPlaySound:
|
||||||
def += LookupValue(soundLut, rhs.param);
|
def += LookupValue(soundLut, rhs.param);
|
||||||
break;
|
break;
|
||||||
|
case FuncPlayHaptic:
|
||||||
|
def += std::to_string(rhs.param);
|
||||||
|
break;
|
||||||
case FuncPlayPrompt:
|
case FuncPlayPrompt:
|
||||||
case FuncPlayScript:
|
case FuncPlayScript:
|
||||||
case FuncBackgroundMusic:
|
case FuncBackgroundMusic:
|
||||||
@@ -266,6 +269,13 @@ bool convert<CustomFunctionData>::decode(const Node& node,
|
|||||||
getline(def, snd, ',');
|
getline(def, snd, ',');
|
||||||
Node(snd) >> soundLut >> rhs.param;
|
Node(snd) >> soundLut >> rhs.param;
|
||||||
} break;
|
} break;
|
||||||
|
case FuncPlayHaptic: {
|
||||||
|
std::string haptic;
|
||||||
|
getline(def, haptic, ',');
|
||||||
|
try {
|
||||||
|
rhs.param = std::stoi(haptic);
|
||||||
|
} catch(...) {}
|
||||||
|
} break;
|
||||||
case FuncPlayPrompt:
|
case FuncPlayPrompt:
|
||||||
case FuncPlayScript:
|
case FuncPlayScript:
|
||||||
case FuncBackgroundMusic: {
|
case FuncBackgroundMusic: {
|
||||||
|
|||||||
Reference in New Issue
Block a user