diff --git a/client/adventureMap/AdventureMapInterface.cpp b/client/adventureMap/AdventureMapInterface.cpp index fc2d2a61c..9432cb9c1 100644 --- a/client/adventureMap/AdventureMapInterface.cpp +++ b/client/adventureMap/AdventureMapInterface.cpp @@ -171,18 +171,20 @@ void AdventureMapInterface::show(Canvas & to) void AdventureMapInterface::dim(Canvas & to) { + auto const isBigWindow = [&](std::shared_ptr window) { return window->pos.w >= 800 && window->pos.h >= 600; }; // OH3 fullscreen + if(settings["adventure"]["hideBackground"].Bool()) - for (auto window : GH.windows().findWindows()) + for (auto window : GH.windows().findWindows()) { - if(!std::dynamic_pointer_cast(window) && std::dynamic_pointer_cast(window) && std::dynamic_pointer_cast(window)->pos.w >= 800 && std::dynamic_pointer_cast(window)->pos.w >= 600) + if(!std::dynamic_pointer_cast(window) && std::dynamic_pointer_cast(window) && isBigWindow(window)) { to.fillTexture(GH.renderHandler().loadImage(ImagePath::builtin("DiBoxBck"))); return; } } - for (auto window : GH.windows().findWindows()) + for (auto window : GH.windows().findWindows()) { - if (!std::dynamic_pointer_cast(window) && !std::dynamic_pointer_cast(window) && !window->isPopupWindow()) + if (!std::dynamic_pointer_cast(window) && !std::dynamic_pointer_cast(window) && !window->isPopupWindow() && (settings["adventure"]["backgroundDimSmallWindows"].Bool() || isBigWindow(window))) { Rect targetRect(0, 0, GH.screenDimensions().x, GH.screenDimensions().y); ColorRGBA colorToFill(0, 0, 0, std::clamp(backgroundDimLevel, 0, 255)); diff --git a/config/schemas/settings.json b/config/schemas/settings.json index dfb7501cf..75b607394 100644 --- a/config/schemas/settings.json +++ b/config/schemas/settings.json @@ -252,7 +252,7 @@ "type" : "object", "additionalProperties" : false, "default" : {}, - "required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag", "smoothDragging", "backgroundDimLevel", "hideBackground" ], + "required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag", "smoothDragging", "backgroundDimLevel", "hideBackground", "backgroundDimSmallWindows" ], "properties" : { "heroMoveTime" : { "type" : "number", @@ -308,6 +308,10 @@ "hideBackground" : { "type" : "boolean", "default" : false + }, + "backgroundDimSmallWindows" : { + "type" : "boolean", + "default" : true } } },