enable query

change Avatar animation too
add forgotten usings
This commit is contained in:
Aergwyn 2018-01-10 16:46:55 +01:00
parent 1a37812d1f
commit 312f52072b
3 changed files with 19 additions and 29 deletions

View File

@ -55,9 +55,9 @@ private void load(OsuColour colours)
public enum SocialTab
{
[Description("All Players")]
AllPlayers = SocialSortCriteria.Rank,
AllPlayers,
[Description("Friends")]
Friends = SocialSortCriteria.Name,
Friends,
//[Description("Team Members")]
//TeamMembers,
//[Description("Chat Channels")]

View File

@ -15,6 +15,8 @@
using osu.Game.Overlays.SearchableList;
using osu.Game.Overlays.Social;
using osu.Game.Users;
using osu.Framework.Configuration;
using osu.Framework.Threading;
namespace osu.Game.Overlays
{
@ -65,36 +67,24 @@ public SocialOverlay()
}
};
Header.Tabs.Current.ValueChanged += tab =>
{
//currentQuery.Value = string.Empty;
Filter.Tabs.Current.Value = (SocialSortCriteria)Header.Tabs.Current.Value;
Scheduler.AddOnce(updateSearch);
};
Header.Tabs.Current.ValueChanged += tab => Scheduler.AddOnce(updateSearch);
Filter.Tabs.Current.ValueChanged += sortCriteria =>
{
// force searching in players until searching for friends is supported
if (Header.Tabs.Current.Value != SocialTab.AllPlayers && sortCriteria != (SocialSortCriteria)Header.Tabs.Current.Value)
Header.Tabs.Current.Value = SocialTab.AllPlayers;
Scheduler.AddOnce(updateSearch);
};
Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch);
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += recreatePanels;
Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += sortOrder => Scheduler.AddOnce(updateSearch);
//currentQuery.ValueChanged += v =>
//{
// queryChangedDebounce?.Cancel();
currentQuery.ValueChanged += query =>
{
queryChangedDebounce?.Cancel();
// if (string.IsNullOrEmpty(v))
// Scheduler.AddOnce(updateSearch);
// else
// queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500);
//};
if (string.IsNullOrEmpty(query))
Scheduler.AddOnce(updateSearch);
else
queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500);
};
//currentQuery.BindTo(Filter.Search.Current);
currentQuery.BindTo(Filter.Search.Current);
}
[BackgroundDependencyLoader]
@ -159,13 +149,13 @@ private void clearPanels()
private APIRequest getUsersRequest;
//private readonly Bindable<string> currentQuery = new Bindable<string>();
private readonly Bindable<string> currentQuery = new Bindable<string>();
//private ScheduledDelegate queryChangedDebounce;
private ScheduledDelegate queryChangedDebounce;
private void updateSearch()
{
//queryChangedDebounce?.Cancel();
queryChangedDebounce?.Cancel();
if (!IsLoaded)
return;

View File

@ -44,7 +44,7 @@ private void updateAvatar()
new Avatar(user)
{
RelativeSizeAxes = Axes.Both,
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
OnLoadComplete = d => d.FadeInFromZero(300, Easing.OutQuint),
})
);
}