mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Merge branch 'master' into fix-sliderhead-depth
This commit is contained in:
@ -100,6 +100,11 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public bool Equals(BeatmapInfo other)
|
public bool Equals(BeatmapInfo other)
|
||||||
{
|
{
|
||||||
|
if (ID == 0 || other?.ID == 0)
|
||||||
|
// one of the two BeatmapInfos we are comparing isn't sourced from a database.
|
||||||
|
// fall back to reference equality.
|
||||||
|
return ReferenceEquals(this, other);
|
||||||
|
|
||||||
return ID == other?.ID;
|
return ID == other?.ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,8 +12,10 @@ using osu.Framework.Configuration;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Graphics.Transforms;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
@ -56,7 +58,7 @@ namespace osu.Game.Overlays
|
|||||||
private readonly Box chatBackground;
|
private readonly Box chatBackground;
|
||||||
private readonly Box tabBackground;
|
private readonly Box tabBackground;
|
||||||
|
|
||||||
private Bindable<double> chatHeight;
|
public Bindable<double> ChatHeight { get; internal set; }
|
||||||
|
|
||||||
private readonly Container channelSelectionContainer;
|
private readonly Container channelSelectionContainer;
|
||||||
private readonly ChannelSelectionOverlay channelSelection;
|
private readonly ChannelSelectionOverlay channelSelection;
|
||||||
@ -177,18 +179,11 @@ namespace osu.Game.Overlays
|
|||||||
if (state == Visibility.Visible)
|
if (state == Visibility.Visible)
|
||||||
{
|
{
|
||||||
textbox.HoldFocus = false;
|
textbox.HoldFocus = false;
|
||||||
if (1f - chatHeight.Value < channel_selection_min_height)
|
if (1f - ChatHeight.Value < channel_selection_min_height)
|
||||||
{
|
transformChatHeightTo(1f - channel_selection_min_height, 800, Easing.OutQuint);
|
||||||
chatContainer.ResizeHeightTo(1f - channel_selection_min_height, 800, Easing.OutQuint);
|
|
||||||
channelSelectionContainer.ResizeHeightTo(channel_selection_min_height, 800, Easing.OutQuint);
|
|
||||||
channelSelection.Show();
|
|
||||||
chatHeight.Value = 1f - channel_selection_min_height;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
textbox.HoldFocus = true;
|
textbox.HoldFocus = true;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +197,7 @@ namespace osu.Game.Overlays
|
|||||||
if (!isDragging)
|
if (!isDragging)
|
||||||
return base.OnDragStart(state);
|
return base.OnDragStart(state);
|
||||||
|
|
||||||
startDragChatHeight = chatHeight.Value;
|
startDragChatHeight = ChatHeight.Value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +207,13 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
Trace.Assert(state.Mouse.PositionMouseDown != null);
|
Trace.Assert(state.Mouse.PositionMouseDown != null);
|
||||||
|
|
||||||
chatHeight.Value = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y;
|
double targetChatHeight = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y;
|
||||||
|
|
||||||
|
// If the channel selection screen is shown, mind its minimum height
|
||||||
|
if (channelSelection.State == Visibility.Visible && targetChatHeight > 1f - channel_selection_min_height)
|
||||||
|
targetChatHeight = 1f - channel_selection_min_height;
|
||||||
|
|
||||||
|
ChatHeight.Value = targetChatHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -272,14 +273,14 @@ namespace osu.Game.Overlays
|
|||||||
this.api = api;
|
this.api = api;
|
||||||
api.Register(this);
|
api.Register(this);
|
||||||
|
|
||||||
chatHeight = config.GetBindable<double>(OsuSetting.ChatDisplayHeight);
|
ChatHeight = config.GetBindable<double>(OsuSetting.ChatDisplayHeight);
|
||||||
chatHeight.ValueChanged += h =>
|
ChatHeight.ValueChanged += h =>
|
||||||
{
|
{
|
||||||
chatContainer.Height = (float)h;
|
chatContainer.Height = (float)h;
|
||||||
channelSelectionContainer.Height = 1f - (float)h;
|
channelSelectionContainer.Height = 1f - (float)h;
|
||||||
tabBackground.FadeTo(h == 1 ? 1 : 0.8f, 200);
|
tabBackground.FadeTo(h == 1 ? 1 : 0.8f, 200);
|
||||||
};
|
};
|
||||||
chatHeight.TriggerChange();
|
ChatHeight.TriggerChange();
|
||||||
|
|
||||||
chatBackground.Colour = colours.ChatBlue;
|
chatBackground.Colour = colours.ChatBlue;
|
||||||
}
|
}
|
||||||
@ -501,5 +502,26 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void transformChatHeightTo(double newChatHeight, double duration = 0, Easing easing = Easing.None)
|
||||||
|
{
|
||||||
|
this.TransformTo(this.PopulateTransform(new TransformChatHeight(), newChatHeight, duration, easing));
|
||||||
|
}
|
||||||
|
|
||||||
|
private class TransformChatHeight : Transform<double, ChatOverlay>
|
||||||
|
{
|
||||||
|
private double valueAt(double time)
|
||||||
|
{
|
||||||
|
if (time < StartTime) return StartValue;
|
||||||
|
if (time >= EndTime) return EndValue;
|
||||||
|
|
||||||
|
return Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string TargetMember => "ChatHeight.Value";
|
||||||
|
|
||||||
|
protected override void Apply(ChatOverlay d, double time) => d.ChatHeight.Value = valueAt(time);
|
||||||
|
protected override void ReadIntoStartValue(ChatOverlay d) => StartValue = d.ChatHeight.Value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -414,8 +414,8 @@ namespace osu.Game.Overlays.Profile
|
|||||||
scoreNumberText.Add(createScoreNumberText(user.Statistics.TotalHits.ToString(@"#,0")));
|
scoreNumberText.Add(createScoreNumberText(user.Statistics.TotalHits.ToString(@"#,0")));
|
||||||
scoreText.Add(createScoreText("Max Combo"));
|
scoreText.Add(createScoreText("Max Combo"));
|
||||||
scoreNumberText.Add(createScoreNumberText(user.Statistics.MaxCombo.ToString(@"#,0")));
|
scoreNumberText.Add(createScoreNumberText(user.Statistics.MaxCombo.ToString(@"#,0")));
|
||||||
scoreText.Add(createScoreText("Replay Watched by Others"));
|
scoreText.Add(createScoreText("Replays Watched by Others"));
|
||||||
scoreNumberText.Add(createScoreNumberText(user.Statistics.ReplayWatched.ToString(@"#,0")));
|
scoreNumberText.Add(createScoreNumberText(user.Statistics.ReplaysWatched.ToString(@"#,0")));
|
||||||
|
|
||||||
gradeSS.DisplayCount = user.Statistics.GradesCount.SS;
|
gradeSS.DisplayCount = user.Statistics.GradesCount.SS;
|
||||||
gradeSS.Show();
|
gradeSS.Show();
|
||||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Users
|
|||||||
public int MaxCombo;
|
public int MaxCombo;
|
||||||
|
|
||||||
[JsonProperty(@"replays_watched_by_others")]
|
[JsonProperty(@"replays_watched_by_others")]
|
||||||
public int ReplayWatched;
|
public int ReplaysWatched;
|
||||||
|
|
||||||
[JsonProperty(@"grade_counts")]
|
[JsonProperty(@"grade_counts")]
|
||||||
public Grades GradesCount;
|
public Grades GradesCount;
|
||||||
|
Reference in New Issue
Block a user