aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-09-22 18:38:33 +0200
committerGitHub <noreply@github.com>2020-09-22 18:38:33 +0200
commit55e2dd911b16a70ee976e067cf34a48922db9dcb (patch)
tree43b2f1041c7172f43f63a2b25e6b4a600c3e3c75 /src/client
parente7f33ee2f1c57b2b5c48d1a54a5f9e4c72a3275c (diff)
downloadminetest-55e2dd911b16a70ee976e067cf34a48922db9dcb.tar.gz
minetest-55e2dd911b16a70ee976e067cf34a48922db9dcb.tar.bz2
minetest-55e2dd911b16a70ee976e067cf34a48922db9dcb.zip
Fix chat/infotext overlap if many chat lines (#10399)
Moves the infotext depending on the value of the recent_chat_messages value + 2 additional lines to account for the 2 debug mode lines + 1 additional line as "buffer" for better readability if chat is full.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/gameui.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/client/gameui.cpp b/src/client/gameui.cpp
index 81c268e44..75e7d15b9 100644
--- a/src/client/gameui.cpp
+++ b/src/client/gameui.cpp
@@ -61,17 +61,6 @@ void GameUI::init()
m_guitext2 = gui::StaticText::add(guienv, L"", core::rect<s32>(0, 0, 0, 0), false,
false, guiroot);
- // At the middle of the screen
- // Object infos are shown in this
- m_guitext_info = gui::StaticText::add(guienv, L"",
- core::rect<s32>(0, 0, 400, g_fontengine->getTextHeight() * 5 + 5)
- + v2s32(100, 200), false, true, guiroot);
-
- // Status text (displays info when showing and hiding GUI stuff, etc.)
- m_guitext_status = gui::StaticText::add(guienv, L"<Status>",
- core::rect<s32>(0, 0, 0, 0), false, false, guiroot);
- m_guitext_status->setVisible(false);
-
// Chat text
m_guitext_chat = gui::StaticText::add(guienv, L"", core::rect<s32>(0, 0, 0, 0),
//false, false); // Disable word wrap as of now
@@ -82,6 +71,20 @@ void GameUI::init()
chat_font_size, FM_Unspecified));
}
+ // At the middle of the screen
+ // Object infos are shown in this
+ u32 chat_font_height = m_guitext_chat->getActiveFont()->getDimension(L"Ay").Height;
+ m_guitext_info = gui::StaticText::add(guienv, L"",
+ core::rect<s32>(0, 0, 400, g_fontengine->getTextHeight() * 5 + 5) +
+ v2s32(100, chat_font_height *
+ (g_settings->getU16("recent_chat_messages") + 3)),
+ false, true, guiroot);
+
+ // Status text (displays info when showing and hiding GUI stuff, etc.)
+ m_guitext_status = gui::StaticText::add(guienv, L"<Status>",
+ core::rect<s32>(0, 0, 0, 0), false, false, guiroot);
+ m_guitext_status->setVisible(false);
+
// Profiler text (size is updated when text is updated)
m_guitext_profiler = gui::StaticText::add(guienv, L"<Profiler>",
core::rect<s32>(0, 0, 0, 0), false, false, guiroot);