1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

setting + all non popups

This commit is contained in:
Michael 2023-08-30 21:41:28 +02:00 committed by GitHub
parent 1d6469ab36
commit e650f0100b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View File

@ -170,11 +170,15 @@ void AdventureMapInterface::show(Canvas & to)
void AdventureMapInterface::dim(Canvas & to)
{
if(!GH.windows().findWindows<CCastleInterface>().empty() ||
!GH.windows().findWindows<CHeroWindow>().empty() ||
!GH.windows().findWindows<CKingdomInterface>().empty() ||
!GH.windows().findWindows<BattleWindow>().empty())
to.drawColor(Rect(0, 0, GH.screenDimensions().x, GH.screenDimensions().y), ColorRGBA(0, 0, 0, 128));
for (auto window : GH.windows().findWindows<IShowActivatable>())
{
std::shared_ptr<AdventureMapInterface> casted = std::dynamic_pointer_cast<AdventureMapInterface>(window);
if (!casted && !window->isPopupWindow())
{
to.drawColor(Rect(0, 0, GH.screenDimensions().x, GH.screenDimensions().y), ColorRGBA(0, 0, 0, std::clamp<int>(settings["adventure"]["backgroundDimLevel"].Integer(), 0, 255)));
return;
}
}
}
void AdventureMapInterface::tick(uint32_t msPassed)

View File

@ -226,7 +226,7 @@
"type" : "object",
"additionalProperties" : false,
"default" : {},
"required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag", "smoothDragging" ],
"required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag", "smoothDragging", "backgroundDimLevel" ],
"properties" : {
"heroMoveTime" : {
"type" : "number",
@ -274,7 +274,11 @@
"smoothDragging" : {
"type" : "boolean",
"default" : true
}
},
"backgroundDimLevel" : {
"type" : "number",
"default" : 128
},
}
},
"battle" : {