Fix CA1854
This commit is contained in:
@@ -56,22 +56,21 @@ namespace OpenRA.Mods.Common.LoadScreens
|
||||
sheet = null;
|
||||
}
|
||||
|
||||
if (sheet == null && Info.ContainsKey("Image"))
|
||||
if (sheet == null && Info.TryGetValue("Image", out var image))
|
||||
{
|
||||
var key = "Image";
|
||||
density = 1;
|
||||
if (dpiScale > 2 && Info.ContainsKey("Image3x"))
|
||||
if (dpiScale > 2 && Info.TryGetValue("Image3x", out var image3))
|
||||
{
|
||||
key = "Image3x";
|
||||
image = image3;
|
||||
density = 3;
|
||||
}
|
||||
else if (dpiScale > 1 && Info.ContainsKey("Image2x"))
|
||||
else if (dpiScale > 1 && Info.TryGetValue("Image2x", out var image2))
|
||||
{
|
||||
key = "Image2x";
|
||||
image = image2;
|
||||
density = 2;
|
||||
}
|
||||
|
||||
using (var stream = ModData.DefaultFileSystem.Open(Platform.ResolvePath(Info[key])))
|
||||
using (var stream = ModData.DefaultFileSystem.Open(Platform.ResolvePath(image)))
|
||||
{
|
||||
sheet = new Sheet(SheetType.BGRA, stream);
|
||||
sheet.GetTexture().ScaleFilter = TextureScaleFilter.Linear;
|
||||
|
||||
Reference in New Issue
Block a user