1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:23:21 +08:00

Merge branch 'master' into sudden-death

This commit is contained in:
Dan Balasescu 2017-11-21 17:32:31 +09:00 committed by GitHub
commit 142b74cc47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
77 changed files with 574 additions and 173 deletions

@ -1 +1 @@
Subproject commit 887db793c705b45071aea5e0c1cc931a7887165f
Subproject commit 14eb531c0056b8569f21b3571890383ffbea768e

View File

@ -3,7 +3,6 @@
using System;
using System.Diagnostics;
using System.Net.Http;
using osu.Framework.Allocation;
using osu.Framework.Development;
using osu.Framework.Graphics;
@ -198,10 +197,9 @@ namespace osu.Desktop.Overlays
}
}
}
catch (HttpRequestException)
catch (Exception)
{
//likely have no internet connection.
//we'll ignore this and retry later.
// we'll ignore this and retry later. can be triggered by no internet connection or thread abortion.
}
finally
{

View File

@ -36,7 +36,8 @@ namespace osu.Game.Tests.Visual
Username = @"peppy",
Id = 2,
Country = new Country { FlagName = @"AU" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
IsSupporter = true,
}) { Width = 300 },
},
});

View File

@ -483,7 +483,8 @@ namespace osu.Game.Beatmaps
using (var stream = new StreamReader(reader.GetStream(mapName)))
metadata = BeatmapDecoder.GetDecoder(stream).Decode(stream).Metadata;
beatmapSet = new BeatmapSetInfo
// check if a set already exists with the same online id.
beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID) ?? new BeatmapSetInfo
{
OnlineBeatmapSetID = metadata.OnlineBeatmapSetID,
Beatmaps = new List<BeatmapInfo>(),
@ -510,6 +511,10 @@ namespace osu.Game.Beatmaps
beatmap.BeatmapInfo.Hash = ms.ComputeSHA2Hash();
beatmap.BeatmapInfo.MD5Hash = ms.ComputeMD5Hash();
var existing = beatmaps.Beatmaps.FirstOrDefault(b => b.Hash == beatmap.BeatmapInfo.Hash || b.OnlineBeatmapID == beatmap.BeatmapInfo.OnlineBeatmapID);
if (existing == null)
{
// TODO: Diff beatmap metadata with set metadata and leave it here if necessary
beatmap.BeatmapInfo.Metadata = null;
@ -522,6 +527,7 @@ namespace osu.Game.Beatmaps
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
}
}
}
return beatmapSet;
}

View File

