Merge branch 'master' into sh-xh-grading-2

This commit is contained in:
iiSaLMaN
2019-04-26 10:38:10 +03:00
committed by GitHub
71 changed files with 121 additions and 183 deletions

View File

@ -21,7 +21,7 @@ namespace osu.Game.Screens
//public float ParallaxAmount { set => parallax.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * value; }
public new void Push(BackgroundScreen screen)
public void Push(BackgroundScreen screen)
{
if (screen == null)
return;

View File

@ -121,6 +121,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// Handle a blueprint requesting selection.
/// </summary>
/// <param name="blueprint">The blueprint.</param>
/// <param name="state">The input state at the point of selection.</param>
internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
{
if (state.Keyboard.ControlPressed)
@ -166,8 +167,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
var topLeft = new Vector2(float.MaxValue, float.MaxValue);
var bottomRight = new Vector2(float.MinValue, float.MinValue);
bool hasSelection = false;
foreach (var blueprint in selectedBlueprints)
{
topLeft = Vector2.ComponentMin(topLeft, ToLocalSpace(blueprint.SelectionQuad.TopLeft));

View File

@ -131,7 +131,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private readonly float scrollOffset;
/// <summary>
/// Transforms <see cref="TimeTimelinem"/> to a new value.
/// Transforms <see cref="ZoomableScrollContainer.currentZoom"/> to a new value.
/// </summary>
/// <param name="focusPoint">The focus point in absolute coordinates local to the content.</param>
/// <param name="contentSize">The size of the content.</param>

View File

@ -65,9 +65,6 @@ namespace osu.Game.Screens.Edit
dependencies.Cache(beatDivisor);
EditorMenuBar menuBar;
TimeInfoContainer timeInfo;
SummaryTimeline timeline;
PlaybackControl playback;
var fileMenuItems = new List<MenuItem>();
if (RuntimeInfo.IsDesktop)

View File

@ -60,14 +60,7 @@ namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
set => label.Colour = value;
}
public Color4 BackgroundColour
{
get => content.Colour;
set => content.Colour = value;
}
private readonly OsuTextBox textBox;
private readonly Container content;
private readonly OsuSpriteText label;
public LabelledTextBox()

View File

@ -13,15 +13,13 @@ namespace osu.Game.Screens.Multi.Components
protected override void AddTabItem(TabItem<T> tab, bool addToDropdown = true)
{
if (tab is DisableableTabItem<T> disableable)
if (tab is DisableableTabItem disableable)
disableable.Enabled.BindTo(Enabled);
base.AddTabItem(tab, addToDropdown);
}
protected abstract class DisableableTabItem<T> : TabItem<T>
protected abstract class DisableableTabItem : TabItem<T>
{
public readonly BindableBool Enabled = new BindableBool();
protected DisableableTabItem(T value)
: base(value)
{

View File

@ -25,8 +25,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
private void load(OsuColour colours)
{
OsuSpriteText summary;
OsuSpriteText levelRangeHigher;
OsuSpriteText levelRangeLower;
Container flagContainer;
LinkFlowContainer hostText;
@ -45,21 +43,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
Width = 22f,
RelativeSizeAxes = Axes.Y,
},
/*new Container //todo: team banners
{
Width = 38f,
RelativeSizeAxes = Axes.Y,
CornerRadius = 2f,
Masking = true,
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.FromHex(@"ad387e"),
},
},
},*/
hostText = new LinkFlowContainer
{
Anchor = Anchor.CentreLeft,
@ -101,13 +84,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
}, true);
ParticipantCount.BindValueChanged(count => summary.Text = "participant".ToQuantity(count.NewValue), true);
/*Participants.BindValueChanged(e =>
{
var ranks = v.Select(u => u.Statistics.Ranks.Global);
levelRangeLower.Text = ranks.Min().ToString();
levelRangeHigher.Text = ranks.Max().ToString();
});*/
}
}
}

View File

@ -97,7 +97,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Font = OsuFont.GetFont(size: 30),
Current = Name
Current = RoomName
},
},
},

View File

