Add >[statement] support

- Adds a regex to detect >[statement]
- Also puts titles on a new line like AA
This commit is contained in:
MangosArentLiterature 2021-04-13 17:43:23 -05:00
parent 0a001141cf
commit 2a08f96386

View File

@ -631,7 +631,7 @@ AOPacket AOClient::validateIcPacket(AOPacket packet)
//Testimony playback //Testimony playback
if (area->test_rec == AreaData::TestimonyRecording::RECORDING || area->test_rec == AreaData::TestimonyRecording::ADD) { if (area->test_rec == AreaData::TestimonyRecording::RECORDING || area->test_rec == AreaData::TestimonyRecording::ADD) {
if (area->statement == 0) { if (area->statement == 0) {
args[4] = "~~-- " + args[4] + " --"; args[4] = "~~\\n-- " + args[4] + " --";
args[14] = "3"; args[14] = "3";
server->broadcast(AOPacket("RT",{"testimony1"}), current_area); server->broadcast(AOPacket("RT",{"testimony1"}), current_area);
} }
@ -649,7 +649,12 @@ AOPacket AOClient::validateIcPacket(AOPacket packet)
area->statement = area->statement - 1; area->statement = area->statement - 1;
args = playTestimony(); args = playTestimony();
} }
QRegularExpression jump("(?<arrow>>)(?<int>[0,1,2,3,4,5,6,7,8,9]+)");
QRegularExpressionMatch match = jump.match(args[4]);
if (match.hasMatch()) {
area->statement = match.captured("int").toInt();
args= playTestimony();
}
} }
return AOPacket("MS", args); return AOPacket("MS", args);