1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 16:13:34 +08:00

fix config mistake

This commit is contained in:
Sheppsu 2024-09-04 03:37:52 -04:00
parent a549cdd5b9
commit c89597b060
11 changed files with 45 additions and 35 deletions

View File

@ -24,6 +24,11 @@ namespace osu.Game.Rulesets.Osu.Configuration
SetDefault(OsuRulesetSetting.ShowCursorTrail, true);
SetDefault(OsuRulesetSetting.ShowCursorRipples, false);
SetDefault(OsuRulesetSetting.PlayfieldBorderStyle, PlayfieldBorderStyle.None);
SetDefault(OsuRulesetSetting.ReplayHitMarkersEnabled, false);
SetDefault(OsuRulesetSetting.ReplayAimMarkersEnabled, false);
SetDefault(OsuRulesetSetting.ReplayAimLinesEnabled, false);
SetDefault(OsuRulesetSetting.ReplayCursorHideEnabled, false);
}
}
@ -34,5 +39,11 @@ namespace osu.Game.Rulesets.Osu.Configuration
ShowCursorTrail,
ShowCursorRipples,
PlayfieldBorderStyle,
// Replay
ReplayHitMarkersEnabled,
ReplayAimMarkersEnabled,
ReplayAimLinesEnabled,
ReplayCursorHideEnabled,
}
}

View File

@ -13,7 +13,6 @@ using osu.Game.Beatmaps.Legacy;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Overlays.Settings;
using osu.Game.Replays;
using osu.Game.Rulesets.Configuration;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Edit;
@ -361,8 +360,6 @@ namespace osu.Game.Rulesets.Osu
return adjustedDifficulty;
}
public override OsuAnalysisContainer CreateAnalysisContainer(Replay replay, Playfield playfield) => new OsuAnalysisContainer(replay, playfield);
public override bool EditorShowScrollSpeed => false;
}
}

View File

@ -68,5 +68,7 @@ namespace osu.Game.Rulesets.Osu.UI
return 0;
}
}
public override AnalysisContainer CreateAnalysisContainer(Replay replay) => new OsuAnalysisContainer(replay, this);
}
}

View File

