Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ public static class SkinnableComponentStrings
public static LocalisableString CollapseDuringGameplayDescription =>
new TranslatableString(getKey(@"if_enabled_the_leaderboard_will"), @"If enabled, the leaderboard will become more compact during active gameplay.");

/// <summary>
/// "Wireframe opacity"
/// </summary>
public static LocalisableString WireframeOpacity => new TranslatableString(getKey(@"wireframe_opacity"), @"Wireframe opacity");

/// <summary>
/// "Controls the opacity of the wireframes behind the digits."
/// </summary>
public static LocalisableString WireframeOpacityDescription => new TranslatableString(getKey(@"wireframe_opacity_description"), @"Controls the opacity of the wireframes behind the digits.");

/// <summary>
/// "Inverted shear"
/// </summary>
public static LocalisableString InvertedShear => new TranslatableString(getKey(@"inverted_shear"), @"Inverted shear");

/// <summary>
/// "Bar height"
/// </summary>
public static LocalisableString BarHeight => new TranslatableString(getKey(@"bar_height"), @"Bar height");

private static string getKey(string key) => $@"{prefix}:{key}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace osu.Game.Localisation.SkinComponents
{
public static class SkinnableModDisplayStrings
{
private const string prefix = @"osu.Game.Resources.Localisation.SkinnableModDisplay";
private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.SkinnableModDisplay";

/// <summary>
/// "Show extended information"
Expand Down
15 changes: 15 additions & 0 deletions osu.Game/Localisation/SkinEditorStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ public static class SkinEditorStrings
/// </summary>
public static LocalisableString Gameplay => new TranslatableString(getKey(@"gameplay"), @"Gameplay");

/// <summary>
/// "HUD"
/// </summary>
public static LocalisableString MainHUDComponents => new TranslatableString(getKey(@"main_hud_components"), @"HUD");

/// <summary>
/// "Playfield"
/// </summary>
public static LocalisableString Playfield => new TranslatableString(getKey(@"playfield"), @"Playfield");

/// <summary>
/// "{0} ("{1}" only)"
/// </summary>
public static LocalisableString WorkingLayerOfRuleset(LocalisableString layerName, string rulesetName) => new TranslatableString(getKey(@"working_layer_of_ruleset"), @"{0} (""{1}"" only)", layerName, rulesetName);

/// <summary>
/// "Settings ({0})"
/// </summary>
Expand Down
29 changes: 28 additions & 1 deletion osu.Game/Overlays/SkinEditor/SkinEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
Expand Down Expand Up @@ -404,7 +405,7 @@ private void targetChanged(ValueChangedEvent<GlobalSkinnableContainerLookup?> ta
{
Children = new Drawable[]
{
new SettingsDropdown<GlobalSkinnableContainerLookup?>
new GlobalSkinnableContainerLookupDropdown
{
Items = availableTargets.Select(t => t.Lookup).Distinct(),
Current = selectedTarget,
Expand Down Expand Up @@ -785,6 +786,32 @@ public RevertConfirmDialog(Action revert)
}
}

public partial class GlobalSkinnableContainerLookupDropdown : SettingsDropdown<GlobalSkinnableContainerLookup?>
{
protected override OsuDropdown<GlobalSkinnableContainerLookup?> CreateDropdown() => new DropdownControl();

protected new partial class DropdownControl : OsuDropdown<GlobalSkinnableContainerLookup?>
{
public DropdownControl()
{
RelativeSizeAxes = Axes.X;
}

protected override DropdownMenu CreateMenu() => base.CreateMenu().With(m => m.MaxHeight = 200);

protected override LocalisableString GenerateItemText(GlobalSkinnableContainerLookup? item)
{
if (item == null)
return base.GenerateItemText(item);

if (item.Ruleset == null)
return item.Lookup.GetLocalisableDescription();

return SkinEditorStrings.WorkingLayerOfRuleset(item.Lookup.GetLocalisableDescription(), item.Ruleset.Name);
}
}
}

#region Delegation of IEditorChangeHandler

public event Action? OnStateChange;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class ArgonAccuracyCounter : GameplayAccuracyCounter, ISerialisab
{
protected override double RollingDuration => 250;

[SettingSource("Wireframe opacity", "Controls the opacity of the wireframes behind the digits.")]
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.WireframeOpacity), nameof(SkinnableComponentStrings.WireframeOpacityDescription))]
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.25f)
{
Precision = 0.01f,
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/HUD/ArgonComboCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class ArgonComboCounter : ComboCounter

protected virtual bool DisplayXSymbol => true;

[SettingSource("Wireframe opacity", "Controls the opacity of the wireframes behind the digits.")]
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.WireframeOpacity), nameof(SkinnableComponentStrings.WireframeOpacityDescription))]
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.25f)
{
Precision = 0.01f,
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial class ArgonHealthDisplay : HealthDisplay, ISerialisableDrawable
{
public bool UsesFixedAnchor { get; set; }

[SettingSource("Bar height")]
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.BarHeight))]
public BindableFloat BarHeight { get; } = new BindableFloat(20)
{
MinValue = 0,
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/HUD/ArgonPerformancePointsCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class ArgonPerformancePointsCounter : PerformancePointsCounter, I

private const float alpha_when_invalid = 0.3f;

[SettingSource("Wireframe opacity", "Controls the opacity of the wireframes behind the digits.")]
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.WireframeOpacity), nameof(SkinnableComponentStrings.WireframeOpacityDescription))]
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.25f)
{
Precision = 0.01f,
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class ArgonScoreCounter : GameplayScoreCounter, ISerialisableDraw

protected override double RollingDuration => 250;

[SettingSource("Wireframe opacity", "Controls the opacity of the wireframes behind the digits.")]
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.WireframeOpacity), nameof(SkinnableComponentStrings.WireframeOpacityDescription))]
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.25f)
{
Precision = 0.01f,
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/HUD/ArgonUnstableRateCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class ArgonUnstableRateCounter : UnstableRateCounter, ISerialisab

private const float alpha_when_invalid = 0.3f;

[SettingSource("Wireframe opacity", "Controls the opacity of the wireframes behind the digits.")]
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.WireframeOpacity), nameof(SkinnableComponentStrings.WireframeOpacityDescription))]
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.25f)
{
Precision = 0.01f,
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/HUD/ArgonWedgePiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class ArgonWedgePiece : CompositeDrawable, ISerialisableDrawable
{
public bool UsesFixedAnchor { get; set; }

[SettingSource("Inverted shear")]
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.InvertedShear))]
public BindableBool InvertShear { get; } = new BindableBool();

