Fix custom func logs and sounds list

This commit is contained in:
elecpower
2021-12-31 10:53:11 +01:00
committed by Raphael Coeffic
parent 7a526a1786
commit 340e7627d5
@@ -78,18 +78,18 @@ static const YamlLookupTable soundLut = {
{ 1, "Bp2" }, { 1, "Bp2" },
{ 2, "Bp3" }, { 2, "Bp3" },
{ 3, "Wrn1" }, { 3, "Wrn1" },
{ 5, "Wrn2" }, { 4, "Wrn2" },
{ 6, "Chee" }, { 5, "Chee" },
{ 7, "Rata" }, { 6, "Rata" },
{ 8, "Tick" }, { 7, "Tick" },
{ 9, "Sirn" }, { 8, "Sirn" },
{ 10, "Ring" }, { 9, "Ring" },
{ 11, "SciF" }, { 10, "SciF" },
{ 12, "Robt" }, { 11, "Robt" },
{ 13, "Chrp" }, { 12, "Chrp" },
{ 14, "Tada" }, { 13, "Tada" },
{ 15, "Crck" }, { 14, "Crck" },
{ 16, "Alrm" }, { 15, "Alrm" },
}; };
static const YamlLookupTable resetLut = { static const YamlLookupTable resetLut = {
@@ -193,6 +193,9 @@ Node convert<CustomFunctionData>::encode(const CustomFunctionData& rhs)
case FuncBindInternalModule: { case FuncBindInternalModule: {
def += LookupValue(moduleLut, p1); def += LookupValue(moduleLut, p1);
} break; } break;
case FuncLogs:
def += std::to_string(rhs.param);
break;
default: default:
break; break;
} }
@@ -310,6 +313,11 @@ bool convert<CustomFunctionData>::decode(const Node& node,
Node(mod) >> moduleLut >> module; Node(mod) >> moduleLut >> module;
rhs.func = (AssignFunc)((int)rhs.func + module); rhs.func = (AssignFunc)((int)rhs.func + module);
} break; } break;
case FuncLogs: {
int param = 0;
def >> param;
rhs.param = param;
} break;
default: default:
break; break;
} }