mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
use dimming to hide screen
This commit is contained in:
parent
1f2ca138dd
commit
b143c2786f
@ -50,7 +50,8 @@ AdventureMapInterface::AdventureMapInterface():
|
|||||||
mapAudio(new MapAudioPlayer()),
|
mapAudio(new MapAudioPlayer()),
|
||||||
spellBeingCasted(nullptr),
|
spellBeingCasted(nullptr),
|
||||||
scrollingWasActive(false),
|
scrollingWasActive(false),
|
||||||
scrollingWasBlocked(false)
|
scrollingWasBlocked(false),
|
||||||
|
isHotseatMessage(false)
|
||||||
{
|
{
|
||||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||||
pos.x = pos.y = 0;
|
pos.x = pos.y = 0;
|
||||||
@ -172,6 +173,8 @@ void AdventureMapInterface::dim(Canvas & to)
|
|||||||
if (!casted && !window->isPopupWindow())
|
if (!casted && !window->isPopupWindow())
|
||||||
{
|
{
|
||||||
int backgroundDimLevel = settings["adventure"]["backgroundDimLevel"].Integer();
|
int backgroundDimLevel = settings["adventure"]["backgroundDimLevel"].Integer();
|
||||||
|
if(isHotseatMessage)
|
||||||
|
backgroundDimLevel = 255;
|
||||||
Rect targetRect(0, 0, GH.screenDimensions().x, GH.screenDimensions().y);
|
Rect targetRect(0, 0, GH.screenDimensions().x, GH.screenDimensions().y);
|
||||||
ColorRGBA colorToFill(0, 0, 0, std::clamp<int>(backgroundDimLevel, 0, 255));
|
ColorRGBA colorToFill(0, 0, 0, std::clamp<int>(backgroundDimLevel, 0, 255));
|
||||||
if(backgroundDimLevel > 0)
|
if(backgroundDimLevel > 0)
|
||||||
@ -335,6 +338,7 @@ void AdventureMapInterface::onMapTilesChanged(boost::optional<std::unordered_set
|
|||||||
|
|
||||||
void AdventureMapInterface::onHotseatWaitStarted(PlayerColor playerID)
|
void AdventureMapInterface::onHotseatWaitStarted(PlayerColor playerID)
|
||||||
{
|
{
|
||||||
|
isHotseatMessage = true;
|
||||||
onCurrentPlayerChanged(playerID);
|
onCurrentPlayerChanged(playerID);
|
||||||
setState(EAdventureState::HOTSEAT_WAIT);
|
setState(EAdventureState::HOTSEAT_WAIT);
|
||||||
}
|
}
|
||||||
@ -379,6 +383,8 @@ void AdventureMapInterface::onCurrentPlayerChanged(PlayerColor playerID)
|
|||||||
|
|
||||||
void AdventureMapInterface::onPlayerTurnStarted(PlayerColor playerID)
|
void AdventureMapInterface::onPlayerTurnStarted(PlayerColor playerID)
|
||||||
{
|
{
|
||||||
|
isHotseatMessage = false;
|
||||||
|
|
||||||
onCurrentPlayerChanged(playerID);
|
onCurrentPlayerChanged(playerID);
|
||||||
|
|
||||||
setState(EAdventureState::MAKING_TURN);
|
setState(EAdventureState::MAKING_TURN);
|
||||||
|
@ -59,6 +59,9 @@ private:
|
|||||||
/// if true, then scrolling was blocked via ctrl and should not restart until player move cursor outside scrolling area
|
/// if true, then scrolling was blocked via ctrl and should not restart until player move cursor outside scrolling area
|
||||||
bool scrollingWasBlocked;
|
bool scrollingWasBlocked;
|
||||||
|
|
||||||
|
/// if true, the hotseat next player is opened
|
||||||
|
bool isHotseatMessage;
|
||||||
|
|
||||||
/// spell for which player is selecting target, or nullptr if none
|
/// spell for which player is selecting target, or nullptr if none
|
||||||
const CSpell *spellBeingCasted;
|
const CSpell *spellBeingCasted;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user