mirror of
https://github.com/ppy/osu.git
synced 2025-02-06 09:33:12 +08:00
Merge remote-tracking branch 'upstream/master' into disable-mouse-buttons
This commit is contained in:
commit
4b3c2466a4
@ -1 +1 @@
|
|||||||
Subproject commit 5c135a7360388dc41b1dc4387769a98ee1635d36
|
Subproject commit af03b4ae71b1b76f2cb8925ba6603430905f97c6
|
@ -12,10 +12,8 @@ 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;
|
||||||
@ -181,7 +179,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
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);
|
this.TransformBindableTo(ChatHeight, 1f - channel_selection_min_height, 800, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
textbox.HoldFocus = true;
|
textbox.HoldFocus = true;
|
||||||
@ -533,26 +531,5 @@ 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,7 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.MathUtils;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
|
||||||
@ -90,10 +88,10 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
switch (args.Key)
|
switch (args.Key)
|
||||||
{
|
{
|
||||||
case Key.Minus:
|
case Key.Minus:
|
||||||
transformVisibleTimeRangeTo(VisibleTimeRange + time_span_step, 200, Easing.OutQuint);
|
this.TransformBindableTo(VisibleTimeRange, VisibleTimeRange + time_span_step, 200, Easing.OutQuint);
|
||||||
break;
|
break;
|
||||||
case Key.Plus:
|
case Key.Plus:
|
||||||
transformVisibleTimeRangeTo(VisibleTimeRange - time_span_step, 200, Easing.OutQuint);
|
this.TransformBindableTo(VisibleTimeRange, VisibleTimeRange - time_span_step, 200, Easing.OutQuint);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,27 +99,6 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformVisibleTimeRangeTo(double newTimeRange, double duration = 0, Easing easing = Easing.None)
|
|
||||||
{
|
|
||||||
this.TransformTo(this.PopulateTransform(new TransformVisibleTimeRange(), newTimeRange, duration, easing));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected sealed override HitObjectContainer CreateHitObjectContainer() => new ScrollingHitObjectContainer(direction);
|
protected sealed override HitObjectContainer CreateHitObjectContainer() => new ScrollingHitObjectContainer(direction);
|
||||||
|
|
||||||
private class TransformVisibleTimeRange : Transform<double, ScrollingPlayfield>
|
|
||||||
{
|
|
||||||
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 => "VisibleTimeRange.Value";
|
|
||||||
|
|
||||||
protected override void Apply(ScrollingPlayfield d, double time) => d.VisibleTimeRange.Value = valueAt(time);
|
|
||||||
protected override void ReadIntoStartValue(ScrollingPlayfield d) => StartValue = d.VisibleTimeRange.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user