Skip to content

Commit

Permalink
Merge pull request #216 from Beamographic/dependabot/nuget/ppy.osu.Ga…
Browse files Browse the repository at this point in the history
…me-2022.126.0

Bump ppy.osu.Game from 2022.108.0 to 2022.127.0
  • Loading branch information
LumpBloom7 authored Jan 27, 2022
2 parents 8ed846e + 3498b2c commit 0e6069b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Rush.Tests/VisualTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class VisualTestRunner
[STAThread]
public static int Main(string[] args)
{
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true))
using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu", new HostOptions { BindIPC = true }))
{
host.Run(new OsuTestBrowser());
return 0;
Expand Down
39 changes: 24 additions & 15 deletions osu.Game.Rulesets.Rush/Mods/RushModFlashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Layout;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Rush.Objects;
using osu.Game.Rulesets.Rush.UI;
Expand All @@ -16,9 +17,26 @@ public class RushModFlashlight : ModFlashlight<RushHitObject>
{
public override double ScoreMultiplier => 1.12;

private const float default_flashlight_size = 330;
public override float DefaultFlashlightSize => 330;

public override Flashlight CreateFlashlight() => new RushFlashlight(playfield);
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableNumber<float> SizeMultiplier { get; } = new BindableNumber<float>
{
MinValue = 0.5f,
MaxValue = 1.5f,
Default = 1f,
Value = 1f,
Precision = 0.1f
};

[SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")]
public override BindableBool ComboBasedSize { get; } = new BindableBool
{
Default = true,
Value = true
};

protected override Flashlight CreateFlashlight() => new RushFlashlight(this, playfield);

private RushPlayfield playfield;

Expand All @@ -31,29 +49,20 @@ public override void ApplyToDrawableRuleset(DrawableRuleset<RushHitObject> drawa
private class RushFlashlight : Flashlight
{
private readonly LayoutValue flashlightProperties = new LayoutValue(Invalidation.DrawSize);

private readonly RushPlayfield rushPlayfield;

public RushFlashlight(RushPlayfield rushPlayfield)
public RushFlashlight(ModFlashlight modFlashlight, RushPlayfield rushPlayfield) : base(modFlashlight)
{
this.rushPlayfield = rushPlayfield;
FlashlightSize = new Vector2(0, getSizeFor(0));
FlashlightSize = new Vector2(0, GetSizeFor(0));

AddLayout(flashlightProperties);
}

private float getSizeFor(int combo)
{
if (combo > 200)
return default_flashlight_size * 0.8f;
else if (combo > 100)
return default_flashlight_size * 0.9f;
else
return default_flashlight_size;
}

protected override void OnComboChange(ValueChangedEvent<int> e)
{
this.TransformTo(nameof(FlashlightSize), new Vector2(0, getSizeFor(e.NewValue)), FLASHLIGHT_FADE_DURATION);
this.TransformTo(nameof(FlashlightSize), new Vector2(0, GetSizeFor(e.NewValue)), FLASHLIGHT_FADE_DURATION);
}

protected override string FragmentShader => "CircularFlashlight";
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Rush/osu.Game.Rulesets.Rush.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2022.108.0" />
<PackageReference Include="ppy.osu.Game" Version="2022.127.0" />
</ItemGroup>
</Project>

0 comments on commit 0e6069b

Please sign in to comment.