mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
Merge remote-tracking branch 'Joehuu/master' into timeshift-wip
# Conflicts: # osu.Game/Screens/Play/HUD/ModDisplay.cs
This commit is contained in:
commit
d93421b796
@ -26,9 +26,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
if (slider == null)
|
if (slider == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
slider.HeadCircle.Position = new Vector2(slider.HeadCircle.Position.X, OsuPlayfield.BASE_SIZE.Y - slider.HeadCircle.Position.Y);
|
|
||||||
slider.TailCircle.Position = new Vector2(slider.TailCircle.Position.X, OsuPlayfield.BASE_SIZE.Y - slider.TailCircle.Position.Y);
|
|
||||||
|
|
||||||
slider.NestedHitObjects.OfType<SliderTick>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
slider.NestedHitObjects.OfType<SliderTick>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
||||||
slider.NestedHitObjects.OfType<RepeatPoint>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
slider.NestedHitObjects.OfType<RepeatPoint>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -99,7 +100,20 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bindable<bool> Current { get; } = new Bindable<bool>();
|
private readonly Bindable<bool> current = new Bindable<bool>();
|
||||||
|
|
||||||
|
public Bindable<bool> Current
|
||||||
|
{
|
||||||
|
get => current;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
throw new ArgumentNullException(nameof(value));
|
||||||
|
|
||||||
|
current.UnbindBindings();
|
||||||
|
current.BindTo(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Color4 accentColour;
|
private Color4 accentColour;
|
||||||
public Color4 AccentColour
|
public Color4 AccentColour
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -19,6 +20,7 @@ using osu.Game.Online.Chat;
|
|||||||
using osu.Game.Overlays.Chat;
|
using osu.Game.Overlays.Chat;
|
||||||
using osu.Game.Overlays.Chat.Selection;
|
using osu.Game.Overlays.Chat.Selection;
|
||||||
using osu.Game.Overlays.Chat.Tabs;
|
using osu.Game.Overlays.Chat.Tabs;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -222,7 +224,7 @@ namespace osu.Game.Overlays
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentChannelContainer.Clear(false);
|
currentChannelContainer.Clear(false);
|
||||||
Scheduler.Add(() => currentChannelContainer.Add(loaded));
|
currentChannelContainer.Add(loaded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,6 +264,39 @@ namespace osu.Game.Overlays
|
|||||||
return base.OnDragEnd(e);
|
return base.OnDragEnd(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void selectTab(int index)
|
||||||
|
{
|
||||||
|
var channel = channelTabControl.Items.Skip(index).FirstOrDefault();
|
||||||
|
if (channel != null && channel.Name != "+")
|
||||||
|
channelTabControl.Current.Value = channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
|
{
|
||||||
|
if (e.AltPressed)
|
||||||
|
{
|
||||||
|
switch (e.Key)
|
||||||
|
{
|
||||||
|
case Key.Number1:
|
||||||
|
case Key.Number2:
|
||||||
|
case Key.Number3:
|
||||||
|
case Key.Number4:
|
||||||
|
case Key.Number5:
|
||||||
|
case Key.Number6:
|
||||||
|
case Key.Number7:
|
||||||
|
case Key.Number8:
|
||||||
|
case Key.Number9:
|
||||||
|
selectTab((int)e.Key - (int)Key.Number1);
|
||||||
|
return true;
|
||||||
|
case Key.Number0:
|
||||||
|
selectTab(9);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.OnKeyDown(e);
|
||||||
|
}
|
||||||
|
|
||||||
public override bool AcceptsFocus => true;
|
public override bool AcceptsFocus => true;
|
||||||
|
|
||||||
protected override void OnFocus(FocusEvent e)
|
protected override void OnFocus(FocusEvent e)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -18,7 +19,20 @@ namespace osu.Game.Overlays.Volume
|
|||||||
{
|
{
|
||||||
public class MuteButton : Container, IHasCurrentValue<bool>
|
public class MuteButton : Container, IHasCurrentValue<bool>
|
||||||
{
|
{
|
||||||
public Bindable<bool> Current { get; } = new Bindable<bool>();
|
private readonly Bindable<bool> current = new Bindable<bool>();
|
||||||
|
|
||||||
|
public Bindable<bool> Current
|
||||||
|
{
|
||||||
|
get => current;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
throw new ArgumentNullException(nameof(value));
|
||||||
|
|
||||||
|
current.UnbindBindings();
|
||||||
|
current.BindTo(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Color4 hoveredColour, unhoveredColour;
|
private Color4 hoveredColour, unhoveredColour;
|
||||||
private const float width = 100;
|
private const float width = 100;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -11,7 +13,6 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
@ -22,9 +23,20 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
public bool DisplayUnrankedText = true;
|
public bool DisplayUnrankedText = true;
|
||||||
|
|
||||||
private readonly Bindable<IEnumerable<Mod>> mods = new Bindable<IEnumerable<Mod>>();
|
private readonly Bindable<IEnumerable<Mod>> current = new Bindable<IEnumerable<Mod>>();
|
||||||
|
|
||||||
public Bindable<IEnumerable<Mod>> Current => mods;
|
public Bindable<IEnumerable<Mod>> Current
|
||||||
|
{
|
||||||
|
get => current;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
throw new ArgumentNullException(nameof(value));
|
||||||
|
|
||||||
|
current.UnbindBindings();
|
||||||
|
current.BindTo(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private readonly FillFlowContainer<ModIcon> iconsContainer;
|
private readonly FillFlowContainer<ModIcon> iconsContainer;
|
||||||
private readonly OsuSpriteText unrankedText;
|
private readonly OsuSpriteText unrankedText;
|
||||||
@ -53,7 +65,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
mods.ValueChanged += mods =>
|
Current.ValueChanged += mods =>
|
||||||
{
|
{
|
||||||
iconsContainer.Clear();
|
iconsContainer.Clear();
|
||||||
foreach (Mod mod in mods)
|
foreach (Mod mod in mods)
|
||||||
@ -69,7 +81,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
mods.UnbindAll();
|
Current.UnbindAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -80,7 +92,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
private void appearTransform()
|
private void appearTransform()
|
||||||
{
|
{
|
||||||
if (DisplayUnrankedText && mods.Value.Any(m => !m.Ranked))
|
if (DisplayUnrankedText && Current.Value.Any(m => !m.Ranked))
|
||||||
unrankedText.FadeInFromZero(fade_duration, Easing.OutQuint);
|
unrankedText.FadeInFromZero(fade_duration, Easing.OutQuint);
|
||||||
else
|
else
|
||||||
unrankedText.Hide();
|
unrankedText.Hide();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.0" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2018.1219.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2018.1221.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user