diff options
author | Wuzzy <wuzzy2@mail.ru> | 2021-06-24 18:21:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 21:21:19 +0300 |
commit | 63fc728a84a5ba97240233ad1c5d94f1ade2deb1 (patch) | |
tree | 61829a140b98519fbfa7920d79495e0c0692ad1b /src/client/gameui.cpp | |
parent | 51bf4a6e26f9eca461ae88181b06b517afc4d656 (diff) | |
download | dragonfireclient-63fc728a84a5ba97240233ad1c5d94f1ade2deb1.tar.xz |
Require 'basic_debug' priv to view gameplay-relevant debug info, require 'debug' priv to view wireframe (#9315)
Fixes #7245.
Diffstat (limited to 'src/client/gameui.cpp')
-rw-r--r-- | src/client/gameui.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/client/gameui.cpp b/src/client/gameui.cpp index ebc6b108c..323967550 100644 --- a/src/client/gameui.cpp +++ b/src/client/gameui.cpp @@ -99,7 +99,8 @@ void GameUI::update(const RunStats &stats, Client *client, MapDrawControl *draw_ { v2u32 screensize = RenderingEngine::getWindowSize(); - if (m_flags.show_debug) { + // Minimal debug text must only contain info that can't give a gameplay advantage + if (m_flags.show_minimal_debug) { static float drawtime_avg = 0; drawtime_avg = drawtime_avg * 0.95 + stats.drawtime * 0.05; u16 fps = 1.0 / stats.dtime_jitter.avg; @@ -125,9 +126,10 @@ void GameUI::update(const RunStats &stats, Client *client, MapDrawControl *draw_ } // Finally set the guitext visible depending on the flag - m_guitext->setVisible(m_flags.show_debug); + m_guitext->setVisible(m_flags.show_minimal_debug); - if (m_flags.show_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(); @@ -160,7 +162,7 @@ void GameUI::update(const RunStats &stats, Client *client, MapDrawControl *draw_ )); } - m_guitext2->setVisible(m_flags.show_debug); + 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); @@ -204,7 +206,8 @@ void GameUI::update(const RunStats &stats, Client *client, MapDrawControl *draw_ void GameUI::initFlags() { m_flags = GameUI::Flags(); - m_flags.show_debug = g_settings->getBool("show_debug"); + m_flags.show_minimal_debug = g_settings->getBool("show_debug"); + m_flags.show_basic_debug = false; } void GameUI::showMinimap(bool show) @@ -225,8 +228,10 @@ void GameUI::setChatText(const EnrichedString &chat_text, u32 recent_chat_count) // Update gui element size and position s32 chat_y = 5; - if (m_flags.show_debug) - chat_y += 2 * g_fontengine->getLineHeight(); + if (m_flags.show_minimal_debug) + chat_y += g_fontengine->getLineHeight(); + if (m_flags.show_basic_debug) + chat_y += g_fontengine->getLineHeight(); const v2u32 &window_size = RenderingEngine::getWindowSize(); |