+
+ // Finally set the guitext visible depending on the flag
+ m_guitext->setVisible(m_flags.show_minimal_debug);
+
+ // Basic debug text also shows info that might give a gameplay advantage
+ if (m_flags.show_basic_debug) {
+ LocalPlayer *player = client->getEnv().getLocalPlayer();
+ v3f player_position = player->getPosition();
+
+ std::ostringstream os(std::ios_base::binary);
+ os << std::setprecision(1) << std::fixed
+ << "pos: (" << (player_position.X / BS)
+ << ", " << (player_position.Y / BS)
+ << ", " << (player_position.Z / BS)
+ << ") | yaw: " << (wrapDegrees_0_360(cam.camera_yaw)) << "° "
+ << yawToDirectionString(cam.camera_yaw)
+ << " | pitch: " << (-wrapDegrees_180(cam.camera_pitch)) << "°"
+ << " | seed: " << ((u64)client->getMapSeed());
+
+ if (pointed_old.type == POINTEDTHING_NODE) {
+ ClientMap &map = client->getEnv().getClientMap();
+ const NodeDefManager *nodedef = client->getNodeDefManager();
+ MapNode n = map.getNode(pointed_old.node_undersurface);
+
+ if (n.getContent() != CONTENT_IGNORE && nodedef->get(n).name != "unknown") {
+ os << ", pointed: " << nodedef->get(n).name
+ << ", param2: " << (u64) n.getParam2();
+ }
+ }
+
+ setStaticText(m_guitext2, utf8_to_wide(os.str()).c_str());
+
+ m_guitext2->setRelativePosition(core::rect<s32>(5,
+ 5 + g_fontengine->getTextHeight(), screensize.X,
+ 5 + g_fontengine->getTextHeight() * 2
+ ));
+ }
+
+ m_guitext2->setVisible(m_flags.show_basic_debug);
+
+ setStaticText(m_guitext_info, m_infotext.c_str());
+ m_guitext_info->setVisible(m_flags.show_hud && g_menumgr.menuCount() == 0);
+
+ static const float statustext_time_max = 1.5f;
+
+ if (!m_statustext.empty()) {
+ m_statustext_time += dtime;
+
+ if (m_statustext_time >= statustext_time_max) {
+ clearStatusText();
+ m_statustext_time = 0.0f;
+ }
+ }
+
+ setStaticText(m_guitext_status, m_statustext.c_str());
+ m_guitext_status->setVisible(!m_statustext.empty());
+
+ if (!m_statustext.empty()) {
+ s32 status_width = m_guitext_status->getTextWidth();
+ s32 status_height = m_guitext_status->getTextHeight();
+ s32 status_y = screensize.Y - 150;
+ s32 status_x = (screensize.X - status_width) / 2;
+
+ m_guitext_status->setRelativePosition(core::rect<s32>(status_x ,
+ status_y - status_height, status_x + status_width, status_y));
+
+ // Fade out
+ video::SColor final_color = m_statustext_initial_color;
+ final_color.setAlpha(0);
+ video::SColor fade_color = m_statustext_initial_color.getInterpolated_quadratic(
+ m_statustext_initial_color, final_color, m_statustext_time / statustext_time_max);
+ m_guitext_status->setOverrideColor(fade_color);
+ m_guitext_status->enableOverrideColor(true);
+ }
+
+ // Hide chat when console is visible
+ m_guitext_chat->setVisible(isChatVisible() && !chat_console->isVisible());