[Dialogue] Add hidden response support. (#1583)

Allows operators to hide responses.
Syntax is `hiddenresponse`.
This commit is contained in:
Kinglykrab 2021-10-03 13:06:39 -04:00 committed by GitHub
parent 3a76d9a28e
commit ccab07bd66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,13 @@ void DialogueWindow::Render(Client *c, std::string markdown)
find_replace(output, "nobracket", ""); find_replace(output, "nobracket", "");
} }
bool render_hiddenresponse = false;
if (markdown.find("hiddenresponse") != std::string::npos) {
render_hiddenresponse = true;
LogDiaWind("Client [{}] Rendering hiddenresponse", c->GetCleanName());
find_replace(output, "hiddenresponse", "");
}
// animations // animations
std::string animation = get_between(output, "+", "+"); std::string animation = get_between(output, "+", "+");
if (!animation.empty()) { if (!animation.empty()) {
@ -504,6 +511,9 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// build the final output string // build the final output string
std::string final_output; std::string final_output;
final_output = fmt::format("{}{}{} <br><br> {}", quote_string, output, quote_string, click_response); final_output = fmt::format("{}{}{} <br><br> {}", quote_string, output, quote_string, click_response);
if (render_hiddenresponse) {
final_output = fmt::format("{}{}{}", quote_string, output, quote_string);
}
// send popup // send popup
c->SendFullPopup( c->SendFullPopup(