2 Commits

Author SHA1 Message Date
b7d1092f90 Merge branch 'master' of https://gitea.jvnko.boats/jvnkosu/client 2025-11-15 17:02:04 +03:00
08db90c278 some minor hud changes
- argon-style cps counter
- keybinds in key counters (for now, only default)
2025-11-15 16:45:14 +03:00
13 changed files with 168 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps
LocallyModified = -4,
[LocalisableDescription(typeof(SongSelectStrings), nameof(SongSelectStrings.StatusUnknown))]
[Description("Unknown")]
[Description("Offline")]
None = -3,
[LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowStatusGraveyard))]

View File

@@ -33,7 +33,8 @@ namespace osu.Game.Beatmaps.Drawables.Cards
Status = beatmapSet.Status,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
TextSize = 13f
TextSize = 13f,
ShowUnknownStatus = true
},
new DifficultySpectrumDisplay
{

View File

@@ -129,7 +129,7 @@ namespace osu.Game.Graphics
switch (status)
{
case BeatmapOnlineStatus.None:
return Color4.RosyBrown;
return Color4.AliceBlue;
case BeatmapOnlineStatus.LocallyModified:
return Color4.OrangeRed;

View File

@@ -40,9 +40,9 @@ namespace osu.Game.Localisation
public static LocalisableString LocallyModifiedTooltip => new TranslatableString(getKey(@"locally_modified_tooltip"), @"Has been locally modified");
/// <summary>
/// "Unknown"
/// "Offline"
/// </summary>
public static LocalisableString StatusUnknown => new TranslatableString(getKey(@"status_unknown"), @"Unknown");
public static LocalisableString StatusUnknown => new TranslatableString(getKey(@"status_unknown"), @"Offline");
/// <summary>
/// "Total Plays"

View File

@@ -191,7 +191,8 @@ namespace osu.Game.Overlays.BeatmapSet
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
TextSize = 14,
TextPadding = new MarginPadding { Horizontal = 35, Vertical = 10 }
TextPadding = new MarginPadding { Horizontal = 35, Vertical = 10 },
ShowUnknownStatus = true
},
storyboardIconPill = new StoryboardIconPill
{

View File

@@ -2,6 +2,8 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@@ -32,6 +34,8 @@ namespace osu.Game.Rulesets.UI
public readonly KeyBindingContainer<T> KeyBindingContainer;
private readonly RulesetKeyBindingContainer rulesetKeyBindingContainer;
[Resolved]
private ScoreProcessor? scoreProcessor { get; set; }
@@ -64,8 +68,10 @@ namespace osu.Game.Rulesets.UI
protected RulesetInputManager(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
{
rulesetKeyBindingContainer = createRulesetKeyBindingContainer(ruleset, variant, unique);
InternalChild = KeyBindingContainer =
CreateKeyBindingContainer(ruleset, variant, unique)
rulesetKeyBindingContainer
.WithChild(content = new Container { RelativeSizeAxes = Axes.Both });
}
@@ -174,11 +180,10 @@ namespace osu.Game.Rulesets.UI
public void Attach(InputCountController inputCountController)
{
var triggers = KeyBindingContainer.DefaultKeyBindings
.Select(b => b.GetAction<T>())
.Distinct()
.Select(action => new KeyCounterActionTrigger<T>(action))
.ToArray();
var bindings = rulesetKeyBindingContainer.DefaultKeyBindings;
var triggers = bindings.Select(b => new KeyCounterBindingTrigger<T>(b, b.GetAction<T>()))
.DistinctBy(b => b.Action)
.ToArray();
KeyBindingContainer.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)
=> 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>
{
protected override bool HandleRepeats => false;

View File

@@ -411,7 +411,7 @@ namespace osu.Game.Screens.Menu
// if the dialog has already displayed and been accepted by the user, we are good.
&& !exitConfirmedViaDialog
// 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)
{

View File

@@ -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();
}
}
}
}

View 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);
}
}
}

View File

@@ -269,6 +269,7 @@ namespace osu.Game.Screens.Select
TextSize = 11,
TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
Status = beatmapInfo.Status,
ShowUnknownStatus = true,
Alpha = string.IsNullOrEmpty(beatmapInfo.DifficultyName) ? 0 : 1
}
}

View File

@@ -81,6 +81,7 @@ namespace osu.Game.Screens.Select.Carousel
Anchor = Anchor.CentreLeft,
TextSize = 11,
TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
ShowUnknownStatus = true,
Status = beatmapSet.Status
},
iconFlow = new FillFlowContainer<DifficultyIcon>

View File

@@ -143,6 +143,7 @@ namespace osu.Game.Screens.SelectV2
TextSize = OsuFont.Style.Caption2.Size,
Margin = new MarginPadding { Right = 5f },
Animated = false,
ShowUnknownStatus = true
},
updateButton = new PanelUpdateBeatmapButton
{

View File

@@ -149,6 +149,7 @@ namespace osu.Game.Screens.SelectV2
Anchor = Anchor.BottomLeft,
TextSize = OsuFont.Style.Caption2.Size,
Margin = new MarginPadding { Right = 4f },
ShowUnknownStatus = true
},
updateButton = new PanelUpdateBeatmapButton
{