mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
show mod settings in ModIcon tooltip
This commit is contained in:
@ -30,6 +30,11 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
Value = 5,
|
Value = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public override string IconTooltip => ($"{Name} ({(CircleSize.IsDefault ? "" : $"CS {CircleSize.Value.ToString()}, ")}" +
|
||||||
|
$"{(DrainRate.IsDefault ? "" : $"HP {DrainRate.Value.ToString()}, ")}" +
|
||||||
|
$"{(OverallDifficulty.IsDefault ? "" : $"OD {OverallDifficulty.Value.ToString()}, ")}" +
|
||||||
|
$"{(ApproachRate.IsDefault ? "" : $"AR {ApproachRate.Value.ToString()}")}").TrimEnd(new char[] { ',', ' ' }) + ")";
|
||||||
|
|
||||||
protected override void TransferSettings(BeatmapDifficulty difficulty)
|
protected override void TransferSettings(BeatmapDifficulty difficulty)
|
||||||
{
|
{
|
||||||
base.TransferSettings(difficulty);
|
base.TransferSettings(difficulty);
|
||||||
|
@ -30,6 +30,11 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
Value = 5,
|
Value = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public override string IconTooltip => ($"{Name} ({(CircleSize.IsDefault ? "" : $"CS {CircleSize.Value.ToString()}, ")}" +
|
||||||
|
$"{(DrainRate.IsDefault ? "" : $"HP {DrainRate.Value.ToString()}, ")}" +
|
||||||
|
$"{(OverallDifficulty.IsDefault ? "" : $"OD {OverallDifficulty.Value.ToString()}, ")}" +
|
||||||
|
$"{(ApproachRate.IsDefault ? "" : $"AR {ApproachRate.Value.ToString()}")}").TrimEnd(new char[] { ',', ' ' }) + ")";
|
||||||
|
|
||||||
protected override void TransferSettings(BeatmapDifficulty difficulty)
|
protected override void TransferSettings(BeatmapDifficulty difficulty)
|
||||||
{
|
{
|
||||||
base.TransferSettings(difficulty);
|
base.TransferSettings(difficulty);
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.IO.Serialization;
|
using osu.Game.IO.Serialization;
|
||||||
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
@ -42,6 +43,16 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual string Description => string.Empty;
|
public virtual string Description => string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The tooltip to display for this mod when used in a <see cref="ModIcon"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Differs from <see cref="Name"/>, as the value of attributes (AR, CS, etc) changeable via the mod
|
||||||
|
/// are displayed in the tooltip.
|
||||||
|
/// </remarks>
|
||||||
|
[JsonIgnore]
|
||||||
|
public virtual string IconTooltip => Name;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The score multiplier of this mod.
|
/// The score multiplier of this mod.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -52,6 +52,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
Value = 5,
|
Value = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public override string IconTooltip => $"{Name} ({(DrainRate.IsDefault ? $"HP {DrainRate.Value.ToString()}, " : "")}" +
|
||||||
|
$"{(OverallDifficulty.IsDefault ? $"OD {OverallDifficulty.Value.ToString()}, " : "")})";
|
||||||
|
|
||||||
private BeatmapDifficulty difficulty;
|
private BeatmapDifficulty difficulty;
|
||||||
|
|
||||||
public void ReadFromDifficulty(BeatmapDifficulty difficulty)
|
public void ReadFromDifficulty(BeatmapDifficulty difficulty)
|
||||||
|
@ -30,5 +30,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
Value = 1.5,
|
Value = 1.5,
|
||||||
Precision = 0.01,
|
Precision = 0.01,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public override string IconTooltip => $"{Name}{(SpeedChange.IsDefault ? "" : $" ({SpeedChange.Value}x)")}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,8 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
MaxValue = 10
|
MaxValue = 10
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public override string IconTooltip => $"{Name}{(Retries.IsDefault ? "" : $" ({Retries.Value} lives)")}";
|
||||||
|
|
||||||
private int retries;
|
private int retries;
|
||||||
|
|
||||||
private BindableNumber<double> health;
|
private BindableNumber<double> health;
|
||||||
|
@ -30,5 +30,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
Value = 0.75,
|
Value = 0.75,
|
||||||
Precision = 0.01,
|
Precision = 0.01,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public override string IconTooltip => $"{Name}{(SpeedChange.IsDefault ? "" : $" ({SpeedChange.Value}x)")}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
[SettingSource("Final rate", "The final speed to ramp to")]
|
[SettingSource("Final rate", "The final speed to ramp to")]
|
||||||
public abstract BindableNumber<double> FinalRate { get; }
|
public abstract BindableNumber<double> FinalRate { get; }
|
||||||
|
|
||||||
|
public override string IconTooltip => $"{Name} ({InitialRate.Value}x to {FinalRate.Value}x)";
|
||||||
|
|
||||||
private double finalRateTime;
|
private double finalRateTime;
|
||||||
private double beginRampTime;
|
private double beginRampTime;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
type = mod.Type;
|
type = mod.Type;
|
||||||
|
|
||||||
TooltipText = mod.Name;
|
TooltipText = mod.IconTooltip;
|
||||||
|
|
||||||
Size = new Vector2(size);
|
Size = new Vector2(size);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user