mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
scroll only if in focus
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
#include "../render/Canvas.h"
|
#include "../render/Canvas.h"
|
||||||
#include "../render/IImage.h"
|
#include "../render/IImage.h"
|
||||||
#include "../render/IRenderHandler.h"
|
#include "../render/IRenderHandler.h"
|
||||||
|
#include "../render/IScreenHandler.h"
|
||||||
#include "../CMT.h"
|
#include "../CMT.h"
|
||||||
#include "../PlayerLocalState.h"
|
#include "../PlayerLocalState.h"
|
||||||
#include "../CPlayerInterface.h"
|
#include "../CPlayerInterface.h"
|
||||||
@@ -232,7 +233,7 @@ void AdventureMapInterface::handleMapScrollingUpdate(uint32_t timePassed)
|
|||||||
|
|
||||||
bool cursorInScrollArea = scrollDelta != Point(0,0);
|
bool cursorInScrollArea = scrollDelta != Point(0,0);
|
||||||
bool scrollingActive = cursorInScrollArea && shortcuts->optionMapScrollingActive() && !scrollingWasBlocked;
|
bool scrollingActive = cursorInScrollArea && shortcuts->optionMapScrollingActive() && !scrollingWasBlocked;
|
||||||
bool scrollingBlocked = GH.isKeyboardCtrlDown() || !settings["adventure"]["borderScroll"].Bool();
|
bool scrollingBlocked = GH.isKeyboardCtrlDown() || !settings["adventure"]["borderScroll"].Bool() || !GH.screenHandler().hasFocus();
|
||||||
|
|
||||||
if (!scrollingWasActive && scrollingBlocked)
|
if (!scrollingWasActive && scrollingBlocked)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user