diff --git a/src/frontend/hud.cpp b/src/frontend/hud.cpp
index 8d50412f..0063fd46 100644
--- a/src/frontend/hud.cpp
+++ b/src/frontend/hud.cpp
@@ -194,11 +194,11 @@ Hud::Hud(Engine* engine, LevelFrontend* frontend, Player* player)
assets->store(Texture::from(debugImgWorldGen.get()), DEBUG_WORLDGEN_IMAGE);
- add(HudElement(hud_element_mode::permanent, nullptr,
- guiutil::create(
+ debugMinimap = guiutil::create(
""
- ), true));
+ );
+ add(HudElement(hud_element_mode::permanent, nullptr, debugMinimap, true));
}
Hud::~Hud() {
@@ -367,6 +367,7 @@ void Hud::update(bool visible) {
}
cleanup();
+ debugMinimap->setVisible(player->debug && showGeneratorMinimap);
if (player->debug && showGeneratorMinimap) {
updateWorldGenDebugVisualization();
}
diff --git a/src/frontend/hud.hpp b/src/frontend/hud.hpp
index 0a0b47df..775681af 100644
--- a/src/frontend/hud.hpp
+++ b/src/frontend/hud.hpp
@@ -113,6 +113,8 @@ class Hud : public util::ObjectsKeeper {
/// @brief UI element will be dynamicly positioned near to inventory or in screen center
std::shared_ptr secondUI = nullptr;
+ std::shared_ptr debugMinimap = nullptr;
+
std::unique_ptr debugImgWorldGen;
std::shared_ptr createContentAccess();