1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

use CIntObject instead of IShowActivatable

This commit is contained in:
Laserlicht 2024-04-19 23:11:24 +02:00 committed by GitHub
parent 19b75c3d88
commit cf4384071d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -171,10 +171,10 @@ void AdventureMapInterface::show(Canvas & to)
void AdventureMapInterface::dim(Canvas & to) void AdventureMapInterface::dim(Canvas & to)
{ {
auto const isBigWindow = [&](std::shared_ptr<IShowActivatable> window) { return std::dynamic_pointer_cast<CIntObject>(window)->pos.w >= 800 && std::dynamic_pointer_cast<CIntObject>(window)->pos.w >= 600; }; // OH3 fullscreen auto const isBigWindow = [&](std::shared_ptr<CIntObject> window) { return std::dynamic_pointer_cast<CIntObject>(window)->pos.w >= 800 && std::dynamic_pointer_cast<CIntObject>(window)->pos.w >= 600; }; // OH3 fullscreen
if(settings["adventure"]["hideBackground"].Bool()) if(settings["adventure"]["hideBackground"].Bool())
for (auto window : GH.windows().findWindows<IShowActivatable>()) for (auto window : GH.windows().findWindows<CIntObject>())
{ {
if(!std::dynamic_pointer_cast<AdventureMapInterface>(window) && std::dynamic_pointer_cast<CIntObject>(window) && isBigWindow(window)) if(!std::dynamic_pointer_cast<AdventureMapInterface>(window) && std::dynamic_pointer_cast<CIntObject>(window) && isBigWindow(window))
{ {
@ -182,7 +182,7 @@ void AdventureMapInterface::dim(Canvas & to)
return; return;
} }
} }
for (auto window : GH.windows().findWindows<IShowActivatable>()) for (auto window : GH.windows().findWindows<CIntObject>())
{ {
if (!std::dynamic_pointer_cast<AdventureMapInterface>(window) && !std::dynamic_pointer_cast<RadialMenu>(window) && !window->isPopupWindow() && (settings["adventure"]["backgroundDimSmallWindows"].Bool() || isBigWindow(window))) if (!std::dynamic_pointer_cast<AdventureMapInterface>(window) && !std::dynamic_pointer_cast<RadialMenu>(window) && !window->isPopupWindow() && (settings["adventure"]["backgroundDimSmallWindows"].Bool() || isBigWindow(window)))
{ {