-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ImproveArrowFlip
- Loading branch information
Showing
5 changed files
with
178 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
osu.Game.Rulesets.Hishigata/UI/Components/EffectsContainer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
using System; | ||
using osu.Framework.Audio.Track; | ||
using osu.Framework.Extensions.Color4Extensions; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Shapes; | ||
using osu.Framework.Utils; | ||
using osu.Game.Beatmaps.ControlPoints; | ||
using osu.Game.Graphics.Containers; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Hishigata.UI.Components | ||
{ | ||
public class EffectContainer : BeatSyncedContainer | ||
{ | ||
public EffectContainer() | ||
{ | ||
Anchor = Anchor.Centre; | ||
Origin = Anchor.Centre; | ||
RelativeSizeAxes = Axes.None; | ||
Rotation = 45; | ||
} | ||
|
||
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes) | ||
{ | ||
int MainBeatInterval = Math.Max((int)(timingPoint.BPM / 80), 1); | ||
|
||
if (effectPoint.KiaiMode) | ||
{ | ||
if ((beatIndex % MainBeatInterval) == 0) | ||
Add(new Effect(timingPoint.BeatLength, MainBeatInterval)); | ||
|
||
Add(new LineEffect(timingPoint.BeatLength)); | ||
} | ||
} | ||
|
||
public class LineEffect : CompositeDrawable | ||
{ | ||
private readonly double animDuration; | ||
|
||
public override bool RemoveWhenNotAlive => base.RemoveWhenNotAlive; | ||
|
||
public LineEffect(double duration) | ||
{ | ||
animDuration = duration; | ||
Size = new Vector2(450); | ||
Anchor = Anchor.Centre; | ||
Origin = Anchor.Centre; | ||
Masking = true; | ||
BorderThickness = 5; | ||
BorderColour = Color4.White; | ||
RelativeSizeAxes = Axes.None; | ||
Alpha = .8f; | ||
Colour = new Color4(RNG.NextSingle(.5f), RNG.NextSingle(.5f), RNG.NextSingle(.5f), 1); | ||
InternalChild = new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
AlwaysPresent = true, | ||
Alpha = 0, | ||
}; | ||
} | ||
|
||
protected override void LoadComplete() | ||
{ | ||
this.ScaleTo(6, animDuration * 2).FadeOut(animDuration * 2).Expire(true); | ||
} | ||
} | ||
|
||
public class Effect : CompositeDrawable | ||
{ | ||
private readonly double animDuration; | ||
private readonly double durationMultiplier; | ||
|
||
public override bool RemoveWhenNotAlive => base.RemoveWhenNotAlive; | ||
|
||
public Effect(double duration, double multiplier) | ||
{ | ||
animDuration = duration; | ||
durationMultiplier = multiplier; | ||
|
||
Size = new Vector2(450); | ||
Anchor = Anchor.Centre; | ||
Origin = Anchor.Centre; | ||
RelativeSizeAxes = Axes.None; | ||
Alpha = .4f; | ||
Colour = new Color4(RNG.NextSingle(.5f), RNG.NextSingle(.5f), RNG.NextSingle(.5f), 1); | ||
InternalChild = new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
}; | ||
} | ||
|
||
protected override void LoadComplete() | ||
{ | ||
this.ScaleTo(6 * (float)durationMultiplier, animDuration * 2 * durationMultiplier).FadeOut(animDuration * 2 * durationMultiplier).Expire(true); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using osu.Framework.Audio.Track; | ||
using osu.Framework.Extensions.Color4Extensions; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Shapes; | ||
using osu.Framework.Utils; | ||
using osu.Game.Beatmaps.ControlPoints; | ||
using osu.Game.Graphics.Containers; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
using System; | ||
|
||
namespace osu.Game.Rulesets.Hishigata.UI.Components | ||
{ | ||
public class Rhombus : BeatSyncedContainer | ||
{ | ||
public Rhombus() | ||
{ | ||
Anchor = Anchor.Centre; | ||
Origin = Anchor.Centre; | ||
RelativeSizeAxes = Axes.None; | ||
Size = new Vector2(450); | ||
Rotation = 45; | ||
Masking = true; | ||
BorderColour = Color4.Gray; | ||
BorderThickness = 10; | ||
Child = new Box | ||
{ | ||
Colour = Color4.Black, | ||
RelativeSizeAxes = Axes.Both, | ||
Alpha = .8f | ||
}; | ||
} | ||
|
||
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes) | ||
{ | ||
if (amplitudes.Maximum <= .01f) return; | ||
FinishTransforms(); | ||
this.ResizeTo(effectPoint.KiaiMode ? 459f : 454.5f, 100).Then().ResizeTo(450, 50); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters