Focus the ViewportController on Standard/Inverted scroll modes.
This commit is contained in:
@@ -306,7 +306,12 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
if (scrollType == MouseScrollType.Standard || scrollType == MouseScrollType.Inverted)
|
if (scrollType == MouseScrollType.Standard || scrollType == MouseScrollType.Inverted)
|
||||||
{
|
{
|
||||||
if (mi.Event == MouseInputEvent.Down && !isStandardScrolling)
|
if (mi.Event == MouseInputEvent.Down && !isStandardScrolling)
|
||||||
|
{
|
||||||
|
if (!TakeMouseFocus(mi))
|
||||||
|
return false;
|
||||||
|
|
||||||
standardScrollStart = mi.Location;
|
standardScrollStart = mi.Location;
|
||||||
|
}
|
||||||
else if (mi.Event == MouseInputEvent.Move && (isStandardScrolling ||
|
else if (mi.Event == MouseInputEvent.Move && (isStandardScrolling ||
|
||||||
(standardScrollStart.HasValue && ((standardScrollStart.Value - mi.Location).Length > Game.Settings.Game.MouseScrollDeadzone))))
|
(standardScrollStart.HasValue && ((standardScrollStart.Value - mi.Location).Length > Game.Settings.Game.MouseScrollDeadzone))))
|
||||||
{
|
{
|
||||||
@@ -320,6 +325,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
var wasStandardScrolling = isStandardScrolling;
|
var wasStandardScrolling = isStandardScrolling;
|
||||||
isStandardScrolling = false;
|
isStandardScrolling = false;
|
||||||
standardScrollStart = null;
|
standardScrollStart = null;
|
||||||
|
YieldMouseFocus(mi);
|
||||||
|
|
||||||
if (wasStandardScrolling)
|
if (wasStandardScrolling)
|
||||||
return true;
|
return true;
|
||||||
@@ -333,6 +339,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
{
|
{
|
||||||
if (!TakeMouseFocus(mi))
|
if (!TakeMouseFocus(mi))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
joystickScrollStart = mi.Location;
|
joystickScrollStart = mi.Location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user