@ -22,14 +22,14 @@ namespace osu.Game.Rulesets.Osu.UI
{
public new OsuAnalysisSettings AnalysisSettings => (OsuAnalysisSettings)base.AnalysisSettings;
protected new OsuPlayfield Playfield => (OsuPlayfield)base.Playfield;
protected new DrawableOsuRuleset DrawableRuleset => (DrawableOsuRuleset)base.DrawableRuleset;
protected HitMarkersContainer HitMarkers;
protected AimMarkersContainer AimMarkers;
protected AimLinesContainer AimLines;
public OsuAnalysisContainer(Replay replay, Playfield playfield)
: base(replay, playfield)
public OsuAnalysisContainer(Replay replay, DrawableRuleset drawableRuleset)
: base(replay, drawableRuleset)
{
InternalChildren = new Drawable[]
{
@ -37,12 +37,11 @@ namespace osu.Game.Rulesets.Osu.UI
HitMarkers = new HitMarkersContainer(),
AimMarkers = new AimMarkersContainer { Depth = float.MinValue }
};
}
protected override OsuAnalysisSettings CreateAnalysisSettings()
protected override OsuAnalysisSettings CreateAnalysisSettings(Ruleset ruleset)
{
var settings = new OsuAnalysisSettings();
var settings = new OsuAnalysisSettings((OsuRuleset)ruleset);
settings.HitMarkersEnabled.ValueChanged += e => toggleHitMarkers(e.NewValue);
settings.AimMarkersEnabled.ValueChanged += e => toggleAimMarkers(e.NewValue);
settings.AimLinesEnabled.ValueChanged += e => toggleAimLines(e.NewValue);
@ -67,7 +66,7 @@ namespace osu.Game.Rulesets.Osu.UI
private void toggleAimLines(bool value) => AimLines.FadeTo(value ? 1 : 0);
private void toggleCursorHidden(bool value) => Playfield.Cursor.FadeTo(value ? 0 : 1);
private void toggleCursorHidden(bool value) => DrawableRuleset.Playfield.Cursor.FadeTo(value ? 0 : 1);
protected void LoadReplay()
{

View File

@ -4,12 +4,18 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Configuration;
using osu.Game.Rulesets.Osu.Configuration;
using osu.Game.Screens.Play.PlayerSettings;
namespace osu.Game.Rulesets.Osu.UI
{
public partial class OsuAnalysisSettings : AnalysisSettings
{
public OsuAnalysisSettings(Ruleset ruleset)
: base(ruleset)
{
}
[SettingSource("Hit markers", SettingControlType = typeof(PlayerCheckbox))]
public BindableBool HitMarkersEnabled { get; } = new BindableBool();
@ -23,12 +29,13 @@ namespace osu.Game.Rulesets.Osu.UI
public BindableBool CursorHideEnabled { get; } = new BindableBool();
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
private void load(IRulesetConfigCache cache)
{
config.BindWith(OsuSetting.ReplayHitMarkersEnabled, HitMarkersEnabled);
config.BindWith(OsuSetting.ReplayAimMarkersEnabled, AimMarkersEnabled);
config.BindWith(OsuSetting.ReplayAimLinesEnabled, AimLinesEnabled);
config.BindWith(OsuSetting.ReplayCursorHideEnabled, CursorHideEnabled);
var config = (OsuRulesetConfigManager)cache.GetConfigFor(Ruleset)!;
config.BindWith(OsuRulesetSetting.ReplayHitMarkersEnabled, HitMarkersEnabled);
config.BindWith(OsuRulesetSetting.ReplayAimMarkersEnabled, AimMarkersEnabled);
config.BindWith(OsuRulesetSetting.ReplayAimLinesEnabled, AimLinesEnabled);
config.BindWith(OsuRulesetSetting.ReplayCursorHideEnabled, CursorHideEnabled);
}
}
}

View File

@ -154,12 +154,6 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.IncreaseFirstObjectVisibility, true);
SetDefault(OsuSetting.GameplayDisableWinKey, true);
// Replay
SetDefault(OsuSetting.ReplayHitMarkersEnabled, false);
SetDefault(OsuSetting.ReplayAimMarkersEnabled, false);
SetDefault(OsuSetting.ReplayAimLinesEnabled, false);
SetDefault(OsuSetting.ReplayCursorHideEnabled, false);
// Update
SetDefault(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
@ -419,10 +413,6 @@ namespace osu.Game.Configuration
EditorShowHitMarkers,
EditorAutoSeekOnPlacement,
DiscordRichPresence,
ReplayHitMarkersEnabled,
ReplayAimMarkersEnabled,
ReplayAimLinesEnabled,
ReplayCursorHideEnabled,
ShowOnlineExplicitContent,
LastProcessedMetadataId,

View File

@ -17,7 +17,6 @@ using osu.Game.Beatmaps.Legacy;
using osu.Game.Configuration;
using osu.Game.Extensions;
using osu.Game.Overlays.Settings;
using osu.Game.Replays;
using osu.Game.Rulesets.Configuration;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Edit;
@ -409,7 +408,5 @@ namespace osu.Game.Rulesets
public virtual bool EditorShowScrollSpeed => true;
public virtual DifficultySection? CreateEditorDifficultySection() => null;
public virtual AnalysisContainer? CreateAnalysisContainer(Replay replay, Playfield playfield) => null;
}
}

View File

@ -10,18 +10,18 @@ namespace osu.Game.Rulesets.UI
public abstract partial class AnalysisContainer : Container
{
protected Replay Replay;
protected Playfield Playfield;
protected DrawableRuleset DrawableRuleset;
public AnalysisSettings AnalysisSettings;
public AnalysisContainer(Replay replay, Playfield playfield)
protected AnalysisContainer(Replay replay, DrawableRuleset drawableRuleset)
{
Replay = replay;
Playfield = playfield;
DrawableRuleset = drawableRuleset;
AnalysisSettings = CreateAnalysisSettings();
AnalysisSettings = CreateAnalysisSettings(drawableRuleset.Ruleset);
}
protected abstract AnalysisSettings CreateAnalysisSettings();
protected abstract AnalysisSettings CreateAnalysisSettings(Ruleset ruleset);
}
}

View File

@ -596,6 +596,8 @@ namespace osu.Game.Rulesets.UI
/// Invoked when the user requests to pause while the resume overlay is active.
/// </summary>
public abstract void CancelResume();
public virtual AnalysisContainer CreateAnalysisContainer(Replay replay) => null;
}
public class BeatmapInvalidForRulesetException : ArgumentException

View File

@ -2,14 +2,19 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Configuration;
using osu.Game.Rulesets;
namespace osu.Game.Screens.Play.PlayerSettings
{
public partial class AnalysisSettings : PlayerSettingsGroup
{
public AnalysisSettings()
protected Ruleset Ruleset;
public AnalysisSettings(Ruleset ruleset)
: base("Analysis Settings")
{
Ruleset = ruleset;
AddRange(this.CreateSettingsControls());
}
}

View File

@ -72,7 +72,7 @@ namespace osu.Game.Screens.Play
HUDOverlay.PlayerSettingsOverlay.AddAtStart(playbackSettings);
var analysisContainer = DrawableRuleset.Ruleset.CreateAnalysisContainer(GameplayState.Score.Replay, DrawableRuleset.Playfield);
var analysisContainer = DrawableRuleset.CreateAnalysisContainer(GameplayState.Score.Replay);
if (analysisContainer != null)
{