1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

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
This commit is contained in:
red-001 2017-05-11 09:39:37 +01:00 committed by Loïc Blot
parent 441740e021
commit 0e0c824ea7
2 changed files with 78 additions and 12 deletions

View file

@ -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.
*