fix generator minimap checkbox

This commit is contained in:
MihailRis 2024-11-07 05:07:56 +03:00
parent cfa5365b95
commit 616c63b115
2 changed files with 6 additions and 3 deletions

View File

@ -194,11 +194,11 @@ Hud::Hud(Engine* engine, LevelFrontend* frontend, Player* player)
assets->store(Texture::from(debugImgWorldGen.get()), DEBUG_WORLDGEN_IMAGE); assets->store(Texture::from(debugImgWorldGen.get()), DEBUG_WORLDGEN_IMAGE);
add(HudElement(hud_element_mode::permanent, nullptr, debugMinimap = guiutil::create(
guiutil::create(
"<image src='"+DEBUG_WORLDGEN_IMAGE+ "<image src='"+DEBUG_WORLDGEN_IMAGE+
"' pos='0' size='256' gravity='top-right' margin='0,20,0,0'/>" "' pos='0' size='256' gravity='top-right' margin='0,20,0,0'/>"
), true)); );
add(HudElement(hud_element_mode::permanent, nullptr, debugMinimap, true));
} }
Hud::~Hud() { Hud::~Hud() {
@ -367,6 +367,7 @@ void Hud::update(bool visible) {
} }
cleanup(); cleanup();
debugMinimap->setVisible(player->debug && showGeneratorMinimap);
if (player->debug && showGeneratorMinimap) { if (player->debug && showGeneratorMinimap) {
updateWorldGenDebugVisualization(); updateWorldGenDebugVisualization();
} }

View File

@ -113,6 +113,8 @@ class Hud : public util::ObjectsKeeper {
/// @brief UI element will be dynamicly positioned near to inventory or in screen center /// @brief UI element will be dynamicly positioned near to inventory or in screen center
std::shared_ptr<gui::UINode> secondUI = nullptr; std::shared_ptr<gui::UINode> secondUI = nullptr;
std::shared_ptr<gui::UINode> debugMinimap = nullptr;
std::unique_ptr<ImageData> debugImgWorldGen; std::unique_ptr<ImageData> debugImgWorldGen;
std::shared_ptr<gui::InventoryView> createContentAccess(); std::shared_ptr<gui::InventoryView> createContentAccess();