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

added setting

This commit is contained in:
Michael 2023-08-27 00:33:52 +02:00 committed by GitHub
parent 4eecca2d9a
commit bbd69fd430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -85,6 +85,7 @@ void BasicMapView::showAll(Canvas & to)
void MapView::tick(uint32_t msPassed) void MapView::tick(uint32_t msPassed)
{ {
if(settings["adventure"]["smoothDragging"].Bool())
postSwipe(msPassed); postSwipe(msPassed);
BasicMapView::tick(msPassed); BasicMapView::tick(msPassed);
@ -123,6 +124,7 @@ void MapView::onMapScrolled(const Point & distance)
void MapView::onMapSwiped(const Point & viewPosition) void MapView::onMapSwiped(const Point & viewPosition)
{ {
if(settings["adventure"]["smoothDragging"].Bool())
swipeHistory.push_back(std::pair<uint32_t, Point>(GH.input().getTicks(), viewPosition)); swipeHistory.push_back(std::pair<uint32_t, Point>(GH.input().getTicks(), viewPosition));
controller->setViewCenter(model->getMapViewCenter() + viewPosition, model->getLevel()); controller->setViewCenter(model->getMapViewCenter() + viewPosition, model->getLevel());

View File

@ -221,7 +221,7 @@
"type" : "object", "type" : "object",
"additionalProperties" : false, "additionalProperties" : false,
"default" : {}, "default" : {},
"required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag" ], "required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag", "smoothDragging" ],
"properties" : { "properties" : {
"heroMoveTime" : { "heroMoveTime" : {
"type" : "number", "type" : "number",
@ -265,6 +265,10 @@
"leftButtonDrag" : { "leftButtonDrag" : {
"type" : "boolean", "type" : "boolean",
"default" : false "default" : false
},
"smoothDragging" : {
"type" : "boolean",
"default" : true
} }
} }
}, },