Browse Source

config for right drag

Laserlicht 1 year ago
parent
commit
8f24778e9d

+ 4 - 2
Mods/vcmi/config/vcmi/english.json

@@ -234,8 +234,10 @@
 	"vcmi.adventureOptions.borderScroll.help" : "{Border Scrolling}\n\nScroll adventure map when cursor is adjacent to window edge. Can be disabled by holding down CTRL key.",
 	"vcmi.adventureOptions.infoBarCreatureManagement.hover" : "Info Panel Creature Management",
 	"vcmi.adventureOptions.infoBarCreatureManagement.help" : "{Info Panel Creature Management}\n\nAllows rearranging creatures in info panel instead of cycling between default components.",
-	"vcmi.adventureOptions.leftButtonDrag.hover" : "Left Click Drag Map",
-	"vcmi.adventureOptions.leftButtonDrag.help" : "{Left Click Drag Map}\n\nWhen enabled, moving mouse with left button pressed will drag adventure map view.",
+	"vcmi.adventureOptions.leftButtonDrag.hover" : "Left Click Drag",
+	"vcmi.adventureOptions.leftButtonDrag.help" : "{Left Click Drag}\n\nWhen enabled, moving mouse with left button pressed will drag adventure map view.",
+	"vcmi.adventureOptions.rightButtonDrag.hover" : "Right Click Drag",
+	"vcmi.adventureOptions.rightButtonDrag.help" : "{Right Click Drag}\n\nWhen enabled, moving mouse with right button pressed will drag adventure map view.",
 	"vcmi.adventureOptions.smoothDragging.hover" : "Smooth Map Dragging",
 	"vcmi.adventureOptions.smoothDragging.help" : "{Smooth Map Dragging}\n\nWhen enabled, map dragging has a modern run out effect.",
 	"vcmi.adventureOptions.skipAdventureMapAnimations.hover" : "Skip fading effects",

+ 4 - 2
Mods/vcmi/config/vcmi/german.json

@@ -234,8 +234,10 @@
 	"vcmi.adventureOptions.borderScroll.help" : "{Scrollen am Rand}\n\nScrollt die Abenteuerkarte, wenn sich der Cursor neben dem Fensterrand befindet. Kann mit gedrückter STRG-Taste deaktiviert werden.",
 	"vcmi.adventureOptions.infoBarCreatureManagement.hover" : "Info-Panel Kreaturenmanagement",
 	"vcmi.adventureOptions.infoBarCreatureManagement.help" : "{Info-Panel Kreaturenmanagement}\n\nErmöglicht die Neuanordnung von Kreaturen im Info-Panel, anstatt zwischen den Standardkomponenten zu wechseln",
-	"vcmi.adventureOptions.leftButtonDrag.hover" : "Ziehen der Karte mit Links",
-	"vcmi.adventureOptions.leftButtonDrag.help" : "{Ziehen der Karte mit Links}\n\nWenn aktiviert, wird die Maus bei gedrückter linker Taste in die Kartenansicht gezogen",
+	"vcmi.adventureOptions.leftButtonDrag.hover" : "Ziehen mit Links",
+	"vcmi.adventureOptions.leftButtonDrag.help" : "{Ziehen mit Links}\n\nWenn aktiviert, wird die Maus bei gedrückter linker Taste in der Kartenansicht gezogen",
+	"vcmi.adventureOptions.rightButtonDrag.hover" : "Ziehen mit Rechts",
+	"vcmi.adventureOptions.rightButtonDrag.help" : "{Ziehen mit Rechts}\n\nWenn aktiviert, wird die Maus bei gedrückter rechter Taste in der Kartenansicht gezogen",
 	"vcmi.adventureOptions.smoothDragging.hover" : "Nahtloses Ziehen der Karte",
 	"vcmi.adventureOptions.smoothDragging.help" : "{Nahtloses Ziehen der Karte}\n\nWenn aktiviert hat das Ziehen der Karte einen sanften Auslaufeffekt.",
 	"vcmi.adventureOptions.skipAdventureMapAnimations.hover" : "Fading-Effekte überspringen",

+ 8 - 0
client/windows/settings/AdventureOptionsTab.cpp

@@ -126,6 +126,10 @@ AdventureOptionsTab::AdventureOptionsTab()
 	{
 		return setBoolSetting("adventure", "leftButtonDrag", value);
 	});
+	addCallback("rightButtonDragChanged", [](bool value)
+	{
+		return setBoolSetting("adventure", "rightButtonDrag", value);
+	});
 	addCallback("smoothDraggingChanged", [](bool value)
 	{
 		return setBoolSetting("adventure", "smoothDragging", value);
@@ -177,6 +181,10 @@ AdventureOptionsTab::AdventureOptionsTab()
 	if (leftButtonDragCheckbox)
 		leftButtonDragCheckbox->setSelected(settings["adventure"]["leftButtonDrag"].Bool());
 
+	std::shared_ptr<CToggleButton> rightButtonDragCheckbox = widget<CToggleButton>("rightButtonDragCheckbox");
+	if (rightButtonDragCheckbox)
+		rightButtonDragCheckbox->setSelected(settings["adventure"]["rightButtonDrag"].Bool());
+
 	std::shared_ptr<CToggleButton> smoothDraggingCheckbox = widget<CToggleButton>("smoothDraggingCheckbox");
 	if (smoothDraggingCheckbox)
 		smoothDraggingCheckbox->setSelected(settings["adventure"]["smoothDragging"].Bool());

+ 26 - 0
config/widgets/settings/adventureOptionsTab.json

@@ -371,6 +371,18 @@
 				}
 			]
 		},
+		{
+			"type": "verticalLayout",
+			"customType": "labelDescription",
+			"position": {"x": 225, "y": 415},
+			"items":
+			[
+				{
+					"text": "vcmi.adventureOptions.rightButtonDrag.hover",
+					"created" : "desktop"
+				}
+			]
+		},
 		{
 			"type": "verticalLayout",
 			"customType": "checkbox",
@@ -419,6 +431,20 @@
 					"callback": "smoothDraggingChanged"
 				}
 			]
+		},
+		{
+			"type": "verticalLayout",
+			"customType": "checkbox",
+			"position": {"x": 190, "y": 413},
+			"items":
+			[
+				{
+					"name": "rightButtonDragCheckbox",
+					"help": "vcmi.adventureOptions.rightButtonDrag",
+					"callback": "rightButtonDragChanged",
+					"created" : "desktop"
+				}
+			]
 		}
 	]
 }