mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
21079cc8eb
commit
48939df9a5
8 changed files with 105 additions and 83 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue