Skip to content

Commit

Permalink
thcrap_tasofro: add support for pauses in th155 endings
Browse files Browse the repository at this point in the history
More of a hack than a real solution, but that will do.
  • Loading branch information
brliron committed Dec 17, 2024
1 parent aeb9155 commit dd1528d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions thcrap_tasofro/src/pl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,15 @@ void TasofroPl::EndingText::_patchLine(std::string& text, std::list<ALine*>&, co
text.erase(break_pos, 2);
}
}
if (game_id == TH155) {
// In th155 endings, pauses only work when they are at the end of a line.
// So we must split the line into 2 if we want to insert a pause.
size_t break_pos = 0;
while ((break_pos = text.find("@\\n", break_pos)) != std::string::npos) {
text.replace(break_pos, 3, "@\n");
break_pos += 2;
}
}
this->fields[0] += text;
}

Expand Down

0 comments on commit dd1528d

Please sign in to comment.