1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-16 00:37:19 +08:00

Merge branch 'master' into break-overlay-double-parallax

This commit is contained in:
Dan Balasescu 2018-08-24 15:10:28 +09:00 committed by GitHub
commit 83ca3053c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 27 additions and 23 deletions

View File

@ -25,9 +25,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
PatternType lastStair, IBeatmap originalBeatmap) PatternType lastStair, IBeatmap originalBeatmap)
: base(random, hitObject, beatmap, previousPattern, originalBeatmap) : base(random, hitObject, beatmap, previousPattern, originalBeatmap)
{ {
if (previousTime > hitObject.StartTime) throw new ArgumentOutOfRangeException(nameof(previousTime));
if (density < 0) throw new ArgumentOutOfRangeException(nameof(density));
StairType = lastStair; StairType = lastStair;
TimingControlPoint timingPoint = beatmap.ControlPointInfo.TimingPointAt(hitObject.StartTime); TimingControlPoint timingPoint = beatmap.ControlPointInfo.TimingPointAt(hitObject.StartTime);

View File

@ -351,7 +351,11 @@ namespace osu.Game.Beatmaps
// let's make sure there are actually .osu files to import. // let's make sure there are actually .osu files to import.
string mapName = reader.Filenames.FirstOrDefault(f => f.EndsWith(".osu")); string mapName = reader.Filenames.FirstOrDefault(f => f.EndsWith(".osu"));
if (string.IsNullOrEmpty(mapName)) if (string.IsNullOrEmpty(mapName))
throw new InvalidOperationException($"No beatmap files found in this beatmap archive ({reader.Name})."); {
// Todo: This is temporary for debugging purposes
var files = reader.Filenames.ToList();
throw new InvalidOperationException($"No beatmap files found in this beatmap archive. Files ({files.Count}): {string.Join(", ", files)}");
}
Beatmap beatmap; Beatmap beatmap;
using (var stream = new StreamReader(reader.GetStream(mapName))) using (var stream = new StreamReader(reader.GetStream(mapName)))

View File

@ -55,11 +55,11 @@ namespace osu.Game.Beatmaps.Formats
} while (line != null && line.Length == 0); } while (line != null && line.Length == 0);
if (line == null) if (line == null)
throw new IOException(@"Unknown file format"); throw new IOException(@"Unknown file format (null)");
var decoder = typedDecoders.Select(d => line.StartsWith(d.Key) ? d.Value : null).FirstOrDefault(); var decoder = typedDecoders.Select(d => line.StartsWith(d.Key, StringComparison.InvariantCulture) ? d.Value : null).FirstOrDefault();
if (decoder == null) if (decoder == null)
throw new IOException(@"Unknown file format"); throw new IOException($@"Unknown file format ({line})");
return (Decoder<T>)decoder.Invoke(line); return (Decoder<T>)decoder.Invoke(line);
} }

View File

@ -96,8 +96,7 @@ namespace osu.Game.Overlays
base.LoadComplete(); base.LoadComplete();
StateChanged += _ => updateProcessingMode(); StateChanged += _ => updateProcessingMode();
OverlayActivationMode.ValueChanged += _ => updateProcessingMode(); OverlayActivationMode.BindValueChanged(_ => updateProcessingMode(), true);
OverlayActivationMode.TriggerChange();
} }
private int totalCount => sections.Select(c => c.DisplayedCount).Sum(); private int totalCount => sections.Select(c => c.DisplayedCount).Sum();

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Shaders;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
using OpenTK; using OpenTK;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Overlays;
namespace osu.Game.Screens namespace osu.Game.Screens
{ {
@ -18,6 +19,8 @@ namespace osu.Game.Screens
protected override bool HideOverlaysOnEnter => true; protected override bool HideOverlaysOnEnter => true;
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled;
protected override bool AllowBackButton => false; protected override bool AllowBackButton => false;
public Loader() public Loader()

View File

@ -174,6 +174,9 @@ namespace osu.Game.Screens.Menu
ButtonSystemState lastState = state; ButtonSystemState lastState = state;
state = value; state = value;
if (game != null)
game.OverlayActivationMode.Value = state == ButtonSystemState.Exit ? OverlayActivation.Disabled : OverlayActivation.All;
updateLogoState(lastState); updateLogoState(lastState);
Logger.Log($"{nameof(ButtonSystem)}'s state changed from {lastState} to {state}"); Logger.Log($"{nameof(ButtonSystem)}'s state changed from {lastState} to {state}");
@ -205,11 +208,7 @@ namespace osu.Game.Screens.Menu
{ {
logoTracking = false; logoTracking = false;
if (game != null) game?.Toolbar.Hide();
{
game.OverlayActivationMode.Value = state == ButtonSystemState.Exit ? OverlayActivation.Disabled : OverlayActivation.All;
game.Toolbar.Hide();
}
logo.ClearTransforms(targetMember: nameof(Position)); logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.Both; logo.RelativePositionAxes = Axes.Both;
@ -243,11 +242,7 @@ namespace osu.Game.Screens.Menu
if (impact) if (impact)
logo.Impact(); logo.Impact();
if (game != null) game?.Toolbar.Show();
{
game.OverlayActivationMode.Value = OverlayActivation.All;
game.Toolbar.State = Visibility.Visible;
}
}, 200); }, 200);
break; break;
default: default:

View File

@ -85,12 +85,10 @@ namespace osu.Game.Skinning
private void load(OsuConfigManager config) private void load(OsuConfigManager config)
{ {
beatmapSkins = config.GetBindable<bool>(OsuSetting.BeatmapSkins); beatmapSkins = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapSkins.ValueChanged += val => onSourceChanged(); beatmapSkins.BindValueChanged(_ => onSourceChanged());
beatmapSkins.TriggerChange();
beatmapHitsounds = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds); beatmapHitsounds = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
beatmapHitsounds.ValueChanged += val => onSourceChanged(); beatmapHitsounds.BindValueChanged(_ => onSourceChanged(), true);
beatmapHitsounds.TriggerChange();
} }
protected override void LoadComplete() protected override void LoadComplete()

View File

@ -52,5 +52,13 @@ namespace osu.Game.Skinning
protected virtual void SkinChanged(ISkinSource skin, bool allowFallback) protected virtual void SkinChanged(ISkinSource skin, bool allowFallback)
{ {
} }
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
if (skin != null)
skin.SourceChanged -= onChange;
}
} }
} }