From 0e0c824ea75a812a99c7d329c3a4862d6beadf3b Mon Sep 17 00:00:00 2001 From: red-001 Date: Thu, 11 May 2017 09:39:37 +0100 Subject: Rework escape/pause menu (#5719) * Rework escape/pause menu - Remove build information - Use current controls instead of default controls - Add information about the current server in place of the build information - Add text saying the game is paused to if in singleplayer mode. rework pause/escape menu * improve consistency + display server_name --- src/util/string.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/util') diff --git a/src/util/string.h b/src/util/string.h index 632dd4d7e..cc278da13 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -422,6 +422,18 @@ inline void str_replace(std::string &str, const std::string &pattern, } } +/** + * Escapes characters [ ] \ , ; that can not be used in formspecs + */ +inline void str_formspec_escape(std::string &str) +{ + str_replace(str, "\\", "\\\\"); + str_replace(str, "]", "\\]"); + str_replace(str, "[", "\\["); + str_replace(str, ";", "\\;"); + str_replace(str, ",", "\\,"); +} + /** * Replace all occurrences of the character \p from in \p str with \p to. * -- cgit v1.2.3