mirror of
https://github.com/osukey/osukey.git
synced 2025-07-31 07:05:35 +09:00
Make transitions better.
This commit is contained in:
@ -103,20 +103,26 @@ namespace osu.Game.Overlays.Mods
|
|||||||
highMultiplierColour = colours.Green;
|
highMultiplierColour = colours.Green;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
|
||||||
{
|
|
||||||
base.PopIn();
|
|
||||||
Schedule(TriggerFocusContention);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
{
|
{
|
||||||
base.PopOut();
|
base.PopOut();
|
||||||
|
|
||||||
|
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, CONTENT_DURATION, EasingTypes.InSine);
|
||||||
|
rankedMultiplerContainer.FadeOut(CONTENT_DURATION, EasingTypes.InSine);
|
||||||
|
|
||||||
|
foreach (ModSection section in sections)
|
||||||
|
{
|
||||||
|
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), CONTENT_DURATION, EasingTypes.InSine);
|
||||||
|
section.ButtonsContainer.MoveToX(100f, CONTENT_DURATION, EasingTypes.InSine);
|
||||||
|
section.ButtonsContainer.FadeOut(CONTENT_DURATION, EasingTypes.InSine);
|
||||||
|
}
|
||||||
|
|
||||||
TriggerFocusLost();
|
TriggerFocusLost();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void TransitionIn()
|
protected override void PopIn()
|
||||||
{
|
{
|
||||||
|
base.PopIn();
|
||||||
rankedMultiplerContainer.MoveToX(0, ranked_multiplier_duration, EasingTypes.OutQuint);
|
rankedMultiplerContainer.MoveToX(0, ranked_multiplier_duration, EasingTypes.OutQuint);
|
||||||
rankedMultiplerContainer.FadeIn(ranked_multiplier_duration, EasingTypes.OutQuint);
|
rankedMultiplerContainer.FadeIn(ranked_multiplier_duration, EasingTypes.OutQuint);
|
||||||
|
|
||||||
@ -126,19 +132,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
section.ButtonsContainer.MoveToX(0, button_duration, EasingTypes.OutQuint);
|
section.ButtonsContainer.MoveToX(0, button_duration, EasingTypes.OutQuint);
|
||||||
section.ButtonsContainer.FadeIn(button_duration, EasingTypes.OutQuint);
|
section.ButtonsContainer.FadeIn(button_duration, EasingTypes.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
Schedule(TriggerFocusContention);
|
||||||
|
|
||||||
protected override void TransitionOut()
|
|
||||||
{
|
|
||||||
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, CONTENT_EXIT_DURATION, EasingTypes.InSine);
|
|
||||||
rankedMultiplerContainer.FadeOut(CONTENT_EXIT_DURATION, EasingTypes.InSine);
|
|
||||||
|
|
||||||
foreach (ModSection section in sections)
|
|
||||||
{
|
|
||||||
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), CONTENT_EXIT_DURATION, EasingTypes.InSine);
|
|
||||||
section.ButtonsContainer.MoveToX(100f, CONTENT_EXIT_DURATION, EasingTypes.InSine);
|
|
||||||
section.ButtonsContainer.FadeOut(CONTENT_EXIT_DURATION, EasingTypes.InSine);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeselectAll()
|
public void DeselectAll()
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
|
|||||||
new OsuCheckbox
|
new OsuCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Fullscreen mode",
|
LabelText = "Fullscreen mode",
|
||||||
Bindable = config.GetBindable<bool>(FrameworkConfig.Fullscreen),
|
//Bindable = config.GetBindable<bool>(FrameworkConfig.Fullscreen),
|
||||||
},
|
},
|
||||||
new OsuCheckbox
|
new OsuCheckbox
|
||||||
{
|
{
|
||||||
|
@ -15,20 +15,17 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
public abstract class WaveOverlayContainer : OverlayContainer
|
public abstract class WaveOverlayContainer : OverlayContainer
|
||||||
{
|
{
|
||||||
private const float container_wait = 200;
|
protected const float CONTENT_DURATION = 800;
|
||||||
private const float waves_container_duration = 400;
|
|
||||||
private const float content_duration = 700;
|
|
||||||
private const float content_transition_wait = 100;
|
|
||||||
|
|
||||||
internal const float CONTENT_EXIT_DURATION = 600;
|
private const EasingTypes easing_show = EasingTypes.OutSine;
|
||||||
|
private const EasingTypes easing_hide = EasingTypes.InSine;
|
||||||
private const float waves_container_position = -150;
|
|
||||||
|
|
||||||
private Wave firstWave, secondWave, thirdWave, fourthWave;
|
private Wave firstWave, secondWave, thirdWave, fourthWave;
|
||||||
|
|
||||||
private Container<Wave> wavesContainer;
|
private Container<Wave> wavesContainer;
|
||||||
|
|
||||||
private readonly Container contentContainer;
|
private readonly Container contentContainer;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => contentContainer;
|
protected override Container<Drawable> Content => contentContainer;
|
||||||
|
|
||||||
public Color4 FirstWaveColour
|
public Color4 FirstWaveColour
|
||||||
@ -83,57 +80,10 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
|
||||||
{
|
|
||||||
foreach (var w in wavesContainer.Children)
|
|
||||||
w.State = Visibility.Visible;
|
|
||||||
|
|
||||||
DelayReset();
|
|
||||||
Delay(container_wait);
|
|
||||||
Schedule(() =>
|
|
||||||
{
|
|
||||||
if (State == Visibility.Visible)
|
|
||||||
{
|
|
||||||
//wavesContainer.MoveToY(waves_container_position, waves_container_duration, EasingTypes.None);
|
|
||||||
contentContainer.FadeIn(content_duration, EasingTypes.OutQuint);
|
|
||||||
contentContainer.MoveToY(0, content_duration, EasingTypes.OutQuint);
|
|
||||||
|
|
||||||
Delay(content_transition_wait);
|
|
||||||
Schedule(() => { if (State == Visibility.Visible) TransitionIn(); });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void TransitionIn();
|
|
||||||
|
|
||||||
protected override void PopOut()
|
|
||||||
{
|
|
||||||
contentContainer.FadeOut(CONTENT_EXIT_DURATION, EasingTypes.InSine);
|
|
||||||
contentContainer.MoveToY(DrawHeight, CONTENT_EXIT_DURATION, EasingTypes.InSine);
|
|
||||||
TransitionOut();
|
|
||||||
|
|
||||||
foreach (var w in wavesContainer.Children)
|
|
||||||
w.State = Visibility.Hidden;
|
|
||||||
|
|
||||||
DelayReset();
|
|
||||||
Delay(container_wait);
|
|
||||||
//wavesContainer.MoveToY(0, waves_container_duration);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void TransitionOut();
|
|
||||||
|
|
||||||
public WaveOverlayContainer()
|
public WaveOverlayContainer()
|
||||||
{
|
{
|
||||||
Masking = true;
|
Masking = true;
|
||||||
|
|
||||||
const int wave_count = 4;
|
|
||||||
|
|
||||||
const float total_duration = 800;
|
|
||||||
const float duration_change = 0;
|
|
||||||
|
|
||||||
float appearDuration = total_duration - wave_count * duration_change;
|
|
||||||
float disappearDuration = total_duration;
|
|
||||||
|
|
||||||
AddInternal(wavesContainer = new Container<Wave>
|
AddInternal(wavesContainer = new Container<Wave>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -144,34 +94,26 @@ namespace osu.Game.Overlays
|
|||||||
firstWave = new Wave
|
firstWave = new Wave
|
||||||
{
|
{
|
||||||
Rotation = 13,
|
Rotation = 13,
|
||||||
FinalPosition = -830,
|
FinalPosition = -930,
|
||||||
TransitionDurationAppear = (appearDuration += duration_change),
|
|
||||||
TransitionDurationDisappear = (disappearDuration -= duration_change),
|
|
||||||
},
|
},
|
||||||
secondWave = new Wave
|
secondWave = new Wave
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Rotation = -7,
|
Rotation = -7,
|
||||||
FinalPosition = -460,
|
FinalPosition = -560,
|
||||||
TransitionDurationAppear = (appearDuration += duration_change),
|
|
||||||
TransitionDurationDisappear = (disappearDuration -= duration_change),
|
|
||||||
},
|
},
|
||||||
thirdWave = new Wave
|
thirdWave = new Wave
|
||||||
{
|
{
|
||||||
Rotation = 4,
|
Rotation = 4,
|
||||||
FinalPosition = -290,
|
FinalPosition = -390,
|
||||||
TransitionDurationAppear = (appearDuration += duration_change),
|
|
||||||
TransitionDurationDisappear = (disappearDuration -= duration_change),
|
|
||||||
},
|
},
|
||||||
fourthWave = new Wave
|
fourthWave = new Wave
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Rotation = -2,
|
Rotation = -2,
|
||||||
FinalPosition = -120,
|
FinalPosition = -220,
|
||||||
TransitionDurationAppear = (appearDuration += duration_change),
|
|
||||||
TransitionDurationDisappear = (disappearDuration -= duration_change),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -192,11 +134,27 @@ namespace osu.Game.Overlays
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void PopIn()
|
||||||
|
{
|
||||||
|
foreach (var w in wavesContainer.Children)
|
||||||
|
w.State = Visibility.Visible;
|
||||||
|
|
||||||
|
contentContainer.FadeIn(CONTENT_DURATION, EasingTypes.OutQuint);
|
||||||
|
contentContainer.MoveToY(0, CONTENT_DURATION, EasingTypes.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void PopOut()
|
||||||
|
{
|
||||||
|
contentContainer.FadeOut(CONTENT_DURATION, easing_hide);
|
||||||
|
contentContainer.MoveToY(DrawHeight * 2f, CONTENT_DURATION, easing_hide);
|
||||||
|
|
||||||
|
foreach (var w in wavesContainer.Children)
|
||||||
|
w.State = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
|
||||||
class Wave : Container, IStateful<Visibility>
|
class Wave : Container, IStateful<Visibility>
|
||||||
{
|
{
|
||||||
public float FinalPosition;
|
public float FinalPosition;
|
||||||
public float TransitionDurationAppear;
|
|
||||||
public float TransitionDurationDisappear;
|
|
||||||
|
|
||||||
public Wave()
|
public Wave()
|
||||||
{
|
{
|
||||||
@ -231,10 +189,10 @@ namespace osu.Game.Overlays
|
|||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case Visibility.Hidden:
|
case Visibility.Hidden:
|
||||||
MoveToY(DrawHeight / Height, TransitionDurationDisappear, EasingTypes.OutSine);
|
MoveToY(DrawHeight / Height, CONTENT_DURATION, easing_hide);
|
||||||
break;
|
break;
|
||||||
case Visibility.Visible:
|
case Visibility.Visible:
|
||||||
MoveToY(FinalPosition, TransitionDurationAppear, EasingTypes.Out);
|
MoveToY(FinalPosition, CONTENT_DURATION, easing_show);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user