mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge https://github.com/ppy/osu into osu-direct-search
This commit is contained in:
@ -12,10 +12,11 @@ using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
public class ChannelListItem : ClickableContainer, IFilterable
|
||||
public class ChannelListItem : OsuClickableContainer, IFilterable
|
||||
{
|
||||
private const float width_padding = 5;
|
||||
private const float channel_width = 150;
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Chat
|
||||
|
||||
public IEnumerable<Channel> Channels
|
||||
{
|
||||
set { ChannelFlow.Children = value.Select(c => new ChannelListItem(c)); }
|
||||
set { ChannelFlow.ChildrenEnumerable = value.Select(c => new ChannelListItem(c)); }
|
||||
}
|
||||
|
||||
public ChannelSection()
|
||||
|
@ -9,17 +9,18 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
public class ChannelSelectionOverlay : FocusedOverlayContainer
|
||||
public class ChannelSelectionOverlay : OsuFocusedOverlayContainer
|
||||
{
|
||||
public static readonly float WIDTH_PADDING = 170;
|
||||
|
||||
@ -38,7 +39,7 @@ namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
set
|
||||
{
|
||||
sectionsFlow.Children = value;
|
||||
sectionsFlow.ChildrenEnumerable = value;
|
||||
|
||||
foreach (ChannelSection s in sectionsFlow.Children)
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input;
|
||||
@ -26,6 +27,8 @@ namespace osu.Game.Overlays.Chat
|
||||
|
||||
public readonly Bindable<bool> ChannelSelectorActive = new Bindable<bool>();
|
||||
|
||||
private readonly ChannelTabItem.ChannelSelectorTabItem selectorTab;
|
||||
|
||||
public ChatTabControl()
|
||||
{
|
||||
TabContainer.Margin = new MarginPadding { Left = 50 };
|
||||
@ -41,7 +44,22 @@ namespace osu.Game.Overlays.Chat
|
||||
Padding = new MarginPadding(10),
|
||||
});
|
||||
|
||||
AddTabItem(new ChannelTabItem.ChannelSelectorTabItem(new Channel { Name = "+" }, ChannelSelectorActive));
|
||||
AddTabItem(selectorTab = new ChannelTabItem.ChannelSelectorTabItem(new Channel { Name = "+" }));
|
||||
|
||||
ChannelSelectorActive.BindTo(selectorTab.Active);
|
||||
}
|
||||
|
||||
protected override void SelectTab(TabItem<Channel> tab)
|
||||
{
|
||||
if (tab is ChannelTabItem.ChannelSelectorTabItem)
|
||||
{
|
||||
tab.Active.Toggle();
|
||||
return;
|
||||
}
|
||||
|
||||
selectorTab.Active.Value = false;
|
||||
|
||||
base.SelectTab(tab);
|
||||
}
|
||||
|
||||
private class ChannelTabItem : TabItem<Channel>
|
||||
@ -56,18 +74,6 @@ namespace osu.Game.Overlays.Chat
|
||||
private readonly Box highlightBox;
|
||||
private readonly TextAwesome icon;
|
||||
|
||||
public override bool Active
|
||||
{
|
||||
get { return base.Active; }
|
||||
set
|
||||
{
|
||||
if (Active == value) return;
|
||||
|
||||
base.Active = value;
|
||||
updateState();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
if (Active)
|
||||
@ -141,7 +147,7 @@ namespace osu.Game.Overlays.Chat
|
||||
Shear = new Vector2(shear_width / ChatOverlay.TAB_AREA_HEIGHT, 0);
|
||||
|
||||
Masking = true;
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Radius = 10,
|
||||
@ -205,28 +211,8 @@ namespace osu.Game.Overlays.Chat
|
||||
|
||||
public class ChannelSelectorTabItem : ChannelTabItem
|
||||
{
|
||||
public override bool Active
|
||||
public ChannelSelectorTabItem(Channel value) : base(value)
|
||||
{
|
||||
get { return false; }
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
// we basically never want this tab to become active.
|
||||
// this allows us to become a "toggle" tab.
|
||||
// is a bit hacky, to say the least.
|
||||
activeBindable.Value = !activeBindable.Value;
|
||||
base.Active = false;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Bindable<bool> activeBindable;
|
||||
|
||||
public ChannelSelectorTabItem(Channel value, Bindable<bool> active) : base(value)
|
||||
{
|
||||
activeBindable = active;
|
||||
activeBindable.ValueChanged += v => selectorUpdateState();
|
||||
|
||||
|
||||
Depth = float.MaxValue;
|
||||
Width = 45;
|
||||
|
||||
@ -242,27 +228,11 @@ namespace osu.Game.Overlays.Chat
|
||||
backgroundInactive = colour.Gray2;
|
||||
backgroundActive = colour.Gray3;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
selectorUpdateState();
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
selectorUpdateState();
|
||||
}
|
||||
|
||||
private void selectorUpdateState()
|
||||
{
|
||||
if (activeBindable.Value)
|
||||
fadeActive();
|
||||
else
|
||||
fadeInactive();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnActivated() => updateState();
|
||||
|
||||
protected override void OnDeactivated() => updateState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,6 +86,6 @@ namespace osu.Game.Overlays.Chat
|
||||
}
|
||||
}
|
||||
|
||||
private void scrollToEnd() => Scheduler.AddDelayed(() => scroll.ScrollToEnd(), 50);
|
||||
private void scrollToEnd() => ScheduleAfterChildren(() => scroll.ScrollToEnd());
|
||||
}
|
||||
}
|
||||
|
@ -10,9 +10,8 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.Chat;
|
||||
@ -23,17 +22,20 @@ using osu.Framework.Input;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Chat;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class ChatOverlay : FocusedOverlayContainer, IOnlineComponent
|
||||
public class ChatOverlay : OsuFocusedOverlayContainer, IOnlineComponent
|
||||
{
|
||||
private const float textbox_height = 60;
|
||||
private const float channel_selection_min_height = 0.3f;
|
||||
|
||||
private ScheduledDelegate messageRequest;
|
||||
|
||||
private readonly Container currentChannelContainer;
|
||||
private readonly Container<DrawableChannel> currentChannelContainer;
|
||||
|
||||
private readonly LoadingAnimation loading;
|
||||
|
||||
private readonly FocusedTextBox inputTextBox;
|
||||
|
||||
@ -58,7 +60,7 @@ namespace osu.Game.Overlays
|
||||
private readonly Container channelSelectionContainer;
|
||||
private readonly ChannelSelectionOverlay channelSelection;
|
||||
|
||||
protected override bool InternalContains(Vector2 screenSpacePos) => chatContainer.Contains(screenSpacePos) || channelSelection.State == Visibility.Visible && channelSelection.Contains(screenSpacePos);
|
||||
public override bool Contains(Vector2 screenSpacePos) => chatContainer.ReceiveMouseInputAt(screenSpacePos) || channelSelection.State == Visibility.Visible && channelSelection.ReceiveMouseInputAt(screenSpacePos);
|
||||
|
||||
public ChatOverlay()
|
||||
{
|
||||
@ -104,7 +106,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
currentChannelContainer = new Container
|
||||
currentChannelContainer = new Container<DrawableChannel>
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding
|
||||
@ -138,7 +140,8 @@ namespace osu.Game.Overlays
|
||||
HoldFocus = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loading = new LoadingAnimation(),
|
||||
}
|
||||
},
|
||||
new Container
|
||||
@ -191,7 +194,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override bool OnDragStart(InputState state)
|
||||
{
|
||||
if (!channelTabs.Hovering)
|
||||
if (!channelTabs.IsHovered)
|
||||
return base.OnDragStart(state);
|
||||
|
||||
startDragChatHeight = chatHeight.Value;
|
||||
@ -274,14 +277,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
private void initializeChannels()
|
||||
{
|
||||
SpriteText loading;
|
||||
Add(loading = new OsuSpriteText
|
||||
{
|
||||
Text = @"initialising chat...",
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = 40,
|
||||
});
|
||||
loading.Show();
|
||||
|
||||
messageRequest?.Cancel();
|
||||
|
||||
@ -290,9 +286,6 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
Scheduler.Add(delegate
|
||||
{
|
||||
loading.FadeOut(100);
|
||||
loading.Expire();
|
||||
|
||||
addChannel(channels.Find(c => c.Name == @"#lazer"));
|
||||
addChannel(channels.Find(c => c.Name == @"#osu"));
|
||||
addChannel(channels.Find(c => c.Name == @"#lobby"));
|
||||
@ -336,13 +329,17 @@ namespace osu.Game.Overlays
|
||||
if (loaded == null)
|
||||
{
|
||||
currentChannelContainer.FadeOut(500, EasingTypes.OutQuint);
|
||||
loading.Show();
|
||||
|
||||
loaded = new DrawableChannel(currentChannel);
|
||||
loadedChannels.Add(loaded);
|
||||
LoadComponentAsync(loaded, l =>
|
||||
{
|
||||
if (currentChannel.Messages.Any())
|
||||
loading.Hide();
|
||||
|
||||
currentChannelContainer.Clear(false);
|
||||
currentChannelContainer.Add(l);
|
||||
currentChannelContainer.Add(loaded);
|
||||
currentChannelContainer.FadeIn(500, EasingTypes.OutQuint);
|
||||
});
|
||||
}
|
||||
@ -367,7 +364,6 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
careChannels.Add(channel);
|
||||
channelTabs.AddItem(channel);
|
||||
}
|
||||
@ -387,6 +383,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
req.Success += delegate (List<Message> messages)
|
||||
{
|
||||
loading.Hide();
|
||||
channel.AddNewMessages(messages.ToArray());
|
||||
Debug.Write("success!");
|
||||
};
|
||||
|
@ -14,10 +14,12 @@ using osu.Game.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Dialog
|
||||
{
|
||||
public class PopupDialog : FocusedOverlayContainer
|
||||
public class PopupDialog : OsuFocusedOverlayContainer
|
||||
{
|
||||
public static readonly float ENTER_DURATION = 500;
|
||||
public static readonly float EXIT_DURATION = 200;
|
||||
@ -55,7 +57,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
get { return buttonsContainer.Children; }
|
||||
set
|
||||
{
|
||||
buttonsContainer.Children = value;
|
||||
buttonsContainer.ChildrenEnumerable = value;
|
||||
foreach (PopupDialogButton b in value)
|
||||
{
|
||||
var action = b.Action;
|
||||
@ -78,7 +80,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
{
|
||||
if (args.Repeat) return false;
|
||||
|
||||
if (args.Key == Key.Enter)
|
||||
if (args.Key == Key.Enter || args.Key == Key.KeypadEnter)
|
||||
{
|
||||
Buttons.OfType<PopupDialogOkButton>().FirstOrDefault()?.TriggerOnClick();
|
||||
return true;
|
||||
@ -145,7 +147,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(0.5f),
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Dialog
|
||||
@ -10,11 +9,9 @@ namespace osu.Game.Overlays.Dialog
|
||||
public class PopupDialogCancelButton : PopupDialogButton
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, AudioManager audio)
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
ButtonColour = colours.Blue;
|
||||
SampleHover = audio.Sample.Get(@"Menu/menuclick");
|
||||
SampleClick = audio.Sample.Get(@"Menu/menuback");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Dialog
|
||||
@ -10,11 +9,9 @@ namespace osu.Game.Overlays.Dialog
|
||||
public class PopupDialogOkButton : PopupDialogButton
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, AudioManager audio)
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
ButtonColour = colours.Pink;
|
||||
SampleHover = audio.Sample.Get(@"Menu/menuclick");
|
||||
SampleClick = audio.Sample.Get(@"Menu/menu-play-click");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,13 +4,14 @@
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Overlays.Dialog;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class DialogOverlay : FocusedOverlayContainer
|
||||
public class DialogOverlay : OsuFocusedOverlayContainer
|
||||
{
|
||||
private readonly Container dialogContainer;
|
||||
private PopupDialog currentDialog;
|
||||
@ -29,7 +30,7 @@ namespace osu.Game.Overlays
|
||||
State = Visibility.Visible;
|
||||
}
|
||||
|
||||
private void onDialogOnStateChanged(OverlayContainer dialog, Visibility v)
|
||||
private void onDialogOnStateChanged(VisibilityContainer dialog, Visibility v)
|
||||
{
|
||||
if (v != Visibility.Hidden) return;
|
||||
|
||||
|
@ -7,12 +7,12 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Direct
|
||||
CornerRadius = 4;
|
||||
Masking = true;
|
||||
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Offset = new Vector2(0f, 1f),
|
||||
|
@ -6,7 +6,6 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
@ -15,6 +14,8 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
@ -30,7 +31,7 @@ namespace osu.Game.Overlays.Direct
|
||||
Height = height;
|
||||
CornerRadius = 5;
|
||||
Masking = true;
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Offset = new Vector2(0f, 1f),
|
||||
@ -150,7 +151,7 @@ namespace osu.Game.Overlays.Direct
|
||||
};
|
||||
}
|
||||
|
||||
private class DownloadButton : ClickableContainer
|
||||
private class DownloadButton : OsuClickableContainer
|
||||
{
|
||||
private readonly TextAwesome icon;
|
||||
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Direct
|
||||
SetInfo = setInfo;
|
||||
}
|
||||
|
||||
protected IEnumerable<DifficultyIcon> GetDifficultyIcons()
|
||||
protected List<DifficultyIcon> GetDifficultyIcons()
|
||||
{
|
||||
var icons = new List<DifficultyIcon>();
|
||||
|
||||
@ -40,6 +40,7 @@ namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
||||
}) { RelativeSizeAxes = Axes.Both, TimeBeforeLoad = 300 };
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Overlays.SearchableList;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
@ -43,7 +44,7 @@ namespace osu.Game.Overlays.Direct
|
||||
}
|
||||
}
|
||||
|
||||
private class RulesetToggleButton : ClickableContainer
|
||||
private class RulesetToggleButton : OsuClickableContainer
|
||||
{
|
||||
private readonly TextAwesome icon;
|
||||
|
||||
|
@ -172,7 +172,7 @@ namespace osu.Game.Overlays
|
||||
private void recreatePanels(PanelDisplayStyle displayStyle)
|
||||
{
|
||||
if (BeatmapSets == null) return;
|
||||
panels.Children = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b));
|
||||
panels.ChildrenEnumerable = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b));
|
||||
}
|
||||
|
||||
private GetBeatmapSetsRequest getSetsRequest;
|
||||
|
@ -4,10 +4,10 @@
|
||||
using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Framework.Input;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
@ -75,7 +75,7 @@ namespace osu.Game.Overlays
|
||||
private void updatePosition(float position, bool easing = true)
|
||||
{
|
||||
position = MathHelper.Clamp(position, 0, 1);
|
||||
Fill.TransformTo(() => Fill.Width, position, easing ? 200 : 0, EasingTypes.OutQuint, new TransformSeek());
|
||||
Fill.TransformTo(position, easing ? 200 : 0, EasingTypes.OutQuint, new TransformSeek());
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||
@ -98,13 +98,10 @@ namespace osu.Game.Overlays
|
||||
return true;
|
||||
}
|
||||
|
||||
private class TransformSeek : TransformFloat
|
||||
private class TransformSeek : TransformFloat<Drawable>
|
||||
{
|
||||
public override void Apply(Drawable d)
|
||||
{
|
||||
base.Apply(d);
|
||||
d.Width = CurrentValue;
|
||||
}
|
||||
public override void Apply(Drawable d) => d.Width = CurrentValue;
|
||||
public override void ReadIntoStartValue(Drawable d) => StartValue = d.Width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,14 +4,15 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Settings.Sections.General;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
internal class LoginOverlay : FocusedOverlayContainer
|
||||
internal class LoginOverlay : OsuFocusedOverlayContainer
|
||||
{
|
||||
private LoginSettings settingsSection;
|
||||
|
||||
@ -27,7 +28,8 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box {
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.6f,
|
||||
|
@ -20,7 +20,6 @@ using osu.Framework.Graphics.Cursor;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Represents a clickable button which can cycle through one of more mods.
|
||||
/// </summary>
|
||||
@ -80,7 +79,7 @@ namespace osu.Game.Overlays.Mods
|
||||
backgroundIcon.RotateTo(-rotate_angle * direction, mod_switch_duration, mod_switch_easing);
|
||||
|
||||
backgroundIcon.Icon = modAfter.Icon;
|
||||
using (iconsContainer.BeginDelayedSequence(mod_switch_duration, true))
|
||||
using (BeginDelayedSequence(mod_switch_duration, true))
|
||||
{
|
||||
foregroundIcon.RotateTo(-rotate_angle * direction);
|
||||
foregroundIcon.RotateTo(0f, mod_switch_duration, mod_switch_easing);
|
||||
@ -88,7 +87,7 @@ namespace osu.Game.Overlays.Mods
|
||||
backgroundIcon.RotateTo(rotate_angle * direction);
|
||||
backgroundIcon.RotateTo(0f, mod_switch_duration, mod_switch_easing);
|
||||
|
||||
iconsContainer.Schedule(() => displayMod(modAfter));
|
||||
Schedule(() => displayMod(modAfter));
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,8 +151,8 @@ namespace osu.Game.Overlays.Mods
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
sampleOn = audio.Sample.Get(@"Checkbox/check-on");
|
||||
sampleOff = audio.Sample.Get(@"Checkbox/check-off");
|
||||
sampleOn = audio.Sample.Get(@"UI/check-on");
|
||||
sampleOff = audio.Sample.Get(@"UI/check-off");
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||
@ -172,7 +171,7 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
public void SelectNext()
|
||||
{
|
||||
(++SelectedIndex == -1 ? sampleOff : sampleOn).Play();
|
||||
(++SelectedIndex == Mods.Length ? sampleOff : sampleOn).Play();
|
||||
Action?.Invoke(SelectedMod);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
@ -17,6 +16,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Music
|
||||
Icon.TextSize = 14;
|
||||
Icon.Margin = new MarginPadding(0);
|
||||
Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4, Left = 10, Right = 10 };
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(0.3f),
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Music
|
||||
public CollectionsMenu()
|
||||
{
|
||||
CornerRadius = 5;
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(0.3f),
|
||||
|
@ -137,6 +137,7 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
public bool MatchingFilter
|
||||
{
|
||||
get { return matching; }
|
||||
set
|
||||
{
|
||||
if (matching == value) return;
|
||||
@ -145,10 +146,6 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
FadeTo(matching ? 1 : 0, 200);
|
||||
}
|
||||
get
|
||||
{
|
||||
return matching;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
@ -18,6 +17,7 @@ using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays.Music
|
||||
{
|
||||
@ -52,7 +52,7 @@ namespace osu.Game.Overlays.Music
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CornerRadius = 5,
|
||||
Masking = true,
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(40),
|
||||
|
@ -23,10 +23,12 @@ using osu.Game.Graphics.Sprites;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Overlays.Music;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class MusicController : FocusedOverlayContainer
|
||||
public class MusicController : OsuFocusedOverlayContainer
|
||||
{
|
||||
private const float player_height = 130;
|
||||
|
||||
@ -106,7 +108,7 @@ namespace osu.Game.Overlays
|
||||
Height = player_height,
|
||||
Masking = true,
|
||||
CornerRadius = 5,
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(40),
|
||||
@ -396,6 +398,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
sprite = new Sprite
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.Gray(150),
|
||||
FillMode = FillMode.Fill,
|
||||
},
|
||||
|
@ -6,13 +6,14 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class NotificationManager : FocusedOverlayContainer
|
||||
public class NotificationManager : OsuFocusedOverlayContainer
|
||||
{
|
||||
private const float width = 320;
|
||||
|
||||
@ -46,19 +47,19 @@ namespace osu.Game.Overlays
|
||||
Direction = FillDirection.Vertical,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Children = new []
|
||||
Children = new[]
|
||||
{
|
||||
new NotificationSection
|
||||
{
|
||||
Title = @"Notifications",
|
||||
ClearText = @"Clear All",
|
||||
AcceptTypes = new [] { typeof(SimpleNotification) },
|
||||
AcceptTypes = new[] { typeof(SimpleNotification) },
|
||||
},
|
||||
new NotificationSection
|
||||
{
|
||||
Title = @"Running Tasks",
|
||||
ClearText = @"Cancel All",
|
||||
AcceptTypes = new [] { typeof(ProgressNotification) },
|
||||
AcceptTypes = new[] { typeof(ProgressNotification) },
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Notifications
|
||||
{
|
||||
@ -152,7 +152,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
Expire();
|
||||
}
|
||||
|
||||
private class CloseButton : ClickableContainer
|
||||
private class CloseButton : OsuClickableContainer
|
||||
{
|
||||
private Color4 hoverColour;
|
||||
|
||||
@ -202,6 +202,8 @@ namespace osu.Game.Overlays.Notifications
|
||||
get { return pulsate; }
|
||||
set
|
||||
{
|
||||
if (pulsate == value) return;
|
||||
|
||||
pulsate = value;
|
||||
|
||||
pulsateLayer.ClearTransforms();
|
||||
@ -210,25 +212,12 @@ namespace osu.Game.Overlays.Notifications
|
||||
if (pulsate)
|
||||
{
|
||||
const float length = 1000;
|
||||
pulsateLayer.Transforms.Add(new TransformAlpha
|
||||
using (pulsateLayer.BeginLoopedSequence(length / 2))
|
||||
{
|
||||
StartTime = Time.Current,
|
||||
EndTime = Time.Current + length,
|
||||
StartValue = 1,
|
||||
EndValue = 0.4f,
|
||||
Easing = EasingTypes.In
|
||||
});
|
||||
pulsateLayer.Transforms.Add(new TransformAlpha
|
||||
{
|
||||
StartTime = Time.Current + length,
|
||||
EndTime = Time.Current + length * 2,
|
||||
StartValue = 0.4f,
|
||||
EndValue = 1,
|
||||
Easing = EasingTypes.Out
|
||||
});
|
||||
|
||||
//todo: figure why we can't add arbitrary delays at the end of loop.
|
||||
pulsateLayer.Loop(length * 2);
|
||||
pulsateLayer.FadeTo(0.4f, length, EasingTypes.In);
|
||||
using (pulsateLayer.BeginDelayedSequence(length))
|
||||
pulsateLayer.FadeTo(1, length, EasingTypes.Out);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,7 +227,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
set
|
||||
{
|
||||
base.Colour = value;
|
||||
pulsateLayer.EdgeEffect = new EdgeEffect
|
||||
pulsateLayer.EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Colour = ((Color4)value).Opacity(0.5f), //todo: avoid cast
|
||||
Type = EdgeEffectType.Glow,
|
||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Notifications
|
||||
{
|
||||
@ -131,7 +132,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
countText.Text = notifications.Children.Count(c => c.Alpha > 0.99f).ToString();
|
||||
}
|
||||
|
||||
private class ClearAllButton : ClickableContainer
|
||||
private class ClearAllButton : OsuClickableContainer
|
||||
{
|
||||
private readonly OsuSpriteText text;
|
||||
|
||||
|
@ -5,6 +5,7 @@ using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
@ -4,6 +4,7 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
@ -3,12 +3,12 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
@ -125,6 +125,14 @@ namespace osu.Game.Overlays
|
||||
trackSetting(frameworkConfig.GetBindable<int>(FrameworkSetting.Width), v => displayResolution());
|
||||
trackSetting(frameworkConfig.GetBindable<int>(FrameworkSetting.Height), v => displayResolution());
|
||||
|
||||
trackSetting(frameworkConfig.GetBindable<double>(FrameworkSetting.CursorSensitivity), v => display(v, "Cursor Sensitivity", v.ToString(@"0.##x"), "Ctrl+Alt+R to reset"));
|
||||
trackSetting(frameworkConfig.GetBindable<string>(FrameworkSetting.ActiveInputHandlers),
|
||||
delegate (string v)
|
||||
{
|
||||
bool raw = v.Contains("Raw");
|
||||
display(raw, "Raw Input", raw ? "enabled" : "disabled", "Ctrl+Alt+R to reset");
|
||||
});
|
||||
|
||||
trackSetting(frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode), v => display(v, "Screen Mode", v.ToString(), "Alt+Enter"));
|
||||
}
|
||||
|
||||
@ -173,7 +181,7 @@ namespace osu.Game.Overlays
|
||||
textLine2.Origin = optionCount > 0 ? Anchor.BottomCentre : Anchor.Centre;
|
||||
textLine2.Y = optionCount > 0 ? 0 : 5;
|
||||
|
||||
if (optionLights.Children.Count() != optionCount)
|
||||
if (optionLights.Children.Count != optionCount)
|
||||
{
|
||||
optionLights.Clear();
|
||||
for (int i = 0; i < optionCount; i++)
|
||||
@ -181,7 +189,7 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
|
||||
for (int i = 0; i < optionCount; i++)
|
||||
optionLights.Children.Skip(i).First().Glowing = i == selectedOption;
|
||||
optionLights.Children[i].Glowing = i == selectedOption;
|
||||
});
|
||||
}
|
||||
|
||||
@ -245,15 +253,13 @@ namespace osu.Game.Overlays
|
||||
Masking = true;
|
||||
CornerRadius = 3;
|
||||
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Colour = colours.BlueDark.Opacity(glow_strength),
|
||||
Type = EdgeEffectType.Glow,
|
||||
Radius = 8,
|
||||
};
|
||||
|
||||
FadeEdgeEffectTo(0);
|
||||
|
||||
updateGlow();
|
||||
Flush(true);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.SearchableList
|
||||
{
|
||||
@ -52,7 +53,7 @@ namespace osu.Game.Overlays.SearchableList
|
||||
DisplayStyle.Value = PanelDisplayStyle.Grid;
|
||||
}
|
||||
|
||||
private class DisplayStyleToggleButton : ClickableContainer
|
||||
private class DisplayStyleToggleButton : OsuClickableContainer
|
||||
{
|
||||
private readonly TextAwesome icon;
|
||||
private readonly PanelDisplayStyle style;
|
||||
|
@ -2,15 +2,14 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays.SearchableList
|
||||
{
|
||||
@ -29,8 +28,6 @@ namespace osu.Game.Overlays.SearchableList
|
||||
protected abstract T DefaultTab { get; }
|
||||
protected virtual Drawable CreateSupplementaryControls() => null;
|
||||
|
||||
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || DisplayStyleControl.Dropdown.Contains(screenSpacePos);
|
||||
|
||||
protected SearchableListFilterControl()
|
||||
{
|
||||
if (!typeof(T).IsEnum)
|
||||
|
@ -7,8 +7,8 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays.SearchableList
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
|
||||
@ -70,7 +70,7 @@ namespace osu.Game.Overlays.SearchableList
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding { Horizontal = WIDTH_PADDING },
|
||||
Padding = new MarginPadding { Horizontal = WIDTH_PADDING, Bottom = 50 },
|
||||
Direction = FillDirection.Vertical,
|
||||
},
|
||||
},
|
||||
@ -82,7 +82,6 @@ namespace osu.Game.Overlays.SearchableList
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
AlwaysReceiveInput = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Header = CreateHeader(),
|
||||
|
@ -41,4 +41,3 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
set
|
||||
{
|
||||
bounding = value;
|
||||
Invalidate(Invalidation.Geometry);
|
||||
Invalidate(Invalidation.MiscGeometry);
|
||||
}
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
Margin = new MarginPadding { Bottom = 5 };
|
||||
Masking = true;
|
||||
CornerRadius = 5;
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(0.25f),
|
||||
@ -326,7 +326,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
CornerRadius = 5;
|
||||
ItemsContainer.Padding = new MarginPadding(0);
|
||||
Masking = true;
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(0.25f),
|
||||
|
@ -33,4 +33,3 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,4 +22,3 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
letterboxSettings.ClearTransforms();
|
||||
letterboxSettings.AutoSizeAxes = isVisible ? Axes.Y : Axes.None;
|
||||
|
||||
if(!isVisible)
|
||||
if (!isVisible)
|
||||
letterboxSettings.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint);
|
||||
};
|
||||
letterboxing.TriggerChange();
|
||||
|
@ -24,4 +24,3 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,9 +21,6 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
|
||||
{
|
||||
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
|
||||
rawInputToggle.Value = activeInputHandlers.Value.Contains("Raw");
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SettingsCheckbox
|
||||
@ -62,11 +59,17 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
activeInputHandlers.Value = enabled ?
|
||||
activeInputHandlers.Value.Replace(standard_mouse_handler, raw_mouse_handler) :
|
||||
activeInputHandlers.Value.Replace(raw_mouse_handler, standard_mouse_handler);
|
||||
|
||||
sensitivity.Bindable.Disabled = !enabled;
|
||||
};
|
||||
|
||||
rawInputToggle.TriggerChange();
|
||||
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
|
||||
activeInputHandlers.ValueChanged += handlers =>
|
||||
{
|
||||
bool raw = handlers.Contains("Raw");
|
||||
rawInputToggle.Value = raw;
|
||||
sensitivity.Bindable.Disabled = !raw;
|
||||
};
|
||||
|
||||
activeInputHandlers.TriggerChange();
|
||||
}
|
||||
|
||||
private class SensitivitySetting : SettingsSlider<double, SensitivitySlider>
|
||||
|
@ -22,4 +22,3 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
@ -52,4 +52,3 @@ namespace osu.Game.Overlays.Settings
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Overlays.Toolbar;
|
||||
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Settings
|
||||
},
|
||||
new SidebarScrollContainer
|
||||
{
|
||||
Children = new []
|
||||
Children = new[]
|
||||
{
|
||||
content = new FillFlowContainer
|
||||
{
|
||||
|
@ -7,6 +7,7 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
|
@ -6,7 +6,7 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
@ -15,7 +15,7 @@ using osu.Game.Overlays.Settings.Sections;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class SettingsOverlay : FocusedOverlayContainer
|
||||
public class SettingsOverlay : OsuFocusedOverlayContainer
|
||||
{
|
||||
internal const float CONTENT_MARGINS = 10;
|
||||
|
||||
@ -93,7 +93,7 @@ namespace osu.Game.Overlays
|
||||
new SidebarButton
|
||||
{
|
||||
Section = section,
|
||||
Action = sectionsContainer.ScrollContainer.ScrollIntoView,
|
||||
Action = b => sectionsContainer.ScrollContainer.ScrollTo(b),
|
||||
}
|
||||
).ToArray()
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.SearchableList;
|
||||
@ -29,6 +30,8 @@ namespace osu.Game.Overlays
|
||||
protected override SearchableListFilterControl<SocialSortCriteria, SortDirection> CreateFilterControl() => new FilterControl();
|
||||
|
||||
private IEnumerable<User> users;
|
||||
private readonly LoadingAnimation loading;
|
||||
|
||||
public IEnumerable<User> Users
|
||||
{
|
||||
get { return users; }
|
||||
@ -41,7 +44,7 @@ namespace osu.Game.Overlays
|
||||
panelFlow.Clear();
|
||||
else
|
||||
{
|
||||
panelFlow.Children = users.Select(u =>
|
||||
panelFlow.ChildrenEnumerable = users.Select(u =>
|
||||
{
|
||||
var p = new UserPanel(u) { Width = 300 };
|
||||
p.Status.BindTo(u.Status);
|
||||
@ -68,6 +71,8 @@ namespace osu.Game.Overlays
|
||||
Spacing = new Vector2(10f),
|
||||
},
|
||||
};
|
||||
|
||||
Add(loading = new LoadingAnimation());
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -83,8 +88,14 @@ namespace osu.Game.Overlays
|
||||
|
||||
// no this is not the correct data source, but it's something.
|
||||
var request = new GetUsersRequest();
|
||||
request.Success += res => Users = res.Select(e => e.User);
|
||||
request.Success += res =>
|
||||
{
|
||||
Users = res.Select(e => e.User);
|
||||
loading.Hide();
|
||||
};
|
||||
|
||||
api.Queue(request);
|
||||
loading.Show();
|
||||
}
|
||||
|
||||
public void APIStateChanged(APIAccess api, APIState state)
|
||||
|
@ -6,10 +6,10 @@ using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
@ -33,8 +33,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
public Toolbar()
|
||||
{
|
||||
AlwaysReceiveInput = true;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new ToolbarBackground(),
|
||||
@ -55,7 +53,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
AlwaysReceiveInput = true,
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
Direction = FillDirection.Horizontal,
|
||||
|
@ -1,10 +1,6 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -15,10 +11,12 @@ using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public class ToolbarButton : Container
|
||||
public class ToolbarButton : OsuClickableContainer
|
||||
{
|
||||
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
|
||||
|
||||
@ -57,7 +55,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
protected virtual Anchor TooltipAnchor => Anchor.TopLeft;
|
||||
|
||||
public Action Action;
|
||||
protected TextAwesome DrawableIcon;
|
||||
protected SpriteText DrawableText;
|
||||
protected Box HoverBackground;
|
||||
@ -65,7 +62,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
private readonly SpriteText tooltip1;
|
||||
private readonly SpriteText tooltip2;
|
||||
protected FillFlowContainer Flow;
|
||||
private SampleChannel sampleClick;
|
||||
|
||||
public ToolbarButton()
|
||||
{
|
||||
@ -135,27 +131,19 @@ namespace osu.Game.Overlays.Toolbar
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
sampleClick = audio.Sample.Get(@"Menu/menuclick");
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
Action?.Invoke();
|
||||
sampleClick.Play();
|
||||
HoverBackground.FlashColour(Color4.White.Opacity(100), 500, EasingTypes.OutQuint);
|
||||
return true;
|
||||
return base.OnClick(state);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
HoverBackground.FadeIn(200);
|
||||
tooltipContainer.FadeIn(100);
|
||||
return false;
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
@ -172,7 +160,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Masking = true;
|
||||
MaskingSmoothness = 0;
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(40),
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
DrawableIcon.Colour = Color4.White;
|
||||
DrawableIcon.Masking = true;
|
||||
DrawableIcon.EdgeEffect = new EdgeEffect
|
||||
DrawableIcon.EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Glow,
|
||||
Colour = new Color4(255, 194, 224, 100),
|
||||
@ -55,4 +55,4 @@ namespace osu.Game.Overlays.Toolbar
|
||||
DrawableIcon.TextSize *= 1.4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,11 +6,11 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Caching;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Database;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
@ -46,14 +46,14 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
Masking = true,
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Glow,
|
||||
Colour = new Color4(255, 194, 224, 100),
|
||||
Radius = 15,
|
||||
Roundness = 15,
|
||||
},
|
||||
Children = new []
|
||||
Children = new[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
@ -113,8 +113,11 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
base.UpdateAfterChildren();
|
||||
|
||||
if (!activeMode.EnsureValid())
|
||||
activeMode.Refresh(() => modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, EasingTypes.OutQuint));
|
||||
if (!activeMode.IsValid)
|
||||
{
|
||||
modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, EasingTypes.OutQuint);
|
||||
activeMode.Validate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
@ -45,7 +45,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
stateContainer.StateChanged -= stateChanged;
|
||||
}
|
||||
|
||||
private void stateChanged(OverlayContainer c, Visibility state)
|
||||
private void stateChanged(VisibilityContainer c, Visibility state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
|
@ -17,8 +17,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
public ToolbarUserArea()
|
||||
{
|
||||
AlwaysReceiveInput = true;
|
||||
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
AutoSizeAxes = Axes.X;
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
CornerRadius = 4,
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Radius = 4,
|
||||
|
@ -6,12 +6,13 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using System;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public abstract class WaveOverlayContainer : FocusedOverlayContainer
|
||||
public abstract class WaveOverlayContainer : OsuFocusedOverlayContainer
|
||||
{
|
||||
protected const float APPEAR_DURATION = 800;
|
||||
protected const float DISAPPEAR_DURATION = 500;
|
||||
@ -173,7 +174,7 @@ namespace osu.Game.Overlays
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Width = 1.5f;
|
||||
Masking = true;
|
||||
EdgeEffect = new EdgeEffect
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(50),
|
||||
|
Reference in New Issue
Block a user