[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Colour))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class ArgonJudgementCounterDisplay : CompositeDrawable, ISerialis
[Resolved]
private JudgementCountController judgementCountController { get; set; } = null!;

[SettingSource("Wireframe opacity", "Controls the opacity of the wireframes behind the digits.")]
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.WireframeOpacity), nameof(SkinnableComponentStrings.WireframeOpacityDescription))]
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.25f)
{
Precision = 0.01f,
Expand Down
8 changes: 0 additions & 8 deletions osu.Game/Skinning/GlobalSkinnableContainerLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using osu.Framework.Extensions;
using osu.Game.Rulesets;

namespace osu.Game.Skinning
Expand All @@ -29,13 +28,6 @@ public GlobalSkinnableContainerLookup(GlobalSkinnableContainers lookup, RulesetI
Ruleset = ruleset;
}

public override string ToString()
{
if (Ruleset == null) return Lookup.GetDescription();

return $"{Lookup.GetDescription()} (\"{Ruleset.Name}\" only)";
}

public bool Equals(GlobalSkinnableContainerLookup? other)
{
if (ReferenceEquals(null, other)) return false;
Expand Down
9 changes: 5 additions & 4 deletions osu.Game/Skinning/GlobalSkinnableContainers.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// 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.ComponentModel;
using osu.Framework.Localisation;
using osu.Game.Localisation;

namespace osu.Game.Skinning
{
Expand All @@ -10,13 +11,13 @@ namespace osu.Game.Skinning
/// </summary>
public enum GlobalSkinnableContainers
{
[Description("HUD")]
[LocalisableDescription(typeof(SkinEditorStrings), nameof(SkinEditorStrings.MainHUDComponents))]
MainHUDComponents,

[Description("Song select")]
[LocalisableDescription(typeof(SkinEditorStrings), nameof(SkinEditorStrings.SongSelect))]
SongSelect,

[Description("Playfield")]
[LocalisableDescription(typeof(SkinEditorStrings), nameof(SkinEditorStrings.Playfield))]
Playfield
}
}
Loading