Add smooth scrolling to the ScrollPanelWidget

This commit is contained in:
Pavlos Touboulidis
2014-06-13 12:18:09 +03:00
parent 53930fdc81
commit 628c524494
4 changed files with 95 additions and 39 deletions

View File

@@ -161,7 +161,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var scrolledToBottom = chatScrollPanel.ScrolledToBottom;
chatScrollPanel.AddChild(template);
if (scrolledToBottom)
chatScrollPanel.ScrollToBottom();
chatScrollPanel.ScrollToBottom(smooth: true);
Sound.PlayNotification(modRules, null, "Sounds", "ChatLine", null);
}

View File

@@ -568,7 +568,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var scrolledToBottom = chatPanel.ScrolledToBottom;
chatPanel.AddChild(template);
if (scrolledToBottom)
chatPanel.ScrollToBottom();
chatPanel.ScrollToBottom(smooth: true);
Sound.PlayNotification(modRules, null, "Sounds", "ChatLine", null);
}

View File

@@ -76,7 +76,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{
var uid = visibleMaps.Random(Game.CosmeticRandom);
selectedUid = uid;
scrollpanel.ScrollToItem(uid);
scrollpanel.ScrollToItem(uid, smooth: true);
};
randomMapButton.IsDisabled = () => visibleMaps == null || visibleMaps.Count == 0;
}