Selaa lähdekoodia

added setting

Michael 2 vuotta sitten
vanhempi
sitoutus
bbd69fd430
2 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 4 2
      client/mapView/MapView.cpp
  2. 5 1
      config/schemas/settings.json

+ 4 - 2
client/mapView/MapView.cpp

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

+ 5 - 1
config/schemas/settings.json

@@ -221,7 +221,7 @@
 			"type" : "object",
 			"additionalProperties" : false,
 			"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" : {
 				"heroMoveTime" : {
 					"type" : "number",
@@ -265,6 +265,10 @@
 				"leftButtonDrag" : {
 					"type" : "boolean",
 					"default" : false
+				},
+				"smoothDragging" : {
+					"type" : "boolean",
+					"default" : true
 				}
 			}
 		},