mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Remove null checks on CreateInstance()
calls
This commit is contained in:
@ -117,7 +117,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
Spacing = new Vector2(1, 0);
|
Spacing = new Vector2(1, 0);
|
||||||
Direction = FillDirection.Horizontal;
|
Direction = FillDirection.Horizontal;
|
||||||
|
|
||||||
var icon = rulesets.GetRuleset(rulesetId)?.CreateInstance()?.CreateIcon() ?? new SpriteIcon { Icon = FontAwesome.Regular.QuestionCircle };
|
var icon = rulesets.GetRuleset(rulesetId)?.CreateInstance().CreateIcon() ?? new SpriteIcon { Icon = FontAwesome.Regular.QuestionCircle };
|
||||||
Add(icon.With(i =>
|
Add(icon.With(i =>
|
||||||
{
|
{
|
||||||
i.Size = new Vector2(14);
|
i.Size = new Vector2(14);
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
{
|
{
|
||||||
public class RulesetBindingsSection : SettingsSection
|
public class RulesetBindingsSection : SettingsSection
|
||||||
{
|
{
|
||||||
public override Drawable CreateIcon() => ruleset?.CreateInstance()?.CreateIcon() ?? new SpriteIcon
|
public override Drawable CreateIcon() => ruleset?.CreateInstance().CreateIcon() ?? new SpriteIcon
|
||||||
{
|
{
|
||||||
Icon = OsuIcon.Hot
|
Icon = OsuIcon.Hot
|
||||||
};
|
};
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
new DesignSection(),
|
new DesignSection(),
|
||||||
};
|
};
|
||||||
|
|
||||||
var rulesetSpecificSection = beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateEditorSetupSection();
|
var rulesetSpecificSection = beatmap.BeatmapInfo.Ruleset?.CreateInstance().CreateEditorSetupSection();
|
||||||
if (rulesetSpecificSection != null)
|
if (rulesetSpecificSection != null)
|
||||||
sectionsEnumerable.Add(rulesetSpecificSection);
|
sectionsEnumerable.Add(rulesetSpecificSection);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Screens.Edit.Verify
|
|||||||
private void load(OverlayColourProvider colours)
|
private void load(OverlayColourProvider colours)
|
||||||
{
|
{
|
||||||
generalVerifier = new BeatmapVerifier();
|
generalVerifier = new BeatmapVerifier();
|
||||||
rulesetVerifier = beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier();
|
rulesetVerifier = beatmap.BeatmapInfo.Ruleset?.CreateInstance().CreateBeatmapVerifier();
|
||||||
|
|
||||||
context = new BeatmapVerifierContext(beatmap, workingBeatmap.Value, verify.InterpretedDifficulty.Value);
|
context = new BeatmapVerifierContext(beatmap, workingBeatmap.Value, verify.InterpretedDifficulty.Value);
|
||||||
verify.InterpretedDifficulty.BindValueChanged(difficulty => context.InterpretedDifficulty = difficulty.NewValue);
|
verify.InterpretedDifficulty.BindValueChanged(difficulty => context.InterpretedDifficulty = difficulty.NewValue);
|
||||||
|
@ -282,9 +282,6 @@ namespace osu.Game.Stores
|
|||||||
{
|
{
|
||||||
var rulesetInstance = ((IRulesetInfo)beatmap.Ruleset).CreateInstance();
|
var rulesetInstance = ((IRulesetInfo)beatmap.Ruleset).CreateInstance();
|
||||||
|
|
||||||
if (rulesetInstance == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
decoded.BeatmapInfo.Ruleset = rulesetInstance.RulesetInfo;
|
decoded.BeatmapInfo.Ruleset = rulesetInstance.RulesetInfo;
|
||||||
|
|
||||||
// TODO: this should be done in a better place once we actually need to dynamically update it.
|
// TODO: this should be done in a better place once we actually need to dynamically update it.
|
||||||
|
Reference in New Issue
Block a user