mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge branch 'master' into general-fixes
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Modes.Objects
|
||||
{
|
||||
public abstract class HitObjectConverter<T>
|
||||
where T : HitObject
|
||||
{
|
||||
public abstract List<T> Convert(Beatmap beatmap);
|
||||
}
|
||||
|
||||
public class HitObjectConvertException : Exception
|
||||
{
|
||||
public HitObject Input { get; }
|
||||
public HitObjectConvertException(string modeName, HitObject input)
|
||||
: base($@"Can't convert from {input.GetType().Name} to {modeName} HitObject!")
|
||||
{
|
||||
Input = input;
|
||||
}
|
||||
}
|
||||
}
|
@ -258,13 +258,13 @@ namespace osu.Game
|
||||
return false;
|
||||
}
|
||||
|
||||
public event Action<Screen> ModeChanged;
|
||||
public event Action<Screen> ScreenChanged;
|
||||
|
||||
private Container mainContent;
|
||||
|
||||
private Container overlayContent;
|
||||
|
||||
private void modeChanged(Screen newScreen)
|
||||
private void screenChanged(Screen newScreen)
|
||||
{
|
||||
//central game mode change logic.
|
||||
if ((newScreen as OsuScreen)?.ShowOverlays != true)
|
||||
@ -281,7 +281,7 @@ namespace osu.Game
|
||||
if (newScreen is MainMenu)
|
||||
Cursor.FadeIn(100);
|
||||
|
||||
ModeChanged?.Invoke(newScreen);
|
||||
ScreenChanged?.Invoke(newScreen);
|
||||
|
||||
if (newScreen == null)
|
||||
Exit();
|
||||
@ -315,12 +315,12 @@ namespace osu.Game
|
||||
newScreen.ModePushed += screenAdded;
|
||||
newScreen.Exited += screenRemoved;
|
||||
|
||||
modeChanged(newScreen);
|
||||
screenChanged(newScreen);
|
||||
}
|
||||
|
||||
private void screenRemoved(Screen newScreen)
|
||||
{
|
||||
modeChanged(newScreen);
|
||||
screenChanged(newScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.beatmaps = beatmaps;
|
||||
trackManager = osuGame.Audio.Track;
|
||||
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||
@ -247,6 +247,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
if (current.Track.HasCompleted && !current.Track.Looping) next();
|
||||
}
|
||||
else
|
||||
playButton.Icon = FontAwesome.fa_play_circle_o;
|
||||
}
|
||||
|
||||
private void preferUnicode_changed(object sender, EventArgs e)
|
||||
@ -337,12 +339,16 @@ namespace osu.Game.Overlays
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (beatmap?.Beatmap == null)
|
||||
//todo: we may need to display some default text here (currently in the constructor).
|
||||
return;
|
||||
|
||||
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
||||
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
|
||||
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
|
||||
{
|
||||
title.Text = @"Nothing to play";
|
||||
artist.Text = @"Nothing to play";
|
||||
}
|
||||
else
|
||||
{
|
||||
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
||||
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
|
||||
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
|
||||
}
|
||||
});
|
||||
|
||||
MusicControllerBackground newBackground;
|
||||
|
@ -16,7 +16,6 @@ using osu.Game.Database;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using System.Linq;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
@ -56,8 +55,15 @@ namespace osu.Game.Screens.Select
|
||||
public void UpdateBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
if (beatmap?.BeatmapInfo == null)
|
||||
{
|
||||
FadeOut(250);
|
||||
beatmapInfoContainer?.FadeOut(250);
|
||||
beatmapInfoContainer?.Expire();
|
||||
beatmapInfoContainer = null;
|
||||
return;
|
||||
}
|
||||
|
||||
FadeIn(250);
|
||||
var lastContainer = beatmapInfoContainer;
|
||||
|
||||
float newDepth = lastContainer?.Depth + 1 ?? 0;
|
||||
@ -84,7 +90,7 @@ namespace osu.Game.Screens.Select
|
||||
}));
|
||||
|
||||
//get statistics fromt he current ruleset.
|
||||
Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).ForEach(s => labels.Add(new InfoLabel(s)));
|
||||
labels.AddRange(Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s)));
|
||||
}
|
||||
|
||||
(beatmapInfoContainer = new BufferedContainer
|
||||
@ -191,7 +197,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private string getBPMRange(Beatmap beatmap)
|
||||
{
|
||||
double bpmMax = beatmap.BPMMaximum;
|
||||
double bpmMax = beatmap.BPMMaximum;
|
||||
double bpmMin = beatmap.BPMMinimum;
|
||||
|
||||
if (Precision.AlmostEquals(bpmMin, bpmMax)) return Math.Round(bpmMin) + "bpm";
|
||||
|
@ -57,6 +57,7 @@ namespace osu.Game.Screens.Select
|
||||
public void RemoveGroup(BeatmapGroup group)
|
||||
{
|
||||
groups.Remove(group);
|
||||
panels.Remove(group.Header);
|
||||
foreach (var p in group.BeatmapPanels)
|
||||
panels.Remove(p);
|
||||
|
||||
|
@ -326,8 +326,7 @@ namespace osu.Game.Screens.Select
|
||||
backgroundModeBeatmap.FadeTo(1, 250);
|
||||
}
|
||||
|
||||
if (beatmap != null)
|
||||
beatmapInfoWedge.UpdateBeatmap(beatmap);
|
||||
beatmapInfoWedge.UpdateBeatmap(beatmap);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -337,11 +336,11 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
base.OnBeatmapChanged(beatmap);
|
||||
|
||||
beatmap.Mods.BindTo(modSelect.SelectedMods);
|
||||
beatmap?.Mods.BindTo(modSelect.SelectedMods);
|
||||
|
||||
//todo: change background in selectionChanged instead; support per-difficulty backgrounds.
|
||||
changeBackground(beatmap);
|
||||
carousel.SelectBeatmap(beatmap.BeatmapInfo);
|
||||
carousel.SelectBeatmap(beatmap?.BeatmapInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
-->
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
@ -114,7 +114,6 @@
|
||||
<Compile Include="Beatmaps\Drawables\Panel.cs" />
|
||||
<Compile Include="Modes\Objects\Drawables\DrawableHitObject.cs" />
|
||||
<Compile Include="Modes\Objects\HitObject.cs" />
|
||||
<Compile Include="Modes\Objects\HitObjectConverter.cs" />
|
||||
<Compile Include="Beatmaps\Samples\HitSampleInfo.cs" />
|
||||
<Compile Include="Beatmaps\Samples\SampleBank.cs" />
|
||||
<Compile Include="Beatmaps\Samples\SampleInfo.cs" />
|
||||
@ -342,7 +341,6 @@
|
||||
<None Include="..\osu.licenseheader">
|
||||
<Link>osu.licenseheader</Link>
|
||||
</None>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
|
Reference in New Issue
Block a user