@ -7,7 +7,7 @@ using osu.Framework.Graphics.Sprites;
namespace osu.Game.Beatmaps.Drawables
{
internal class BeatmapBackgroundSprite : Sprite
public class BeatmapBackgroundSprite : Sprite
{
private readonly WorkingBeatmap working;

View File

@ -11,7 +11,7 @@ using osu.Game.Rulesets.UI;
namespace osu.Game.Beatmaps
{
internal class DummyWorkingBeatmap : WorkingBeatmap
public class DummyWorkingBeatmap : WorkingBeatmap
{
private readonly OsuGameBase game;

View File

@ -78,6 +78,7 @@ namespace osu.Game.Database
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<BeatmapInfo>().HasIndex(b => b.OnlineBeatmapID).IsUnique();
modelBuilder.Entity<BeatmapInfo>().HasIndex(b => b.MD5Hash).IsUnique();
modelBuilder.Entity<BeatmapInfo>().HasIndex(b => b.Hash).IsUnique();

View File

@ -66,7 +66,7 @@ namespace osu.Game.Graphics.UserInterface
}
private float textSize = 28;
internal float TextSize
public float TextSize
{
get
{

View File

@ -38,7 +38,7 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Key == Key.Escape)
if (!args.Repeat && args.Key == Key.Escape)
{
if (Text.Length > 0)
Text = string.Empty;

View File

@ -11,7 +11,7 @@ using osu.Game.Input.Bindings;
namespace osu.Game.Graphics.UserInterface.Volume
{
internal class VolumeControl : OverlayContainer
public class VolumeControl : OverlayContainer
{
private readonly VolumeMeter volumeMeterMaster;

View File

@ -8,7 +8,7 @@ using osu.Game.Input.Bindings;
namespace osu.Game.Graphics.UserInterface.Volume
{
internal class VolumeControlReceptor : Container, IKeyBindingHandler<GlobalAction>
public class VolumeControlReceptor : Container, IKeyBindingHandler<GlobalAction>
{
public Func<GlobalAction, bool> ActionRequested;

View File

@ -13,7 +13,7 @@ using osu.Game.Input.Bindings;
namespace osu.Game.Graphics.UserInterface.Volume
{
internal class VolumeMeter : Container, IKeyBindingHandler<GlobalAction>
public class VolumeMeter : Container, IKeyBindingHandler<GlobalAction>
{
private readonly Box meterFill;
public BindableDouble Bindable { get; } = new BindableDouble();

View File

@ -0,0 +1,302 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using osu.Game.Database;
using System;
namespace osu.Game.Migrations
{
[DbContext(typeof(OsuDbContext))]
[Migration("20171119065731_AddBeatmapOnlineIDUniqueConstraint")]
partial class AddBeatmapOnlineIDUniqueConstraint
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452");
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<float>("ApproachRate");
b.Property<float>("CircleSize");
b.Property<float>("DrainRate");
b.Property<float>("OverallDifficulty");
b.Property<float>("SliderMultiplier");
b.Property<float>("SliderTickRate");
b.HasKey("ID");
b.ToTable("BeatmapDifficulty");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<int>("AudioLeadIn");
b.Property<int>("BaseDifficultyID");
b.Property<int>("BeatDivisor");
b.Property<int>("BeatmapSetInfoID");
b.Property<bool>("Countdown");
b.Property<double>("DistanceSpacing");
b.Property<int>("GridSize");
b.Property<string>("Hash");
b.Property<bool>("Hidden");
b.Property<bool>("LetterboxInBreaks");
b.Property<string>("MD5Hash");
b.Property<int?>("MetadataID");
b.Property<int?>("OnlineBeatmapID");
b.Property<string>("Path");
b.Property<int>("RulesetID");
b.Property<bool>("SpecialStyle");
b.Property<float>("StackLeniency");
b.Property<double>("StarDifficulty");
b.Property<string>("StoredBookmarks");
b.Property<double>("TimelineZoom");
b.Property<string>("Version");
b.Property<bool>("WidescreenStoryboard");
b.HasKey("ID");
b.HasIndex("BaseDifficultyID");
b.HasIndex("BeatmapSetInfoID");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("MD5Hash")
.IsUnique();
b.HasIndex("MetadataID");
b.HasIndex("OnlineBeatmapID")
.IsUnique();
b.HasIndex("RulesetID");
b.ToTable("BeatmapInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<string>("Artist");
b.Property<string>("ArtistUnicode");
b.Property<string>("AudioFile");
b.Property<string>("AuthorString")
.HasColumnName("Author");
b.Property<string>("BackgroundFile");
b.Property<int>("PreviewTime");
b.Property<string>("Source");
b.Property<string>("Tags");
b.Property<string>("Title");
b.Property<string>("TitleUnicode");
b.HasKey("ID");
b.ToTable("BeatmapMetadata");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<int>("BeatmapSetInfoID");
b.Property<int>("FileInfoID");
b.Property<string>("Filename")
.IsRequired();
b.HasKey("ID");
b.HasIndex("BeatmapSetInfoID");
b.HasIndex("FileInfoID");
b.ToTable("BeatmapSetFileInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<bool>("DeletePending");
b.Property<string>("Hash");
b.Property<int?>("MetadataID");
b.Property<int?>("OnlineBeatmapSetID");
b.Property<bool>("Protected");
b.HasKey("ID");
b.HasIndex("DeletePending");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("MetadataID");
b.HasIndex("OnlineBeatmapSetID")
.IsUnique();
b.ToTable("BeatmapSetInfo");
});
modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<int>("IntAction")
.HasColumnName("Action");
b.Property<string>("KeysString")
.HasColumnName("Keys");
b.Property<int?>("RulesetID");
b.Property<int?>("Variant");
b.HasKey("ID");
b.HasIndex("IntAction");
b.HasIndex("Variant");
b.ToTable("KeyBinding");
});
modelBuilder.Entity("osu.Game.IO.FileInfo", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<string>("Hash");
b.Property<int>("ReferenceCount");
b.HasKey("ID");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("ReferenceCount");
b.ToTable("FileInfo");
});
modelBuilder.Entity("osu.Game.Rulesets.RulesetInfo", b =>
{
b.Property<int?>("ID")
.ValueGeneratedOnAdd();
b.Property<bool>("Available");
b.Property<string>("InstantiationInfo");
b.Property<string>("Name");
b.HasKey("ID");
b.HasIndex("Available");
b.ToTable("RulesetInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b =>
{
b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "BaseDifficulty")
.WithMany()
.HasForeignKey("BaseDifficultyID")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSet")
.WithMany("Beatmaps")
.HasForeignKey("BeatmapSetInfoID")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata")
.WithMany("Beatmaps")
.HasForeignKey("MetadataID");
b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset")
.WithMany()
.HasForeignKey("RulesetID")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b =>
{
b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo")
.WithMany("Files")
.HasForeignKey("BeatmapSetInfoID")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("osu.Game.IO.FileInfo", "FileInfo")
.WithMany()
.HasForeignKey("FileInfoID")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b =>
{
b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata")
.WithMany("BeatmapSets")
.HasForeignKey("MetadataID");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace osu.Game.Migrations
{
public partial class AddBeatmapOnlineIDUniqueConstraint : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_BeatmapInfo_OnlineBeatmapID",
table: "BeatmapInfo",
column: "OnlineBeatmapID",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_BeatmapInfo_OnlineBeatmapID",
table: "BeatmapInfo");
}
}
}

View File

@ -103,6 +103,9 @@ namespace osu.Game.Migrations
b.HasIndex("MetadataID");
b.HasIndex("OnlineBeatmapID")
.IsUnique();
b.HasIndex("RulesetID");
b.ToTable("BeatmapInfo");

View File

@ -6,7 +6,7 @@ using osu.Framework.IO.Network;
namespace osu.Game.Online.API
{
internal class OAuth
public class OAuth
{
private readonly string clientId;
private readonly string clientSecret;

View File

@ -8,7 +8,7 @@ using Newtonsoft.Json;
namespace osu.Game.Online.API
{
[Serializable]
internal class OAuthToken
public class OAuthToken
{
/// <summary>
/// OAuth 2.0 access token.

View File

@ -100,7 +100,7 @@ namespace osu.Game.Online.Multiplayer
}
}
internal class VersusRow : FillFlowContainer
public class VersusRow : FillFlowContainer
{
public VersusRow(Color4 first, Color4 second, float size)
{

View File

@ -58,7 +58,7 @@ namespace osu.Game.Overlays
private readonly Box chatBackground;
private readonly Box tabBackground;
public Bindable<double> ChatHeight { get; internal set; }
public Bindable<double> ChatHeight { get; set; }
private readonly Container channelSelectionContainer;
private readonly ChannelSelectionOverlay channelSelection;

View File

@ -19,7 +19,7 @@ using OpenTK.Input;
namespace osu.Game.Overlays.KeyBinding
{
internal class KeyBindingRow : Container, IFilterable
public class KeyBindingRow : Container, IFilterable
{
private readonly object action;
private readonly IEnumerable<Framework.Input.Bindings.KeyBinding> bindings;

View File

@ -55,7 +55,7 @@ namespace osu.Game.Overlays.KeyBinding
}
}
internal class ResetButton : OsuButton
public class ResetButton : OsuButton
{
[BackgroundDependencyLoader]
private void load(OsuColour colours)

View File

@ -13,7 +13,7 @@ using osu.Game.Graphics.Cursor;
namespace osu.Game.Overlays
{
internal class LoginOverlay : OsuFocusedOverlayContainer
public class LoginOverlay : OsuFocusedOverlayContainer
{
private LoginSettings settingsSection;

View File

@ -13,7 +13,7 @@ using System;
namespace osu.Game.Overlays.Music
{
internal class FilterControl : Container
public class FilterControl : Container
{
public readonly FilterTextBox Search;

View File

@ -17,7 +17,7 @@ using OpenTK;
namespace osu.Game.Overlays.Music
{
internal class PlaylistItem : Container, IFilterable, IDraggable
public class PlaylistItem : Container, IFilterable, IDraggable
{
private const float fade_duration = 100;

View File

@ -14,7 +14,7 @@ using OpenTK;
namespace osu.Game.Overlays.Music
{
internal class PlaylistList : CompositeDrawable
public class PlaylistList : CompositeDrawable
{
public Action<BeatmapSetInfo> OnSelect;

View File

@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
ShowMoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0);
ShowMoreLoading.Hide();
if (!sets.Any())
if (!sets.Any() && VisiblePages == 1)
{
MissingText.Show();
return;

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
ShowMoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0);
ShowMoreLoading.Hide();
if (!scores.Any())
if (!scores.Any() && VisiblePages == 1)
{
MissingText.Show();
return;

View File

@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Settings
private class RestoreDefaultValueButton : Box, IHasTooltip
{
private Bindable<T> bindable;
internal Bindable<T> Bindable
public Bindable<T> Bindable
{
get { return bindable; }
set
@ -185,13 +185,13 @@ namespace osu.Game.Overlays.Settings
UpdateState();
}
internal void SetButtonColour(Color4 buttonColour)
public void SetButtonColour(Color4 buttonColour)
{
this.buttonColour = buttonColour;
UpdateState();
}
internal void UpdateState()
public void UpdateState()
{
if (bindable == null)
return;

View File

@ -7,7 +7,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Settings
{
internal class SettingsLabel : SettingsItem<string>
public class SettingsLabel : SettingsItem<string>
{
protected override Drawable CreateControl() => null;

View File

@ -18,8 +18,8 @@ namespace osu.Game.Overlays.Settings
public class Sidebar : Container<SidebarButton>, IStateful<ExpandedState>
{
private readonly FillFlowContainer<SidebarButton> content;
internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
internal const int EXPANDED_WIDTH = 200;
public const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
public const int EXPANDED_WIDTH = 200;
public event Action<ExpandedState> StateChanged;

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays
{
public abstract class SettingsOverlay : OsuFocusedOverlayContainer
{
internal const float CONTENT_MARGINS = 10;
public const float CONTENT_MARGINS = 10;
public const float TRANSITION_LENGTH = 600;

View File

@ -6,7 +6,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarChatButton : ToolbarOverlayToggleButton
public class ToolbarChatButton : ToolbarOverlayToggleButton
{
public ToolbarChatButton()
{

View File

@ -6,7 +6,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarDirectButton : ToolbarOverlayToggleButton
public class ToolbarDirectButton : ToolbarOverlayToggleButton
{
public ToolbarDirectButton()
{

View File

@ -5,7 +5,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarHomeButton : ToolbarButton
public class ToolbarHomeButton : ToolbarButton
{
public ToolbarHomeButton()
{

View File

@ -14,7 +14,7 @@ using osu.Game.Rulesets;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarModeSelector : Container
public class ToolbarModeSelector : Container
{
private const float padding = 10;

View File

@ -6,7 +6,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarMusicButton : ToolbarOverlayToggleButton
public class ToolbarMusicButton : ToolbarOverlayToggleButton
{
public ToolbarMusicButton()
{

View File

@ -7,7 +7,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarNotificationButton : ToolbarOverlayToggleButton
public class ToolbarNotificationButton : ToolbarOverlayToggleButton
{
protected override Anchor TooltipAnchor => Anchor.TopRight;

View File

@ -9,7 +9,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarOverlayToggleButton : ToolbarButton
public class ToolbarOverlayToggleButton : ToolbarButton
{
private readonly Box stateBackground;

View File

@ -6,7 +6,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarSettingsButton : ToolbarOverlayToggleButton
public class ToolbarSettingsButton : ToolbarOverlayToggleButton
{
public ToolbarSettingsButton()
{

View File

@ -6,7 +6,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarSocialButton : ToolbarOverlayToggleButton
public class ToolbarSocialButton : ToolbarOverlayToggleButton
{
public ToolbarSocialButton()
{

View File

@ -9,7 +9,7 @@ using OpenTK;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarUserArea : Container
public class ToolbarUserArea : Container
{
public LoginOverlay LoginOverlay;
private ToolbarUserButton button;

View File

@ -12,7 +12,7 @@ using OpenTK.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarUserButton : ToolbarButton, IOnlineComponent
public class ToolbarUserButton : ToolbarButton, IOnlineComponent
{
private readonly UpdateableAvatar avatar;

View File

@ -20,12 +20,12 @@ namespace osu.Game.Rulesets.Judgements
/// <summary>
/// The combo prior to this judgement occurring.
/// </summary>
internal int ComboAtJudgement;
public int ComboAtJudgement;
/// <summary>
/// The highest combo achieved prior to this judgement occurring.
/// </summary>
internal int HighestComboAtJudgement;
public int HighestComboAtJudgement;
/// <summary>
/// Whether a successful hit occurred.
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Judgements
/// The offset from a perfect hit at which this judgement occurred.
/// Populated when added via <see cref="DrawableHitObject{TObject}.AddJudgement"/>.
/// </summary>
public double TimeOffset { get; internal set; }
public double TimeOffset { get; set; }
/// <summary>
/// Whether the <see cref="Result"/> should affect the combo portion of the score.

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
/// <summary>
/// A HitObjectParser to parse legacy osu!catch Beatmaps.
/// </summary>
internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
{
protected override HitObject CreateHit(Vector2 position, bool newCombo)
{

View File

@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
/// <summary>
/// A HitObjectParser to parse legacy Beatmaps.
/// </summary>
internal abstract class ConvertHitObjectParser : HitObjectParser
public abstract class ConvertHitObjectParser : HitObjectParser
{
public override HitObject Parse(string text)
{

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
/// <summary>
/// A HitObjectParser to parse legacy osu!mania Beatmaps.
/// </summary>
internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
{
protected override HitObject CreateHit(Vector2 position, bool newCombo)
{

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
/// <summary>
/// A HitObjectParser to parse legacy osu! Beatmaps.
/// </summary>
internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
{
protected override HitObject CreateHit(Vector2 position, bool newCombo)
{

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
/// <summary>
/// A HitObjectParser to parse legacy osu!taiko Beatmaps.
/// </summary>
internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
{
protected override HitObject CreateHit(Vector2 position, bool newCombo)
{

View File

@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Timing
/// <summary>
/// A <see cref="ScrollingContainer"/> which scrolls linearly relative to the <see cref="MultiplierControlPoint"/> start time.
/// </summary>
internal class LinearScrollingContainer : ScrollingContainer
public class LinearScrollingContainer : ScrollingContainer
{
private readonly MultiplierControlPoint controlPoint;

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.UI
/// </summary>
public HitObjectContainer HitObjects { get; protected set; }
internal Container<Drawable> ScaledContent;
public Container<Drawable> ScaledContent;
/// <summary>
/// Whether we are currently providing the local user a gameplay cursor.

View File

@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.UI
/// A visual representation of a <see cref="Rulesets.Ruleset"/>.
/// </summary>
/// <param name="ruleset">The ruleset being repesented.</param>
internal RulesetContainer(Ruleset ruleset)
protected RulesetContainer(Ruleset ruleset)
{
Ruleset = ruleset;
}

View File

@ -3,7 +3,7 @@
namespace osu.Game.Screens.Charts
{
internal class ChartInfo : ScreenWhiteBox
public class ChartInfo : ScreenWhiteBox
{
}
}

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace osu.Game.Screens.Charts
{
internal class ChartListing : ScreenWhiteBox
public class ChartListing : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(ChartInfo)

View File

@ -3,7 +3,7 @@
namespace osu.Game.Screens.Direct
{
internal class OnlineListing : ScreenWhiteBox
public class OnlineListing : ScreenWhiteBox
{
}
}

View File

@ -11,7 +11,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
/// <summary>
/// The part of the timeline that displays bookmarks.
/// </summary>
internal class BookmarkPart : TimelinePart
public class BookmarkPart : TimelinePart
{
protected override void LoadBeatmap(WorkingBeatmap beatmap)
{

View File

@ -12,7 +12,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
/// <summary>
/// The part of the timeline that displays breaks in the song.
/// </summary>
internal class BreakPart : TimelinePart
public class BreakPart : TimelinePart
{
protected override void LoadBeatmap(WorkingBeatmap beatmap)
{

View File

@ -14,7 +14,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
/// <summary>
/// The part of the timeline that displays the control points.
/// </summary>
internal class ControlPointPart : TimelinePart
public class ControlPointPart : TimelinePart
{
protected override void LoadBeatmap(WorkingBeatmap beatmap)
{

View File

@ -15,7 +15,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
/// <summary>
/// The part of the timeline that displays the current position of the song.
/// </summary>
internal class MarkerPart : TimelinePart
public class MarkerPart : TimelinePart
{
private readonly Drawable marker;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
/// <summary>
/// Represents a part of the summary timeline..
/// </summary>
internal abstract class TimelinePart : CompositeDrawable
public abstract class TimelinePart : CompositeDrawable
{
public Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();

View File

@ -10,7 +10,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations
/// <summary>
/// Represents a spanning point on a timeline part.
/// </summary>
internal class DurationVisualisation : Container
public class DurationVisualisation : Container
{
protected DurationVisualisation(double startTime, double endTime)
{

View File

@ -10,7 +10,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations
/// <summary>
/// Represents a singular point on a timeline part.
/// </summary>
internal class PointVisualisation : Box
public class PointVisualisation : Box
{
protected PointVisualisation(double startTime)
{

View File

@ -9,7 +9,7 @@ using OpenTK.Graphics;
namespace osu.Game.Screens.Edit.Screens.Design
{
internal class Design : EditorScreen
public class Design : EditorScreen
{
public Design()
{

View File

@ -17,6 +17,7 @@ using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio;
using osu.Framework.Threading;
namespace osu.Game.Screens.Menu
{
@ -38,10 +39,10 @@ namespace osu.Game.Screens.Menu
private readonly FlowContainerWithOrigin buttonFlow;
//todo: make these non-internal somehow.
internal const float BUTTON_AREA_HEIGHT = 100;
public const float BUTTON_AREA_HEIGHT = 100;
internal const float BUTTON_WIDTH = 140f;
internal const float WEDGE_WIDTH = 20;
public const float BUTTON_WIDTH = 140f;
public const float WEDGE_WIDTH = 20;
private OsuLogo logo;
@ -55,6 +56,8 @@ namespace osu.Game.Screens.Menu
// osuLogo.SizeForFlow relies on loading to be complete.
buttonFlow.Position = new Vector2(WEDGE_WIDTH * 2 - (BUTTON_WIDTH + this.logo.SizeForFlow / 4), 0);
updateLogoState();
}
}
@ -217,29 +220,17 @@ namespace osu.Game.Screens.Menu
if (state == MenuState.TopLevel)
buttonArea.FinishTransforms(true);
updateLogoState(lastState);
using (buttonArea.BeginDelayedSequence(lastState == MenuState.Initial ? 150 : 0, true))
{
switch (state)
{
case MenuState.Exit:
case MenuState.Initial:
trackingPosition = false;
buttonAreaBackground.ScaleTo(Vector2.One, 500, Easing.Out);
buttonArea.FadeOut(300);
logo?.Delay(150)
.Schedule(() =>
{
toolbar?.Hide();
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.Both;
logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo);
logo.ScaleTo(1, 800, Easing.OutExpo);
});
foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Contracted;
@ -252,33 +243,6 @@ namespace osu.Game.Screens.Menu
case MenuState.TopLevel:
buttonAreaBackground.ScaleTo(Vector2.One, 200, Easing.Out);
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.None;
trackingPosition = true;
switch (lastState)
{
case MenuState.Initial:
logo.ScaleTo(0.5f, 200, Easing.In);
trackingPosition = false;
logo
.MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In)
.OnComplete(o =>
{
trackingPosition = true;
o.Impact();
toolbar?.Show();
});
break;
default:
logo.ScaleTo(0.5f, 200, Easing.OutQuint);
break;
}
buttonArea.FadeIn(300);
foreach (Button b in buttonsTopLevel)
@ -297,8 +261,6 @@ namespace osu.Game.Screens.Menu
case MenuState.EnteringMode:
buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, Easing.InSine);
trackingPosition = true;
buttonsTopLevel.ForEach(b => b.ContractStyle = 1);
buttonsPlay.ForEach(b => b.ContractStyle = 1);
backButton.ContractStyle = 1;
@ -320,9 +282,69 @@ namespace osu.Game.Screens.Menu
}
}
private Vector2 iconTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre);
private ScheduledDelegate logoDelayedAction;
private bool trackingPosition;
private void updateLogoState(MenuState lastState = MenuState.Initial)
{
if (logo == null) return;
logoDelayedAction?.Cancel();
switch (state)
{
case MenuState.Exit:
case MenuState.Initial:
logoTracking = false;
logoDelayedAction = Scheduler.AddDelayed(() =>
{
toolbar?.Hide();
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.Both;
logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo);
logo.ScaleTo(1, 800, Easing.OutExpo);
}, 150);
break;
case MenuState.TopLevel:
case MenuState.Play:
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.None;
switch (lastState)
{
case MenuState.TopLevel: // coming from toplevel to play
case MenuState.Initial:
logoTracking = false;
logo.ScaleTo(0.5f, 200, Easing.In);
logo.MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In);
logoDelayedAction = Scheduler.AddDelayed(() =>
{
logoTracking = true;
logo.Impact();
toolbar?.Show();
}, 200);
break;
default:
logoTracking = true;
logo.ScaleTo(0.5f, 200, Easing.OutQuint);
break;
}
break;
case MenuState.EnteringMode:
logoTracking = true;
break;
}
}
private Vector2 logoTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre);
private bool logoTracking;
protected override void Update()
{
@ -333,8 +355,8 @@ namespace osu.Game.Screens.Menu
if (logo != null)
{
if (trackingPosition)
logo.Position = iconTrackingPosition;
if (logoTracking)
logo.Position = logoTrackingPosition;
iconFacade.Width = logo.SizeForFlow * 0.5f;
}

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.Menu
/// <summary>
/// Whether we have loaded the menu previously.
/// </summary>
internal bool DidLoadMenu;
public bool DidLoadMenu;
private MainMenu mainMenu;
private SampleChannel welcome;

View File

@ -226,7 +226,7 @@ namespace osu.Game.Screens.Menu
/// </summary>
/// <param name="action">The animation to be performed</param>
/// <param name="waitForPrevious">If true, the new animation is delayed until all previous transforms finish. If false, existing transformed are cleared.</param>
internal void AppendAnimatingAction(Action action, bool waitForPrevious)
public void AppendAnimatingAction(Action action, bool waitForPrevious)
{
Action runnableAction = () =>
{

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace osu.Game.Screens.Multiplayer
{
internal class Lobby : ScreenWhiteBox
public class Lobby : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(MatchCreate),

View File

@ -12,7 +12,7 @@ using osu.Framework.Graphics;
namespace osu.Game.Screens.Multiplayer
{
internal class Match : ScreenWhiteBox
public class Match : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(MatchSongSelect),

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace osu.Game.Screens.Multiplayer
{
internal class MatchCreate : ScreenWhiteBox
public class MatchCreate : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(Match)

View File

@ -14,7 +14,7 @@ using OpenTK.Graphics;
namespace osu.Game.Screens.Ranking
{
internal class ResultsPage : Container
public class ResultsPage : Container
{
protected readonly Score Score;
protected readonly WorkingBeatmap Beatmap;

View File

@ -12,7 +12,7 @@ using osu.Framework.Graphics.Shapes;
namespace osu.Game.Screens.Ranking
{
internal class ResultsPageRanking : ResultsPage
public class ResultsPageRanking : ResultsPage
{
public ResultsPageRanking(Score score, WorkingBeatmap beatmap = null) : base(score, beatmap)
{

View File

@ -26,7 +26,7 @@ using osu.Framework.Graphics.Shapes;
namespace osu.Game.Screens.Ranking
{
internal class ResultsPageScore : ResultsPage
public class ResultsPageScore : ResultsPage
{
private ScoreCounter scoreCounter;
@ -324,7 +324,7 @@ namespace osu.Game.Screens.Ranking
title.Colour = artist.Colour = colours.BlueDarker;
versionMapper.Colour = colours.Gray8;
versionMapper.Text = $"{beatmap.Version} - mapped by {beatmap.Metadata.Author}";
versionMapper.Text = $"{beatmap.Version} - mapped by {beatmap.Metadata.Author.Username}";
title.Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title);
artist.Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist);
}

View File

@ -23,7 +23,7 @@ using osu.Game.Graphics.Cursor;
namespace osu.Game.Screens.Select
{
internal class BeatmapCarousel : OsuScrollContainer
public class BeatmapCarousel : OsuScrollContainer
{
public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap;
@ -116,7 +116,7 @@ namespace osu.Game.Screens.Select
Schedule(() => removeGroup(groups.Find(b => b.BeatmapSet.ID == beatmapSet.ID)));
}
internal void UpdateBeatmap(BeatmapInfo beatmap)
public void UpdateBeatmap(BeatmapInfo beatmap)
{
// todo: this method should not run more than once for the same BeatmapSetInfo.
var set = manager.QueryBeatmapSet(s => s.ID == beatmap.BeatmapSetInfoID);

View File

@ -22,7 +22,7 @@ using osu.Framework.Graphics.Shapes;
namespace osu.Game.Screens.Select
{
internal class BeatmapInfoWedge : OverlayContainer
public class BeatmapInfoWedge : OverlayContainer
{
private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);

View File

@ -40,20 +40,12 @@ namespace osu.Game.Screens.Select.Leaderboards
scores = value;
getScoresRequest?.Cancel();
int i = 150;
scrollFlow?.FadeOut(200);
scrollFlow?.Expire();
scrollFlow = null;
if (scores == null)
{
if (scrollFlow != null)
{
foreach (var c in scrollFlow.Children)
c.FadeOut(i += 10);
foreach (var c in scrollFlow.Children)
c.LifetimeEnd = Time.Current + i;
}
return;
}
// schedule because we may not be loaded yet (LoadComponentAsync complains).
Schedule(() =>
@ -64,13 +56,12 @@ namespace osu.Game.Screens.Select.Leaderboards
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0f, 5f),
Padding = new MarginPadding { Top = 10, Bottom = 5 },
ChildrenEnumerable = scores.Select(s => new LeaderboardScore(s, 1 + i) { Action = () => ScoreSelected?.Invoke(s) })
ChildrenEnumerable = scores.Select((s, index) => new LeaderboardScore(s, index + 1) { Action = () => ScoreSelected?.Invoke(s) })
}, f =>
{
scrollFlow?.Expire();
scrollContainer.Add(scrollFlow = f);
i = 0;
int i = 0;
foreach (var s in f.Children)
{
using (s.BeginDelayedSequence(i++ * 50, true))

View File

@ -12,7 +12,7 @@ using System.Linq;
namespace osu.Game.Screens.Tournament.Components
{
internal class VisualiserContainer : Container
public class VisualiserContainer : Container
{
/// <summary>
/// Number of lines in the visualiser.

View File

@ -16,6 +16,7 @@ using osu.Game.Overlays;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
using osu.Framework.Graphics.Cursor;
using osu.Game.Graphics.Backgrounds;
namespace osu.Game.Users
{
@ -43,6 +44,8 @@ namespace osu.Game.Users
this.user = user;
FillFlowContainer infoContainer;
Height = height - status_height;
Masking = true;
CornerRadius = 5;
@ -100,7 +103,7 @@ namespace osu.Game.Users
TextSize = 18,
Font = @"Exo2.0-SemiBoldItalic",
},
new FillFlowContainer
infoContainer = new FillFlowContainer
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
@ -115,16 +118,6 @@ namespace osu.Game.Users
Width = 30f,
RelativeSizeAxes = Axes.Y,
},
new Container
{
Width = 40f,
RelativeSizeAxes = Axes.Y,
},
new CircularContainer
{
Width = 20f,
RelativeSizeAxes = Axes.Y,
},
},
},
},
@ -171,6 +164,13 @@ namespace osu.Game.Users
},
},
};
if (user.IsSupporter)
infoContainer.Add(new SupporterIcon
{
RelativeSizeAxes = Axes.Y,
Width = 20f,
});
}
[BackgroundDependencyLoader(permitNulls: true)]
@ -219,5 +219,53 @@ namespace osu.Game.Users
{
new OsuMenuItem("View Profile", MenuItemType.Highlighted, ViewProfile),
};
private class SupporterIcon : CircularContainer
{
private readonly Box background;
public SupporterIcon()
{
Masking = true;
Children = new Drawable[]
{
new Box { RelativeSizeAxes = Axes.Both },
new CircularContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Scale = new Vector2(0.8f),
Masking = true,
Children = new Drawable[]
{
background = new Box { RelativeSizeAxes = Axes.Both },
new Triangles
{
TriangleScale = 0.2f,
ColourLight = OsuColour.FromHex(@"ff7db7"),
ColourDark = OsuColour.FromHex(@"de5b95"),
RelativeSizeAxes = Axes.Both,
Velocity = 0.3f,
},
}
},
new SpriteIcon
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Icon = FontAwesome.fa_heart,
Scale = new Vector2(0.45f),
}
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
background.Colour = colours.Pink;
}
}
}
}

View File

@ -279,6 +279,10 @@
<Compile Include="Migrations\20171025071459_AddMissingIndexRules.Designer.cs">
<DependentUpon>20171025071459_AddMissingIndexRules.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs" />
<Compile Include="Migrations\20171119065731_AddBeatmapOnlineIDUniqueConstraint.designer.cs">
<DependentUpon>20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\OsuDbContextModelSnapshot.cs" />
<Compile Include="Online\API\Requests\GetBeatmapSetRequest.cs" />
<Compile Include="Online\API\Requests\GetBeatmapSetsResponse.cs" />