summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorEkdohibs <nathanael.courant@laposte.net>2016-04-04 18:31:00 +0200
committerCraig Robbins <kde.psych@gmail.com>2016-04-24 03:54:11 +1000
commit48939df9a5ef1ff20f4f9717d1341b51a50dff14 (patch)
tree7325a70d4dbe445d4e3726f0aea402f3181906b4 /src/game.cpp
parent21079cc8ebae0bf694c1903c07bf3e1517feab99 (diff)
downloadminetest-48939df9a5ef1ff20f4f9717d1341b51a50dff14.tar.gz
minetest-48939df9a5ef1ff20f4f9717d1341b51a50dff14.tar.bz2
minetest-48939df9a5ef1ff20f4f9717d1341b51a50dff14.zip
Escape more strings: formspecs, item descriptions, infotexts...
Also, change the escape character to the more standard \x1b Thus, it can be used in the future for translation or colored text, for example.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index d513517b7..23f261cfd 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3731,7 +3731,7 @@ void Game::handlePointingAtNode(GameRunData *runData,
NodeMetadata *meta = map.getNodeMetadata(nodepos);
if (meta) {
- infotext = utf8_to_wide(meta->getString("infotext"));
+ infotext = unescape_enriched(utf8_to_wide(meta->getString("infotext")));
} else {
MapNode n = map.getNodeNoEx(nodepos);
@@ -3807,13 +3807,15 @@ void Game::handlePointingAtObject(GameRunData *runData,
const v3f &player_position,
bool show_debug)
{
- infotext = utf8_to_wide(runData->selected_object->infoText());
+ infotext = unescape_enriched(
+ utf8_to_wide(runData->selected_object->infoText()));
if (show_debug) {
if (infotext != L"") {
infotext += L"\n";
}
- infotext += utf8_to_wide(runData->selected_object->debugInfoText());
+ infotext += unescape_enriched(utf8_to_wide(
+ runData->selected_object->debugInfoText()));
}
if (input->getLeftState()) {