mirror of
https://github.com/ppy/osu
synced 2025-03-06 03:19:47 +00:00
Simplify TooltipText for EditorRadioButton
This commit is contained in:
parent
8d6358a138
commit
5d497ba4a8
@ -68,7 +68,13 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
}
|
||||
}
|
||||
};
|
||||
selectionCentreButton.TooltipTextWhenDisabled = "We can't rotate a circle around itself! Can we?";
|
||||
selectionCentreButton.Selected.DisabledChanged += (isDisabled) =>
|
||||
{
|
||||
if (isDisabled)
|
||||
selectionCentreButton.TooltipText = "We can't rotate a circle around itself! Can we?";
|
||||
else
|
||||
selectionCentreButton.TooltipText = string.Empty;
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
@ -214,7 +214,13 @@ namespace osu.Game.Rulesets.Edit
|
||||
|
||||
foreach (var item in toolboxCollection.Items)
|
||||
{
|
||||
item.TooltipTextWhenDisabled = "Add at least one timing point first!";
|
||||
item.Selected.DisabledChanged += (isDisabled) =>
|
||||
{
|
||||
if (isDisabled)
|
||||
item.TooltipText = "Add at least one timing point first!";
|
||||
else
|
||||
item.TooltipText = string.Empty;
|
||||
};
|
||||
}
|
||||
|
||||
TernaryStates = CreateTernaryButtons().ToArray();
|
||||
|
@ -94,6 +94,6 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
||||
X = 40f
|
||||
};
|
||||
|
||||
public LocalisableString TooltipText => Enabled.Value ? Button.TooltipTextWhenEnabled : Button.TooltipTextWhenDisabled;
|
||||
public LocalisableString TooltipText => Button.TooltipText;
|
||||
}
|
||||
}
|
||||
|
@ -16,16 +16,6 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
||||
/// </summary>
|
||||
public readonly BindableBool Selected;
|
||||
|
||||
/// <summary>
|
||||
/// Tooltip text that will be shown on hover if button is enabled.
|
||||
/// </summary>
|
||||
public LocalisableString TooltipTextWhenEnabled { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Tooltip text that will be shown on hover if button is disabled.
|
||||
/// </summary>
|
||||
public LocalisableString TooltipTextWhenDisabled { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The item related to this button.
|
||||
/// </summary>
|
||||
@ -62,5 +52,8 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
||||
/// Deselects this <see cref="RadioButton"/>.
|
||||
/// </summary>
|
||||
public void Deselect() => Selected.Value = false;
|
||||
|
||||
// Tooltip text that will be shown when hovered over
|
||||
public LocalisableString TooltipText { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user