Compare commits
2 Commits
b7e36164c3
...
b7d1092f90
| Author | SHA1 | Date | |
|---|---|---|---|
| b7d1092f90 | |||
| 08db90c278 |
@@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps
|
|||||||
LocallyModified = -4,
|
LocallyModified = -4,
|
||||||
|
|
||||||
[LocalisableDescription(typeof(SongSelectStrings), nameof(SongSelectStrings.StatusUnknown))]
|
[LocalisableDescription(typeof(SongSelectStrings), nameof(SongSelectStrings.StatusUnknown))]
|
||||||
[Description("Unknown")]
|
[Description("Offline")]
|
||||||
None = -3,
|
None = -3,
|
||||||
|
|
||||||
[LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowStatusGraveyard))]
|
[LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowStatusGraveyard))]
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
|||||||
Status = beatmapSet.Status,
|
Status = beatmapSet.Status,
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
TextSize = 13f
|
TextSize = 13f,
|
||||||
|
ShowUnknownStatus = true
|
||||||
},
|
},
|
||||||
new DifficultySpectrumDisplay
|
new DifficultySpectrumDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ namespace osu.Game.Graphics
|
|||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
case BeatmapOnlineStatus.None:
|
case BeatmapOnlineStatus.None:
|
||||||
return Color4.RosyBrown;
|
return Color4.AliceBlue;
|
||||||
|
|
||||||
case BeatmapOnlineStatus.LocallyModified:
|
case BeatmapOnlineStatus.LocallyModified:
|
||||||
return Color4.OrangeRed;
|
return Color4.OrangeRed;
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ namespace osu.Game.Localisation
|
|||||||
public static LocalisableString LocallyModifiedTooltip => new TranslatableString(getKey(@"locally_modified_tooltip"), @"Has been locally modified");
|
public static LocalisableString LocallyModifiedTooltip => new TranslatableString(getKey(@"locally_modified_tooltip"), @"Has been locally modified");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Unknown"
|
/// "Offline"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString StatusUnknown => new TranslatableString(getKey(@"status_unknown"), @"Unknown");
|
public static LocalisableString StatusUnknown => new TranslatableString(getKey(@"status_unknown"), @"Offline");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Total Plays"
|
/// "Total Plays"
|
||||||
|
|||||||
@@ -191,7 +191,8 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
TextSize = 14,
|
TextSize = 14,
|
||||||
TextPadding = new MarginPadding { Horizontal = 35, Vertical = 10 }
|
TextPadding = new MarginPadding { Horizontal = 35, Vertical = 10 },
|
||||||
|
ShowUnknownStatus = true
|
||||||
},
|
},
|
||||||
storyboardIconPill = new StoryboardIconPill
|
storyboardIconPill = new StoryboardIconPill
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@@ -32,6 +34,8 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public readonly KeyBindingContainer<T> KeyBindingContainer;
|
public readonly KeyBindingContainer<T> KeyBindingContainer;
|
||||||
|
|
||||||
|
private readonly RulesetKeyBindingContainer rulesetKeyBindingContainer;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private ScoreProcessor? scoreProcessor { get; set; }
|
private ScoreProcessor? scoreProcessor { get; set; }
|
||||||
|
|
||||||
@@ -64,8 +68,10 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
protected RulesetInputManager(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
protected RulesetInputManager(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
||||||
{
|
{
|
||||||
|
rulesetKeyBindingContainer = createRulesetKeyBindingContainer(ruleset, variant, unique);
|
||||||
|
|
||||||
InternalChild = KeyBindingContainer =
|
InternalChild = KeyBindingContainer =
|
||||||
CreateKeyBindingContainer(ruleset, variant, unique)
|
rulesetKeyBindingContainer
|
||||||
.WithChild(content = new Container { RelativeSizeAxes = Axes.Both });
|
.WithChild(content = new Container { RelativeSizeAxes = Axes.Both });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,11 +180,10 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public void Attach(InputCountController inputCountController)
|
public void Attach(InputCountController inputCountController)
|
||||||
{
|
{
|
||||||
var triggers = KeyBindingContainer.DefaultKeyBindings
|
var bindings = rulesetKeyBindingContainer.DefaultKeyBindings;
|
||||||
.Select(b => b.GetAction<T>())
|
var triggers = bindings.Select(b => new KeyCounterBindingTrigger<T>(b, b.GetAction<T>()))
|
||||||
.Distinct()
|
.DistinctBy(b => b.Action)
|
||||||
.Select(action => new KeyCounterActionTrigger<T>(action))
|
.ToArray();
|
||||||
.ToArray();
|
|
||||||
|
|
||||||
KeyBindingContainer.AddRange(triggers);
|
KeyBindingContainer.AddRange(triggers);
|
||||||
inputCountController.AddRange(triggers);
|
inputCountController.AddRange(triggers);
|
||||||
@@ -215,6 +220,9 @@ namespace osu.Game.Rulesets.UI
|
|||||||
protected virtual KeyBindingContainer<T> CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
protected virtual KeyBindingContainer<T> CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
||||||
=> new RulesetKeyBindingContainer(ruleset, variant, unique);
|
=> new RulesetKeyBindingContainer(ruleset, variant, unique);
|
||||||
|
|
||||||
|
private RulesetKeyBindingContainer createRulesetKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
||||||
|
=> new RulesetKeyBindingContainer(ruleset, variant, unique);
|
||||||
|
|
||||||
public partial class RulesetKeyBindingContainer : DatabasedKeyBindingContainer<T>
|
public partial class RulesetKeyBindingContainer : DatabasedKeyBindingContainer<T>
|
||||||
{
|
{
|
||||||
protected override bool HandleRepeats => false;
|
protected override bool HandleRepeats => false;
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
// if the dialog has already displayed and been accepted by the user, we are good.
|
// if the dialog has already displayed and been accepted by the user, we are good.
|
||||||
&& !exitConfirmedViaDialog
|
&& !exitConfirmedViaDialog
|
||||||
// Only require confirmation if there is either an ongoing operation or the user exited via a non-hold escape press.
|
// Only require confirmation if there is either an ongoing operation or the user exited via a non-hold escape press.
|
||||||
&& (notifications.HasOngoingOperations /* || !exitConfirmedViaHoldOrClick */);
|
&& (notifications.HasOngoingOperations || !exitConfirmedViaHoldOrClick);
|
||||||
|
|
||||||
if (requiresConfirmation)
|
if (requiresConfirmation)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Localisation.SkinComponents;
|
||||||
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Play.HUD.ClicksPerSecond
|
||||||
|
{
|
||||||
|
public partial class ArgonClicksPerSecondCounter : RollingCounter<int>, ISerialisableDrawable
|
||||||
|
{
|
||||||
|
[Resolved]
|
||||||
|
private ClicksPerSecondController controller { get; set; } = null!;
|
||||||
|
|
||||||
|
protected override double RollingDuration => 175;
|
||||||
|
|
||||||
|
[SettingSource("Wireframe opacity", "Controls the opacity of the wireframes behind the digits.")]
|
||||||
|
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.25f)
|
||||||
|
{
|
||||||
|
Precision = 0.01f,
|
||||||
|
MinValue = 0,
|
||||||
|
MaxValue = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.ShowLabel))]
|
||||||
|
public Bindable<bool> ShowLabel { get; } = new BindableBool(true);
|
||||||
|
|
||||||
|
public bool UsesFixedAnchor { get; set; }
|
||||||
|
|
||||||
|
public ArgonClicksPerSecondCounter()
|
||||||
|
{
|
||||||
|
Current.Value = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
Current.Value = controller.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IHasText CreateText() => new TextComponent()
|
||||||
|
{
|
||||||
|
WireframeOpacity = { BindTarget = WireframeOpacity },
|
||||||
|
ShowLabel = { BindTarget = ShowLabel },
|
||||||
|
};
|
||||||
|
|
||||||
|
private partial class TextComponent : CompositeDrawable, IHasText
|
||||||
|
{
|
||||||
|
private readonly ArgonCounterTextComponent cpsValue;
|
||||||
|
|
||||||
|
public IBindable<float> WireframeOpacity { get; } = new BindableFloat();
|
||||||
|
|
||||||
|
public Bindable<bool> ShowLabel { get; } = new BindableBool();
|
||||||
|
|
||||||
|
public LocalisableString Text
|
||||||
|
{
|
||||||
|
get => cpsValue.Text;
|
||||||
|
set => cpsValue.Text = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextComponent()
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
InternalChild = new FillFlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Child = cpsValue = new ArgonCounterTextComponent(Anchor.TopLeft, "KEYS/SEC") // welp, not good
|
||||||
|
{
|
||||||
|
WireframeOpacity = { BindTarget = WireframeOpacity },
|
||||||
|
WireframeTemplate = @"##",
|
||||||
|
ShowLabel = { BindTarget = ShowLabel },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
osu.Game/Screens/Play/HUD/KeyCounterBindingTrigger.cs
Normal file
38
osu.Game/Screens/Play/HUD/KeyCounterBindingTrigger.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Input.Bindings;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Play.HUD
|
||||||
|
{
|
||||||
|
public partial class KeyCounterBindingTrigger<T> : InputTrigger, IKeyBindingHandler<T>
|
||||||
|
where T : struct
|
||||||
|
{
|
||||||
|
public T Action { get; }
|
||||||
|
|
||||||
|
public KeyCounterBindingTrigger(IKeyBinding key, T action)
|
||||||
|
: base(key?.KeyCombination.Keys[0].ToString() ?? $"B{(int)(object)action + 1}")
|
||||||
|
{
|
||||||
|
Action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OnPressed(KeyBindingPressEvent<T> e)
|
||||||
|
{
|
||||||
|
if (!EqualityComparer<T>.Default.Equals(e.Action, Action))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Activate(Clock.Rate >= 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnReleased(KeyBindingReleaseEvent<T> e)
|
||||||
|
{
|
||||||
|
if (!EqualityComparer<T>.Default.Equals(e.Action, Action))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Deactivate(Clock.Rate >= 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -269,6 +269,7 @@ namespace osu.Game.Screens.Select
|
|||||||
TextSize = 11,
|
TextSize = 11,
|
||||||
TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
|
TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
|
||||||
Status = beatmapInfo.Status,
|
Status = beatmapInfo.Status,
|
||||||
|
ShowUnknownStatus = true,
|
||||||
Alpha = string.IsNullOrEmpty(beatmapInfo.DifficultyName) ? 0 : 1
|
Alpha = string.IsNullOrEmpty(beatmapInfo.DifficultyName) ? 0 : 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
TextSize = 11,
|
TextSize = 11,
|
||||||
TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
|
TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
|
||||||
|
ShowUnknownStatus = true,
|
||||||
Status = beatmapSet.Status
|
Status = beatmapSet.Status
|
||||||
},
|
},
|
||||||
iconFlow = new FillFlowContainer<DifficultyIcon>
|
iconFlow = new FillFlowContainer<DifficultyIcon>
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ namespace osu.Game.Screens.SelectV2
|
|||||||
TextSize = OsuFont.Style.Caption2.Size,
|
TextSize = OsuFont.Style.Caption2.Size,
|
||||||
Margin = new MarginPadding { Right = 5f },
|
Margin = new MarginPadding { Right = 5f },
|
||||||
Animated = false,
|
Animated = false,
|
||||||
|
ShowUnknownStatus = true
|
||||||
},
|
},
|
||||||
updateButton = new PanelUpdateBeatmapButton
|
updateButton = new PanelUpdateBeatmapButton
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ namespace osu.Game.Screens.SelectV2
|
|||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
TextSize = OsuFont.Style.Caption2.Size,
|
TextSize = OsuFont.Style.Caption2.Size,
|
||||||
Margin = new MarginPadding { Right = 4f },
|
Margin = new MarginPadding { Right = 4f },
|
||||||
|
ShowUnknownStatus = true
|
||||||
},
|
},
|
||||||
updateButton = new PanelUpdateBeatmapButton
|
updateButton = new PanelUpdateBeatmapButton
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user