@ -36,7 +36,7 @@ namespace osu.Game.Screens.Multi.Match.Components
AddItem(new GameTypeTimeshift());
}
private class GameTypePickerItem : DisableableTabItem<GameType>
private class GameTypePickerItem : DisableableTabItem
{
private const float transition_duration = 200;

View File

@ -30,7 +30,6 @@ namespace osu.Game.Screens.Multi.Match.Components
ReadyButton readyButton;
ViewBeatmapButton viewBeatmapButton;
HostInfo hostInfo;
RoomStatusInfo statusInfo;
InternalChildren = new Drawable[]
{
@ -63,7 +62,7 @@ namespace osu.Game.Screens.Multi.Match.Components
new OsuSpriteText
{
Font = OsuFont.GetFont(size: 30),
Current = Name
Current = RoomName
},
new RoomStatusInfo(),
}

View File

@ -265,7 +265,7 @@ namespace osu.Game.Screens.Multi.Match.Components
};
TypePicker.Current.BindValueChanged(type => typeLabel.Text = type.NewValue?.Name ?? string.Empty, true);
Name.BindValueChanged(name => NameField.Text = name.NewValue, true);
RoomName.BindValueChanged(name => NameField.Text = name.NewValue, true);
Availability.BindValueChanged(availability => AvailabilityPicker.Current.Value = availability.NewValue, true);
Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true);
MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
@ -285,7 +285,7 @@ namespace osu.Game.Screens.Multi.Match.Components
{
hideError();
Name.Value = NameField.Text;
RoomName.Value = NameField.Text;
Availability.Value = AvailabilityPicker.Current.Value;
Type.Value = TypePicker.Current.Value;

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.Multi.Match.Components
AddItem(RoomAvailability.InviteOnly);
}
private class RoomAvailabilityPickerItem : DisableableTabItem<RoomAvailability>
private class RoomAvailabilityPickerItem : DisableableTabItem
{
private const float transition_duration = 200;

View File

@ -16,8 +16,8 @@ namespace osu.Game.Screens.Multi
[Resolved(typeof(Room))]
protected Bindable<int?> RoomID { get; private set; }
[Resolved(typeof(Room))]
protected Bindable<string> Name { get; private set; }
[Resolved(typeof(Room), nameof(Room.Name))]
protected Bindable<string> RoomName { get; private set; }
[Resolved(typeof(Room))]
protected Bindable<User> Host { get; private set; }

View File

@ -3,22 +3,17 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Framework.Screens;
using osu.Game.Graphics.Containers;
using osu.Game.Input.Bindings;
namespace osu.Game.Screens.Multi
{
public abstract class MultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen, IKeyBindingHandler<GlobalAction>
public abstract class MultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen
{
public override bool DisallowExternalBeatmapRulesetChanges => false;
public virtual string ShortTitle => Title;
[Resolved(CanBeNull = true)]
protected OsuGame Game { get; private set; }
[Resolved(CanBeNull = true)]
protected IRoomManager RoomManager { get; private set; }
@ -56,21 +51,6 @@ namespace osu.Game.Screens.Multi
this.MoveToX(-200, WaveContainer.DISAPPEAR_DURATION, Easing.OutQuint);
}
public override bool OnPressed(GlobalAction action)
{
if (!this.IsCurrentScreen()) return false;
if (action == GlobalAction.Back)
{
this.Exit();
return true;
}
return false;
}
public bool OnReleased(GlobalAction action) => action == GlobalAction.Back;
public override string ToString() => Title;
}
}

View File

@ -171,7 +171,7 @@ namespace osu.Game.Screens.Multi
/// <summary>
/// Adds a <see cref="Room"/> to the list of available rooms.
/// </summary>
/// <param name="room">The <see cref="Room"/> to add.<</param>
/// <param name="room">The <see cref="Room"/> to add.</param>
private void addRoom(Room room)
{
var existing = rooms.FirstOrDefault(e => e.RoomID.Value == room.RoomID.Value);

View File

@ -8,7 +8,7 @@ namespace osu.Game.Screens.Play
{
/// <summary>
/// A clock which is used for gameplay elements that need to follow audio time 1:1.
/// Exposed via DI by <see cref="PausableGameplayContainer"/>.
/// Exposed via DI by <see cref="GameplayClockContainer"/>.
/// <remarks>
/// The main purpose of this clock is to stop components using it from accidentally processing the main
/// <see cref="IFrameBasedClock"/>, as this should only be done once to ensure accuracy.

View File

@ -72,7 +72,7 @@ namespace osu.Game.Screens.Play
[Cached]
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]
protected readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
protected new readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
private readonly bool allowPause;
private readonly bool showResults;

View File

@ -163,7 +163,11 @@ namespace osu.Game.Screens.Play
logo.ScaleTo(new Vector2(0.15f), duration, Easing.In);
logo.FadeIn(350);
Scheduler.AddDelayed(() => { content.StartTracking(logo, resuming ? 0 : 500, Easing.InOutExpo); }, resuming ? 0 : 500);
Scheduler.AddDelayed(() =>
{
if (this.IsCurrentScreen())
content.StartTracking(logo, resuming ? 0 : 500, Easing.InOutExpo);
}, resuming ? 0 : 500);
}
protected override void LogoExiting(OsuLogo logo)
@ -320,7 +324,6 @@ namespace osu.Game.Screens.Play
private readonly Drawable facade;
private LoadingAnimation loading;
private Sprite backgroundSprite;
private ModDisplay modDisplay;
public bool Loading
{

View File

@ -31,8 +31,6 @@ namespace osu.Game.Screens.Select.Carousel
}
}
private int creationOrder;
protected CarouselItem()
{
DrawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation);

View File

@ -388,8 +388,6 @@ namespace osu.Game.Screens.Select
{
Logger.Log($"updating selection with beatmap:{beatmap?.ID.ToString() ?? "null"} ruleset:{ruleset?.ID.ToString() ?? "null"}");
bool preview = false;
if (ruleset?.Equals(decoupledRuleset.Value) == false)
{
Logger.Log($"ruleset changed from \"{decoupledRuleset.Value}\" to \"{ruleset}\"");