mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 12:27:26 +08:00
Merge pull request #30334 from SupDos/argonsongprogress-absolute-size
Add "Use relative size" setting to argon & default song progress
This commit is contained in:
commit
00b2bdd0af
@ -79,6 +79,11 @@ namespace osu.Game.Localisation.SkinComponents
|
||||
/// </summary>
|
||||
public static LocalisableString TextColourDescription => new TranslatableString(getKey(@"text_colour_description"), @"The colour of the text.");
|
||||
|
||||
/// <summary>
|
||||
/// "Use relative size"
|
||||
/// </summary>
|
||||
public static LocalisableString UseRelativeSize => new TranslatableString(getKey(@"use_relative_size"), @"Use relative size");
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ using osu.Framework.Layout;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Localisation.SkinComponents;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Screens.Play.HUD.ArgonHealthDisplayParts;
|
||||
using osu.Game.Skinning;
|
||||
@ -33,7 +34,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
Precision = 1
|
||||
};
|
||||
|
||||
[SettingSource("Use relative size")]
|
||||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.UseRelativeSize))]
|
||||
public BindableBool UseRelativeSize { get; } = new BindableBool(true);
|
||||
|
||||
private ArgonHealthDisplayBar mainBar = null!;
|
||||
|
@ -30,6 +30,9 @@ namespace osu.Game.Screens.Play.HUD
|
||||
[SettingSource(typeof(SongProgressStrings), nameof(SongProgressStrings.ShowTime), nameof(SongProgressStrings.ShowTimeDescription))]
|
||||
public Bindable<bool> ShowTime { get; } = new BindableBool(true);
|
||||
|
||||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.UseRelativeSize))]
|
||||
public BindableBool UseRelativeSize { get; } = new BindableBool(true);
|
||||
|
||||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Colour), nameof(SkinnableComponentStrings.ColourDescription))]
|
||||
public BindableColour4 AccentColour { get; } = new BindableColour4(Colour4.White);
|
||||
|
||||
@ -99,6 +102,11 @@ namespace osu.Game.Screens.Play.HUD
|
||||
ShowGraph.BindValueChanged(_ => updateGraphVisibility(), true);
|
||||
ShowTime.BindValueChanged(_ => info.FadeTo(ShowTime.Value ? 1 : 0, 200, Easing.In), true);
|
||||
AccentColour.BindValueChanged(_ => Colour = AccentColour.Value, true);
|
||||
|
||||
// see comment in ArgonHealthDisplay.cs regarding RelativeSizeAxes
|
||||
float previousWidth = Width;
|
||||
UseRelativeSize.BindValueChanged(v => RelativeSizeAxes = v.NewValue ? Axes.X : Axes.None, true);
|
||||
Width = previousWidth;
|
||||
}
|
||||
|
||||
protected override void UpdateObjects(IEnumerable<HitObject> objects)
|
||||
|
@ -37,6 +37,9 @@ namespace osu.Game.Screens.Play.HUD
|
||||
[SettingSource(typeof(SongProgressStrings), nameof(SongProgressStrings.ShowTime), nameof(SongProgressStrings.ShowTimeDescription))]
|
||||
public Bindable<bool> ShowTime { get; } = new BindableBool(true);
|
||||
|
||||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.UseRelativeSize))]
|
||||
public BindableBool UseRelativeSize { get; } = new BindableBool(true);
|
||||
|
||||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Colour), nameof(SkinnableComponentStrings.ColourDescription))]
|
||||
public BindableColour4 AccentColour { get; } = new BindableColour4(Colour4.White);
|
||||
|
||||
@ -83,6 +86,11 @@ namespace osu.Game.Screens.Play.HUD
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
graph.FillColour = bar.FillColour = colours.BlueLighter;
|
||||
|
||||
// see comment in ArgonHealthDisplay.cs regarding RelativeSizeAxes
|
||||
float previousWidth = Width;
|
||||
UseRelativeSize.BindValueChanged(v => RelativeSizeAxes = v.NewValue ? Axes.X : Axes.None, true);
|
||||
Width = previousWidth;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
Reference in New Issue
Block a user