mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-06 23:26:26 +02:00
Merge pull request #3279 from Laserlicht/smooth_scroll_fix
smooth scroll fix and gui option to disable
This commit is contained in:
commit
4fa33c8d2e
@ -131,6 +131,8 @@
|
|||||||
"vcmi.adventureOptions.infoBarCreatureManagement.help" : "{Info Panel Creature Management}\n\nAllows rearranging creatures in info panel instead of cycling between default components.",
|
"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.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.help" : "{Left Click Drag Map}\n\nWhen enabled, moving mouse with left 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.mapScrollSpeed1.hover": "",
|
"vcmi.adventureOptions.mapScrollSpeed1.hover": "",
|
||||||
"vcmi.adventureOptions.mapScrollSpeed5.hover": "",
|
"vcmi.adventureOptions.mapScrollSpeed5.hover": "",
|
||||||
"vcmi.adventureOptions.mapScrollSpeed6.hover": "",
|
"vcmi.adventureOptions.mapScrollSpeed6.hover": "",
|
||||||
|
@ -131,6 +131,8 @@
|
|||||||
"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.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.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.help" : "{Ziehen der Karte mit Links}\n\nWenn aktiviert, wird die Maus bei gedrückter linker Taste in die 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.mapScrollSpeed1.hover": "",
|
"vcmi.adventureOptions.mapScrollSpeed1.hover": "",
|
||||||
"vcmi.adventureOptions.mapScrollSpeed5.hover": "",
|
"vcmi.adventureOptions.mapScrollSpeed5.hover": "",
|
||||||
"vcmi.adventureOptions.mapScrollSpeed6.hover": "",
|
"vcmi.adventureOptions.mapScrollSpeed6.hover": "",
|
||||||
|
@ -122,7 +122,10 @@ void MapView::onMapLevelSwitched()
|
|||||||
void MapView::onMapScrolled(const Point & distance)
|
void MapView::onMapScrolled(const Point & distance)
|
||||||
{
|
{
|
||||||
if(!isGesturing())
|
if(!isGesturing())
|
||||||
|
{
|
||||||
|
postSwipeSpeed = 0.0;
|
||||||
controller->setViewCenter(model->getMapViewCenter() + distance, model->getLevel());
|
controller->setViewCenter(model->getMapViewCenter() + distance, model->getLevel());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::onMapSwiped(const Point & viewPosition)
|
void MapView::onMapSwiped(const Point & viewPosition)
|
||||||
|
@ -126,6 +126,10 @@ AdventureOptionsTab::AdventureOptionsTab()
|
|||||||
{
|
{
|
||||||
return setBoolSetting("adventure", "leftButtonDrag", value);
|
return setBoolSetting("adventure", "leftButtonDrag", value);
|
||||||
});
|
});
|
||||||
|
addCallback("smoothDraggingChanged", [](bool value)
|
||||||
|
{
|
||||||
|
return setBoolSetting("adventure", "smoothDragging", value);
|
||||||
|
});
|
||||||
build(config);
|
build(config);
|
||||||
|
|
||||||
std::shared_ptr<CToggleGroup> playerHeroSpeedToggle = widget<CToggleGroup>("heroMovementSpeedPicker");
|
std::shared_ptr<CToggleGroup> playerHeroSpeedToggle = widget<CToggleGroup>("heroMovementSpeedPicker");
|
||||||
@ -164,4 +168,8 @@ AdventureOptionsTab::AdventureOptionsTab()
|
|||||||
std::shared_ptr<CToggleButton> leftButtonDragCheckbox = widget<CToggleButton>("leftButtonDragCheckbox");
|
std::shared_ptr<CToggleButton> leftButtonDragCheckbox = widget<CToggleButton>("leftButtonDragCheckbox");
|
||||||
if (leftButtonDragCheckbox)
|
if (leftButtonDragCheckbox)
|
||||||
leftButtonDragCheckbox->setSelected(settings["adventure"]["leftButtonDrag"].Bool());
|
leftButtonDragCheckbox->setSelected(settings["adventure"]["leftButtonDrag"].Bool());
|
||||||
|
|
||||||
|
std::shared_ptr<CToggleButton> smoothDraggingCheckbox = widget<CToggleButton>("smoothDraggingCheckbox");
|
||||||
|
if (smoothDraggingCheckbox)
|
||||||
|
smoothDraggingCheckbox->setSelected(settings["adventure"]["smoothDragging"].Bool());
|
||||||
}
|
}
|
||||||
|
@ -347,6 +347,9 @@
|
|||||||
{
|
{
|
||||||
"text": "vcmi.adventureOptions.leftButtonDrag.hover",
|
"text": "vcmi.adventureOptions.leftButtonDrag.hover",
|
||||||
"created" : "desktop"
|
"created" : "desktop"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "vcmi.adventureOptions.smoothDragging.hover"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -391,6 +394,11 @@
|
|||||||
"help": "vcmi.adventureOptions.leftButtonDrag",
|
"help": "vcmi.adventureOptions.leftButtonDrag",
|
||||||
"callback": "leftButtonDragChanged",
|
"callback": "leftButtonDragChanged",
|
||||||
"created" : "desktop"
|
"created" : "desktop"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "smoothDraggingCheckbox",
|
||||||
|
"help": "vcmi.adventureOptions.smoothDragging",
|
||||||
|
"callback": "smoothDraggingChanged"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user