Skip to content

Commit

Permalink
Kiai visualizer spin speed config support in skin.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
goodtrailer committed Apr 9, 2021
1 parent 4998b0f commit 85ef21c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions osu.Game.Rulesets.Soyokaze/Skinning/SkinnableKiaiVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public class SkinnableKiaiVisualizer : BeatSyncedContainer
private byte firstFlashOpacity;
private byte flashOpacity;

private float defaultSpin;
private float kiaiSpin;

private KiaiSquaresComposite composite = new KiaiSquaresComposite()
{
RelativeSizeAxes = Axes.Both,
Expand All @@ -47,6 +50,9 @@ private void load(ISkinSource skin)

flashColour = skin.GetConfig<SoyokazeSkinColour, Color4>(SoyokazeSkinColour.KiaiVisualizerFlash)?.Value ?? Color4.White;
flashOpacity = skin.GetConfig<SoyokazeSkinConfiguration, byte>(SoyokazeSkinConfiguration.KiaiVisualizerFlashOpacity)?.Value ?? 192;

defaultSpin = skin.GetConfig<SoyokazeSkinConfiguration, float>(SoyokazeSkinConfiguration.KiaiVisualizerDefaultSpin)?.Value ?? 1.5f;
kiaiSpin = skin.GetConfig<SoyokazeSkinConfiguration, float>(SoyokazeSkinConfiguration.KiaiVisualizerKiaiSpin)?.Value ?? -60f;
}

protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
Expand All @@ -58,13 +64,13 @@ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint,
else if (kiaiIndex % (int)timingPoint.TimeSignature == 0)
composite.FlashColour(flashColour.Opacity(flashOpacity), timingPoint.BeatLength * 2, Easing.In);

composite.Spin(timingPoint.BeatLength, -60f);
composite.Spin(timingPoint.BeatLength, kiaiSpin);

kiaiIndex++;
}
else
{
composite.Spin(timingPoint.BeatLength, 1.5f);
composite.Spin(timingPoint.BeatLength, defaultSpin);
kiaiIndex = 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ public enum SoyokazeSkinConfiguration
KiaiVisualizerDefaultOpacity,
KiaiVisualizerFirstFlashOpacity,
KiaiVisualizerFlashOpacity,
KiaiVisualizerDefaultSpin,
KiaiVisualizerKiaiSpin,
}
}

0 comments on commit 85ef21c

Please sign in to comment.