mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 05:22:54 +08:00
Re-enable possible null refernece exception inspections and move code
This commit is contained in:
parent
b723975767
commit
3a3ec1436b
@ -38,14 +38,6 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
};
|
};
|
||||||
|
|
||||||
Build.ValueChanged += showBuild;
|
Build.ValueChanged += showBuild;
|
||||||
|
|
||||||
// ReSharper disable once PossibleNullReferenceException
|
|
||||||
// see https://youtrack.jetbrains.com/issue/RSRP-486768
|
|
||||||
Streams.Current.ValueChanged += e =>
|
|
||||||
{
|
|
||||||
if (e.NewValue?.LatestBuild != null && !e.NewValue.Equals(Build.Value?.UpdateStream))
|
|
||||||
Build.Value = e.NewValue.LatestBuild;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -75,29 +67,40 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
|
|
||||||
protected override Drawable CreateBackground() => new OverlayHeaderBackground(@"Headers/changelog");
|
protected override Drawable CreateBackground() => new OverlayHeaderBackground(@"Headers/changelog");
|
||||||
|
|
||||||
protected override Drawable CreateContent() => new Container
|
protected override Drawable CreateContent()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
var content = new Container
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
streamsBackground = new Box
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both
|
streamsBackground = new Box
|
||||||
},
|
|
||||||
new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Padding = new MarginPadding
|
|
||||||
{
|
{
|
||||||
Horizontal = 65,
|
RelativeSizeAxes = Axes.Both
|
||||||
Vertical = 20
|
|
||||||
},
|
},
|
||||||
Child = Streams = new ChangelogUpdateStreamControl()
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Padding = new MarginPadding
|
||||||
|
{
|
||||||
|
Horizontal = 65,
|
||||||
|
Vertical = 20
|
||||||
|
},
|
||||||
|
Child = Streams = new ChangelogUpdateStreamControl()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
|
Streams.Current.ValueChanged += e =>
|
||||||
|
{
|
||||||
|
if (e.NewValue?.LatestBuild != null && !e.NewValue.Equals(Build.Value?.UpdateStream))
|
||||||
|
Build.Value = e.NewValue.LatestBuild;
|
||||||
|
};
|
||||||
|
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
protected override OverlayTitle CreateTitle() => new ChangelogHeaderTitle();
|
protected override OverlayTitle CreateTitle() => new ChangelogHeaderTitle();
|
||||||
|
|
||||||
|
@ -175,6 +175,8 @@ namespace osu.Game.Overlays.Comments
|
|||||||
|
|
||||||
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
|
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
|
||||||
|
|
||||||
|
private readonly string text;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; }
|
private OverlayColourProvider colourProvider { get; set; }
|
||||||
|
|
||||||
@ -184,12 +186,10 @@ namespace osu.Game.Overlays.Comments
|
|||||||
|
|
||||||
public CommitButton(string text)
|
public CommitButton(string text)
|
||||||
{
|
{
|
||||||
|
this.text = text;
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
LoadingAnimationSize = new Vector2(10);
|
LoadingAnimationSize = new Vector2(10);
|
||||||
|
|
||||||
// ReSharper disable once PossibleNullReferenceException
|
|
||||||
// see https://youtrack.jetbrains.com/issue/RSRP-486768
|
|
||||||
drawableText.Text = text;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -198,6 +198,8 @@ namespace osu.Game.Overlays.Comments
|
|||||||
IdleColour = colourProvider.Light4;
|
IdleColour = colourProvider.Light4;
|
||||||
HoverColour = colourProvider.Light3;
|
HoverColour = colourProvider.Light3;
|
||||||
blockedBackground.Colour = colourProvider.Background5;
|
blockedBackground.Colour = colourProvider.Background5;
|
||||||
|
|
||||||
|
drawableText.Text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -234,7 +236,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
||||||
Margin = new MarginPadding { Horizontal = 20 }
|
Margin = new MarginPadding { Horizontal = 20 },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user