mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge branch 'master' into modselect
This commit is contained in:
@ -27,7 +27,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
public class ChatOverlay : FocusedOverlayContainer, IOnlineComponent
|
||||
{
|
||||
const float textbox_height = 40;
|
||||
private const float textbox_height = 40;
|
||||
|
||||
private ScheduledDelegate messageRequest;
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
fill = new Box()
|
||||
fill = new Box
|
||||
{
|
||||
Origin = Anchor.CentreLeft,
|
||||
Anchor = Anchor.CentreLeft,
|
||||
|
@ -13,11 +13,11 @@ using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
class LoginOverlay : FocusedOverlayContainer
|
||||
internal class LoginOverlay : FocusedOverlayContainer
|
||||
{
|
||||
private LoginOptions optionsSection;
|
||||
|
||||
const float transition_time = 400;
|
||||
private const float transition_time = 400;
|
||||
|
||||
public LoginOverlay()
|
||||
{
|
||||
|
@ -105,25 +105,19 @@ namespace osu.Game.Overlays.Mods
|
||||
if (mod == value) return;
|
||||
mod = value;
|
||||
|
||||
if (mod is MultiMod)
|
||||
{
|
||||
mods = ((MultiMod)mod).Mods;
|
||||
}
|
||||
else
|
||||
{
|
||||
mods = new Mod[] { mod };
|
||||
}
|
||||
Mods = (mod as MultiMod)?.Mods ?? new[] { mod };
|
||||
|
||||
createIcons();
|
||||
if (mods.Length > 0)
|
||||
if (Mods.Length > 0)
|
||||
{
|
||||
displayMod(mods[0]);
|
||||
displayMod(Mods[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Mod[] mods;
|
||||
public Mod[] Mods => mods; // the mods from Mod, only multiple if Mod is a MultiMod
|
||||
public Mod[] Mods { get; private set; }
|
||||
|
||||
// the mods from Mod, only multiple if Mod is a MultiMod
|
||||
|
||||
public Mod SelectedMod => Mods.ElementAtOrDefault(selectedIndex);
|
||||
|
||||
@ -178,7 +172,7 @@ namespace osu.Game.Overlays.Mods
|
||||
iconsContainer.Clear();
|
||||
if (Mods.Length > 1)
|
||||
{
|
||||
iconsContainer.Add(new[]
|
||||
iconsContainer.Add(new ModIcon[]
|
||||
{
|
||||
new ModIcon
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Mods
|
||||
}
|
||||
|
||||
private Color4 colour = Color4.White;
|
||||
new public Color4 Colour
|
||||
public new Color4 Colour
|
||||
{
|
||||
get
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override bool OnDrag(InputState state)
|
||||
{
|
||||
Vector2 change = (state.Mouse.Position - state.Mouse.PositionMouseDown.Value);
|
||||
Vector2 change = state.Mouse.Position - state.Mouse.PositionMouseDown.Value;
|
||||
|
||||
// Diminish the drag distance as we go further to simulate "rubber band" feeling.
|
||||
change *= (float)Math.Pow(change.Length, 0.7f) / change.Length;
|
||||
@ -246,14 +246,14 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
}
|
||||
|
||||
void preferUnicode_changed(object sender, EventArgs e)
|
||||
private void preferUnicode_changed(object sender, EventArgs e)
|
||||
{
|
||||
updateDisplay(current, TransformDirection.None);
|
||||
}
|
||||
|
||||
private void workingChanged(object sender = null, EventArgs e = null)
|
||||
{
|
||||
progress.IsEnabled = (beatmapSource.Value != null);
|
||||
progress.IsEnabled = beatmapSource.Value != null;
|
||||
if (beatmapSource.Value == current) return;
|
||||
bool audioEquals = current?.BeatmapInfo?.AudioEquals(beatmapSource?.Value?.BeatmapInfo) ?? false;
|
||||
current = beatmapSource.Value;
|
||||
@ -323,7 +323,7 @@ namespace osu.Game.Overlays
|
||||
updateDisplay(current, isNext ? TransformDirection.Next : TransformDirection.Prev);
|
||||
}
|
||||
|
||||
Action pendingBeatmapSwitch;
|
||||
private Action pendingBeatmapSwitch;
|
||||
|
||||
private void updateDisplay(WorkingBeatmap beatmap, TransformDirection direction)
|
||||
{
|
||||
@ -384,7 +384,7 @@ namespace osu.Game.Overlays
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
|
||||
const float transition_length = 800;
|
||||
private const float transition_length = 800;
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Overlays
|
||||
};
|
||||
}
|
||||
|
||||
int runningDepth = 0;
|
||||
private int runningDepth;
|
||||
|
||||
public void Post(Notification notification)
|
||||
{
|
||||
|
@ -43,16 +43,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
protected Container NotificationContent;
|
||||
|
||||
private bool read;
|
||||
|
||||
public virtual bool Read
|
||||
{
|
||||
get { return read; }
|
||||
set
|
||||
{
|
||||
read = value;
|
||||
}
|
||||
}
|
||||
public virtual bool Read { get; set; }
|
||||
|
||||
public Notification()
|
||||
{
|
||||
@ -162,7 +153,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
Expire();
|
||||
}
|
||||
|
||||
class CloseButton : ClickableContainer
|
||||
private class CloseButton : ClickableContainer
|
||||
{
|
||||
private Color4 hoverColour;
|
||||
|
||||
@ -176,6 +167,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.fa_times_circle,
|
||||
}
|
||||
};
|
||||
|
@ -133,7 +133,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
countText.Text = notifications.Children.Count(c => c.Alpha > 0.99f).ToString();
|
||||
}
|
||||
|
||||
class ClearAllButton : ClickableContainer
|
||||
private class ClearAllButton : ClickableContainer
|
||||
{
|
||||
private OsuSpriteText text;
|
||||
|
||||
|
@ -168,7 +168,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
/// </summary>
|
||||
public Func<bool> CompletionClickAction;
|
||||
|
||||
class ProgressBar : Container
|
||||
private class ProgressBar : Container
|
||||
{
|
||||
private Box box;
|
||||
|
||||
|
@ -51,6 +51,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
iconDrawable = new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = icon,
|
||||
}
|
||||
});
|
||||
|
@ -46,12 +46,12 @@ namespace osu.Game.Overlays.Options
|
||||
|
||||
private Bindable<T> bindable;
|
||||
|
||||
void bindable_ValueChanged(object sender, EventArgs e)
|
||||
private void bindable_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
dropdown.SelectedValue = bindable.Value;
|
||||
}
|
||||
|
||||
void dropdown_ValueChanged(object sender, EventArgs e)
|
||||
private void dropdown_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
bindable.Value = dropdown.SelectedValue;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ using osu.Game.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays.Options
|
||||
{
|
||||
class OptionLabel : OsuSpriteText
|
||||
internal class OptionLabel : OsuSpriteText
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colour)
|
||||
|
68
osu.Game/Overlays/Options/OptionsFooter.cs
Normal file
68
osu.Game/Overlays/Options/OptionsFooter.cs
Normal file
@ -0,0 +1,68 @@
|
||||
// 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 System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Modes;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Options
|
||||
{
|
||||
public class OptionsFooter : FillFlowContainer
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game, OsuColour colours)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
Direction = FillDirection.Vertical;
|
||||
Padding = new MarginPadding { Top = 20, Bottom = 30 };
|
||||
|
||||
var modes = new List<Drawable>();
|
||||
|
||||
foreach (PlayMode m in Enum.GetValues(typeof(PlayMode)))
|
||||
modes.Add(new TextAwesome
|
||||
{
|
||||
Icon = Ruleset.GetRuleset(m).Icon,
|
||||
Colour = Color4.Gray,
|
||||
});
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Direction = FillDirection.Full,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = modes,
|
||||
Spacing = new Vector2(5),
|
||||
Padding = new MarginPadding { Bottom = 10 },
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = game.Name,
|
||||
TextSize = 18,
|
||||
Font = @"Exo2.0-Bold",
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
TextSize = 14,
|
||||
Text = game.Version,
|
||||
Colour = game.IsDebug ? colours.Red : Color4.White,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -11,8 +11,7 @@ namespace osu.Game.Overlays.Options
|
||||
{
|
||||
public abstract class OptionsSubsection : FillFlowContainer
|
||||
{
|
||||
private Container<Drawable> content;
|
||||
protected override Container<Drawable> Content => content;
|
||||
protected override Container<Drawable> Content { get; }
|
||||
|
||||
protected abstract string Header { get; }
|
||||
|
||||
@ -29,7 +28,7 @@ namespace osu.Game.Overlays.Options
|
||||
Margin = new MarginPadding { Bottom = 10 },
|
||||
Font = @"Exo2.0-Black",
|
||||
},
|
||||
content = new FillFlowContainer
|
||||
Content = new FillFlowContainer
|
||||
{
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 5),
|
||||
|
@ -32,12 +32,11 @@ namespace osu.Game.Overlays.Options.Sections.Audio
|
||||
|
||||
private void updateItems()
|
||||
{
|
||||
var deviceItems = new List<KeyValuePair<string, string>>();
|
||||
deviceItems.Add(new KeyValuePair<string, string>("Default", string.Empty));
|
||||
var deviceItems = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("Default", string.Empty) };
|
||||
deviceItems.AddRange(audio.AudioDeviceNames.Select(d => new KeyValuePair<string, string>(d, d)));
|
||||
|
||||
var preferredDeviceName = audio.AudioDevice.Value;
|
||||
if (!deviceItems.Any(kv => kv.Value == preferredDeviceName))
|
||||
if (deviceItems.All(kv => kv.Value != preferredDeviceName))
|
||||
deviceItems.Add(new KeyValuePair<string, string>(preferredDeviceName, preferredDeviceName));
|
||||
|
||||
dropdown.Items = deviceItems;
|
||||
@ -51,7 +50,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
dropdown = new OptionDropDown<string>()
|
||||
dropdown = new OptionDropDown<string>
|
||||
{
|
||||
Bindable = audio.AudioDevice
|
||||
},
|
||||
|
28
osu.Game/Overlays/Options/Sections/Debug/GeneralOptions.cs
Normal file
28
osu.Game/Overlays/Options/Sections/Debug/GeneralOptions.cs
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays.Options.Sections.Debug
|
||||
{
|
||||
public class GeneralOptions : OptionsSubsection
|
||||
{
|
||||
protected override string Header => "General";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkDebugConfigManager config)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuCheckbox
|
||||
{
|
||||
LabelText = "Bypass caching",
|
||||
Bindable = config.GetBindable<bool>(FrameworkDebugConfig.BypassCaching)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -16,6 +16,7 @@ namespace osu.Game.Overlays.Options.Sections
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new GeneralOptions(),
|
||||
new GCOptions(),
|
||||
};
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Options.Sections.General
|
||||
}
|
||||
}
|
||||
|
||||
class LoginForm : FillFlowContainer
|
||||
private class LoginForm : FillFlowContainer
|
||||
{
|
||||
private TextBox username;
|
||||
private TextBox password;
|
||||
|
@ -5,7 +5,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Options.Sections
|
||||
{
|
||||
@ -39,20 +38,6 @@ namespace osu.Game.Overlays.Options.Sections
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = "Run osu! updater",
|
||||
},
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Children = new[]
|
||||
{
|
||||
new OptionLabel
|
||||
{
|
||||
Text = "osu!lazer",
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,8 @@ namespace osu.Game.Overlays
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = sections,
|
||||
}
|
||||
},
|
||||
new OptionsFooter()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new ToolbarSettingsButton(),
|
||||
new ToolbarHomeButton()
|
||||
new ToolbarHomeButton
|
||||
{
|
||||
Action = () => OnHome?.Invoke()
|
||||
},
|
||||
@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
FadeOut(transition_time);
|
||||
}
|
||||
|
||||
class PassThroughFlowContainer : FillFlowContainer
|
||||
private class PassThroughFlowContainer : FillFlowContainer
|
||||
{
|
||||
//needed to get input to the login overlay.
|
||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||
|
@ -5,7 +5,7 @@ using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarHomeButton : ToolbarButton
|
||||
internal class ToolbarHomeButton : ToolbarButton
|
||||
{
|
||||
public ToolbarHomeButton()
|
||||
{
|
||||
|
@ -15,9 +15,9 @@ using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarModeSelector : Container
|
||||
internal class ToolbarModeSelector : Container
|
||||
{
|
||||
const float padding = 10;
|
||||
private const float padding = 10;
|
||||
|
||||
private FillFlowContainer modeButtons;
|
||||
private Drawable modeButtonLine;
|
||||
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
|
||||
Children = new Drawable[]
|
||||
Children = new[]
|
||||
{
|
||||
new OpaqueBackground(),
|
||||
modeButtons = new FillFlowContainer
|
||||
|
@ -6,7 +6,7 @@ using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarMusicButton : ToolbarOverlayToggleButton
|
||||
internal class ToolbarMusicButton : ToolbarOverlayToggleButton
|
||||
{
|
||||
public ToolbarMusicButton()
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarNotificationButton : ToolbarOverlayToggleButton
|
||||
internal class ToolbarNotificationButton : ToolbarOverlayToggleButton
|
||||
{
|
||||
protected override Anchor TooltipAnchor => Anchor.TopRight;
|
||||
|
||||
|
@ -9,7 +9,7 @@ using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarOverlayToggleButton : ToolbarButton
|
||||
internal class ToolbarOverlayToggleButton : ToolbarButton
|
||||
{
|
||||
private Box stateBackground;
|
||||
|
||||
|
@ -6,7 +6,7 @@ using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarSettingsButton : ToolbarOverlayToggleButton
|
||||
internal class ToolbarSettingsButton : ToolbarOverlayToggleButton
|
||||
{
|
||||
public ToolbarSettingsButton()
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ using OpenTK;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarUserArea : Container
|
||||
internal class ToolbarUserArea : Container
|
||||
{
|
||||
public LoginOverlay LoginOverlay;
|
||||
private ToolbarUserButton button;
|
||||
|
@ -14,7 +14,7 @@ using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarUserButton : ToolbarButton, IOnlineComponent
|
||||
internal class ToolbarUserButton : ToolbarButton, IOnlineComponent
|
||||
{
|
||||
private Avatar avatar;
|
||||
|
||||
|
@ -134,19 +134,23 @@ namespace osu.Game.Overlays
|
||||
foreach (var w in wavesContainer.Children)
|
||||
w.State = Visibility.Visible;
|
||||
|
||||
contentContainer.FadeIn(APPEAR_DURATION, EasingTypes.OutQuint);
|
||||
FadeIn(100, EasingTypes.OutQuint);
|
||||
contentContainer.MoveToY(0, APPEAR_DURATION, EasingTypes.OutQuint);
|
||||
|
||||
FadeIn(100, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
contentContainer.FadeOut(DISAPPEAR_DURATION, EasingTypes.In);
|
||||
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
|
||||
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, EasingTypes.In);
|
||||
|
||||
foreach (var w in wavesContainer.Children)
|
||||
w.State = Visibility.Hidden;
|
||||
|
||||
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
|
Reference in New Issue
Block a user