1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

hide adventuremap

This commit is contained in:
Laserlicht
2024-01-18 00:47:18 +01:00
committed by GitHub
parent d64473b894
commit a1f4fcb78a
8 changed files with 51 additions and 1 deletions

View File

@@ -31,6 +31,7 @@
#include "../gui/Shortcut.h"
#include "../gui/WindowHandler.h"
#include "../render/Canvas.h"
#include "../render/IRenderHandler.h"
#include "../CMT.h"
#include "../PlayerLocalState.h"
#include "../CPlayerInterface.h"
@@ -168,6 +169,15 @@ void AdventureMapInterface::show(Canvas & to)
void AdventureMapInterface::dim(Canvas & to)
{
if(settings["adventure"]["hideBackground"].Bool())
for (auto window : GH.windows().findWindows<IShowActivatable>())
{
if(!std::dynamic_pointer_cast<AdventureMapInterface>(window) && std::dynamic_pointer_cast<CIntObject>(window) && std::dynamic_pointer_cast<CIntObject>(window)->pos.w >= 800 && std::dynamic_pointer_cast<CIntObject>(window)->pos.w >= 600)
{
to.fillTexture(GH.renderHandler().loadImage(ImagePath::builtin("DiBoxBck")));
return;
}
}
for (auto window : GH.windows().findWindows<IShowActivatable>())
{
if (!std::dynamic_pointer_cast<AdventureMapInterface>(window) && !std::dynamic_pointer_cast<RadialMenu>(window) && !window->isPopupWindow())