1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00

Merge pull request #6116 from EVAST9919/allow-flag-placeholder

Fix DrawableFlag not showing fallback texture if no flag is available
This commit is contained in:
Dean Herbert 2019-09-15 13:03:41 +09:00 committed by GitHub
commit 1f67b222dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -61,10 +61,17 @@ namespace osu.Game.Tests.Visual.Online
FullName = "Belarus"
};
var unknownCountry = new Country
{
FlagName = "CK",
FullName = "Cook Islands"
};
AddStep("Set country", () => countryBindable.Value = country);
AddAssert("Check scope is Performance", () => scope.Value == RankingsScope.Performance);
AddStep("Set scope to Score", () => scope.Value = RankingsScope.Score);
AddAssert("Check country is Null", () => countryBindable.Value == null);
AddStep("Set country with no flag", () => countryBindable.Value = unknownCountry);
}
}
}

View File

@ -26,7 +26,7 @@ namespace osu.Game.Users.Drawables
if (ts == null)
throw new ArgumentNullException(nameof(ts));
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}");
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}") ?? ts.Get(@"Flags/__");
}
}
}