Skip to content

Commit 63e8224

Browse files
authoredAug 23, 2021
Fix 6th line of infotext being cut off in half (#11456)
1 parent eea488e commit 63e8224

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed
 

Diff for: ‎doc/lua_api.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2100,7 +2100,9 @@ Some of the values in the key-value store are handled specially:
21002100
* `formspec`: Defines an inventory menu that is opened with the
21012101
'place/use' key. Only works if no `on_rightclick` was
21022102
defined for the node. See also [Formspec].
2103-
* `infotext`: Text shown on the screen when the node is pointed at
2103+
* `infotext`: Text shown on the screen when the node is pointed at.
2104+
Line-breaks will be applied automatically.
2105+
If the infotext is very long, it will be truncated.
21042106

21052107
Example:
21062108

@@ -7189,7 +7191,7 @@ Player properties need to be saved manually.
71897191
-- Default: false
71907192

71917193
infotext = "",
7192-
-- By default empty, text to be shown when pointed at object
7194+
-- Same as infotext for nodes. Empty by default
71937195

71947196
static_save = true,
71957197
-- If false, never save this object statically. It will simply be

Diff for: ‎src/client/gameui.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,14 @@ void GameUI::init()
7171
chat_font_size, FM_Unspecified));
7272
}
7373

74-
// At the middle of the screen
75-
// Object infos are shown in this
74+
75+
// Infotext of nodes and objects.
76+
// If in debug mode, object debug infos shown here, too.
77+
// Located on the left on the screen, below chat.
7678
u32 chat_font_height = m_guitext_chat->getActiveFont()->getDimension(L"Ay").Height;
7779
m_guitext_info = gui::StaticText::add(guienv, L"",
78-
core::rect<s32>(0, 0, 400, g_fontengine->getTextHeight() * 5 + 5) +
80+
// Size is limited; text will be truncated after 6 lines.
81+
core::rect<s32>(0, 0, 400, g_fontengine->getTextHeight() * 6) +
7982
v2s32(100, chat_font_height *
8083
(g_settings->getU16("recent_chat_messages") + 3)),
8184
false, true, guiroot);

0 commit comments

Comments
 (0)
Please sign in to comment.