Add mouse scroll to ProductionPaletteWidget

This commit is contained in:
EoralMilk
2022-10-18 14:13:09 +08:00
committed by abcdefg30
parent efe65701e4
commit 949ef1662d

View File

@@ -258,6 +258,22 @@ namespace OpenRA.Mods.Common.Widgets
if (mi.Event == MouseInputEvent.Move) if (mi.Event == MouseInputEvent.Move)
TooltipIcon = icon; TooltipIcon = icon;
if (mi.Event == MouseInputEvent.Scroll)
{
if (mi.Delta.Y < 0 && CanScrollDown)
{
ScrollDown();
Ui.ResetTooltips();
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
}
else if (mi.Delta.Y > 0 && CanScrollUp)
{
ScrollUp();
Ui.ResetTooltips();
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
}
}
if (icon == null) if (icon == null)
return false; return false;