mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 10:23:20 +08:00
Move EpilepsyWarning
out of BeatmapInfo
This commit is contained in:
parent
1ab86ebd24
commit
f64a0624a5
@ -955,7 +955,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
Assert.That(decoded.SpecialStyle, Is.False);
|
||||
Assert.That(decoded.LetterboxInBreaks, Is.False);
|
||||
Assert.That(decoded.WidescreenStoryboard, Is.False);
|
||||
Assert.That(decoded.BeatmapInfo.EpilepsyWarning, Is.False);
|
||||
Assert.That(decoded.EpilepsyWarning, Is.False);
|
||||
Assert.That(decoded.BeatmapInfo.SamplesMatchPlaybackRate, Is.False);
|
||||
Assert.That(decoded.BeatmapInfo.Countdown, Is.EqualTo(CountdownType.Normal));
|
||||
Assert.That(decoded.BeatmapInfo.CountdownOffset, Is.EqualTo(0));
|
||||
|
@ -138,7 +138,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
workingBeatmap.Beatmap.AudioLeadIn = 60000;
|
||||
|
||||
// Set up data for testing disclaimer display.
|
||||
workingBeatmap.BeatmapInfo.EpilepsyWarning = epilepsyWarning ?? false;
|
||||
workingBeatmap.Beatmap.EpilepsyWarning = epilepsyWarning ?? false;
|
||||
workingBeatmap.BeatmapInfo.Status = onlineStatus ?? BeatmapOnlineStatus.Ranked;
|
||||
|
||||
Beatmap.Value = workingBeatmap;
|
||||
|
@ -124,6 +124,8 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public bool WidescreenStoryboard { get; set; } = true;
|
||||
|
||||
public bool EpilepsyWarning { get; set; }
|
||||
|
||||
IBeatmap IBeatmap.Clone() => Clone();
|
||||
|
||||
public Beatmap<T> Clone() => (Beatmap<T>)MemberwiseClone();
|
||||
|
@ -72,6 +72,7 @@ namespace osu.Game.Beatmaps
|
||||
beatmap.SpecialStyle = original.SpecialStyle;
|
||||
beatmap.LetterboxInBreaks = original.LetterboxInBreaks;
|
||||
beatmap.WidescreenStoryboard = original.WidescreenStoryboard;
|
||||
beatmap.EpilepsyWarning = original.EpilepsyWarning;
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
|
@ -414,7 +414,6 @@ namespace osu.Game.Beatmaps
|
||||
Hash = hash,
|
||||
DifficultyName = decodedInfo.DifficultyName,
|
||||
OnlineID = decodedInfo.OnlineID,
|
||||
EpilepsyWarning = decodedInfo.EpilepsyWarning,
|
||||
SamplesMatchPlaybackRate = decodedInfo.SamplesMatchPlaybackRate,
|
||||
DistanceSpacing = decodedInfo.DistanceSpacing,
|
||||
BeatDivisor = decodedInfo.BeatDivisor,
|
||||
|
@ -138,8 +138,6 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
#region Properties we may not want persisted (but also maybe no harm?)
|
||||
|
||||
public bool EpilepsyWarning { get; set; }
|
||||
|
||||
public bool SamplesMatchPlaybackRate { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
|
@ -297,7 +297,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
break;
|
||||
|
||||
case @"EpilepsyWarning":
|
||||
beatmap.BeatmapInfo.EpilepsyWarning = Parsing.ParseInt(pair.Value) == 1;
|
||||
beatmap.EpilepsyWarning = Parsing.ParseInt(pair.Value) == 1;
|
||||
break;
|
||||
|
||||
case @"SamplesMatchPlaybackRate":
|
||||
|
@ -95,7 +95,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
// writer.WriteLine(@"OverlayPosition: " + b.OverlayPosition);
|
||||
// if (!string.IsNullOrEmpty(b.SkinPreference))
|
||||
// writer.WriteLine(@"SkinPreference:" + b.SkinPreference);
|
||||
if (beatmap.BeatmapInfo.EpilepsyWarning)
|
||||
if (beatmap.EpilepsyWarning)
|
||||
writer.WriteLine(@"EpilepsyWarning: 1");
|
||||
if (beatmap.BeatmapInfo.CountdownOffset > 0)
|
||||
writer.WriteLine(FormattableString.Invariant($@"CountdownOffset: {beatmap.BeatmapInfo.CountdownOffset}"));
|
||||
|
@ -78,6 +78,8 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
bool WidescreenStoryboard { get; internal set; }
|
||||
|
||||
bool EpilepsyWarning { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a shallow-clone of this beatmap and returns it.
|
||||
/// </summary>
|
||||
|
@ -367,6 +367,12 @@ namespace osu.Game.Rulesets.Difficulty
|
||||
set => baseBeatmap.WidescreenStoryboard = value;
|
||||
}
|
||||
|
||||
public bool EpilepsyWarning
|
||||
{
|
||||
get => baseBeatmap.EpilepsyWarning;
|
||||
set => baseBeatmap.EpilepsyWarning = value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -214,6 +214,12 @@ namespace osu.Game.Screens.Edit
|
||||
set => PlayableBeatmap.WidescreenStoryboard = value;
|
||||
}
|
||||
|
||||
public bool EpilepsyWarning
|
||||
{
|
||||
get => PlayableBeatmap.EpilepsyWarning;
|
||||
set => PlayableBeatmap.EpilepsyWarning = value;
|
||||
}
|
||||
|
||||
public IBeatmap Clone() => (EditorBeatmap)MemberwiseClone();
|
||||
|
||||
private IList mutableHitObjects => (IList)PlayableBeatmap.HitObjects;
|
||||
|
@ -74,7 +74,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
{
|
||||
Label = EditorSetupStrings.EpilepsyWarning,
|
||||
Description = EditorSetupStrings.EpilepsyWarningDescription,
|
||||
Current = { Value = Beatmap.BeatmapInfo.EpilepsyWarning }
|
||||
Current = { Value = Beatmap.EpilepsyWarning }
|
||||
},
|
||||
letterboxDuringBreaks = new LabelledSwitchButton
|
||||
{
|
||||
@ -122,7 +122,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
Beatmap.BeatmapInfo.CountdownOffset = int.TryParse(CountdownOffset.Current.Value, NumberStyles.None, CultureInfo.InvariantCulture, out int offset) ? offset : 0;
|
||||
|
||||
Beatmap.WidescreenStoryboard = widescreenSupport.Current.Value;
|
||||
Beatmap.BeatmapInfo.EpilepsyWarning = epilepsyWarning.Current.Value;
|
||||
Beatmap.EpilepsyWarning = epilepsyWarning.Current.Value;
|
||||
Beatmap.LetterboxInBreaks = letterboxDuringBreaks.Current.Value;
|
||||
Beatmap.BeatmapInfo.SamplesMatchPlaybackRate = samplesMatchPlaybackRate.Current.Value;
|
||||
|
||||
|
@ -228,7 +228,7 @@ namespace osu.Game.Screens.Play
|
||||
sampleRestart = new SkinnableSound(new SampleInfo(@"Gameplay/restart", @"pause-retry-click"))
|
||||
};
|
||||
|
||||
if (Beatmap.Value.BeatmapInfo.EpilepsyWarning)
|
||||
if (Beatmap.Value.Beatmap.EpilepsyWarning)
|
||||
{
|
||||
disclaimers.Add(epilepsyWarning = new PlayerLoaderDisclaimer(PlayerLoaderStrings.EpilepsyWarningTitle, PlayerLoaderStrings.EpilepsyWarningContent));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user