Skip to content

Commit

Permalink
Add toggle for star fountains in gameplay
Browse files Browse the repository at this point in the history
Addresses ppy#29792.
  • Loading branch information
peppy committed Oct 1, 2024
1 parent 7d756d0 commit 8cbfc0f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
4 changes: 3 additions & 1 deletion osu.Game/Configuration/OsuConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ protected override void InitialiseDefaults()
SetDefault(OsuSetting.LightenDuringBreaks, true);

SetDefault(OsuSetting.HitLighting, true);
SetDefault(OsuSetting.StarFountains, true);

SetDefault(OsuSetting.HUDVisibilityMode, HUDVisibilityMode.Always);
SetDefault(OsuSetting.ShowHealthDisplayWhenCantFail, true);
Expand Down Expand Up @@ -431,6 +432,7 @@ public enum OsuSetting
HideCountryFlags,
EditorTimelineShowTimingChanges,
EditorTimelineShowTicks,
AlwaysShowHoldForMenuButton
AlwaysShowHoldForMenuButton,
StarFountains
}
}
8 changes: 7 additions & 1 deletion osu.Game/Localisation/GraphicsSettingsStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public static class GraphicsSettingsStrings
/// </summary>
public static LocalisableString HitLighting => new TranslatableString(getKey(@"hit_lighting"), @"Hit lighting");

/// <summary>
/// "Star fountains"
/// </summary>
public static LocalisableString StarFountains => new TranslatableString(getKey(@"star_fountains"), @"Star fountains");

/// <summary>
/// "Screenshots"
/// </summary>
Expand Down Expand Up @@ -152,7 +157,8 @@ public static class GraphicsSettingsStrings
/// <summary>
/// "In order to change the renderer, the game will close. Please open it again."
/// </summary>
public static LocalisableString ChangeRendererConfirmation => new TranslatableString(getKey(@"change_renderer_configuration"), @"In order to change the renderer, the game will close. Please open it again.");
public static LocalisableString ChangeRendererConfirmation =>
new TranslatableString(getKey(@"change_renderer_configuration"), @"In order to change the renderer, the game will close. Please open it again.");

/// <summary>
/// "Minimise osu! when switching to another app"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ private void load(OsuConfigManager config)
LabelText = GraphicsSettingsStrings.HitLighting,
Current = config.GetBindable<bool>(OsuSetting.HitLighting)
},
new SettingsCheckbox
{
LabelText = GraphicsSettingsStrings.StarFountains,
Current = config.GetBindable<bool>(OsuSetting.StarFountains)
},
};
}
}
Expand Down
14 changes: 12 additions & 2 deletions osu.Game/Screens/Play/KiaiGameplayFountains.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable
using System;
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Configuration;
using osu.Game.Graphics.Containers;
using osu.Game.Screens.Menu;

Expand All @@ -18,8 +19,10 @@ public partial class KiaiGameplayFountains : BeatSyncedContainer
private StarFountain leftFountain = null!;
private StarFountain rightFountain = null!;

private Bindable<bool> configEnabled = null!;

[BackgroundDependencyLoader]
private void load()
private void load(OsuConfigManager config)
{
RelativeSizeAxes = Axes.Both;

Expand All @@ -38,6 +41,13 @@ private void load()
X = -75,
},
};

configEnabled = config.GetBindable<bool>(OsuSetting.StarFountains);
configEnabled.BindValueChanged(enabled =>
{
leftFountain.FadeTo(enabled.NewValue ? 1 : 0, 100);
rightFountain.FadeTo(enabled.NewValue ? 1 : 0, 100);
}, true);
}

private bool isTriggered;
Expand Down

0 comments on commit 8cbfc0f

Please sign in to comment.