mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Extract method to avoid nested ternaries
This commit is contained in:
@ -150,7 +150,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
|
|||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = BeatmapSet.Value.OnlineInfo.HasVideo ? (noVideo ? "without Video" : "with Video") : string.Empty,
|
Text = getVideoSuffixText(),
|
||||||
Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold)
|
Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -163,5 +163,13 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
|
|||||||
private void userChanged(ValueChangedEvent<User> e) => button.Enabled.Value = !(e.NewValue is GuestUser);
|
private void userChanged(ValueChangedEvent<User> e) => button.Enabled.Value = !(e.NewValue is GuestUser);
|
||||||
|
|
||||||
private void enabledChanged(ValueChangedEvent<bool> e) => this.FadeColour(e.NewValue ? Color4.White : Color4.Gray, 200, Easing.OutQuint);
|
private void enabledChanged(ValueChangedEvent<bool> e) => this.FadeColour(e.NewValue ? Color4.White : Color4.Gray, 200, Easing.OutQuint);
|
||||||
|
|
||||||
|
private string getVideoSuffixText()
|
||||||
|
{
|
||||||
|
if (!BeatmapSet.Value.OnlineInfo.HasVideo)
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
return noVideo ? "without Video" : "with Video";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user