mirror of
https://github.com/ppy/osu
synced 2025-03-31 23:58:37 +00: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:
commit
1f67b222dc
@ -61,10 +61,17 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
FullName = "Belarus"
|
FullName = "Belarus"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var unknownCountry = new Country
|
||||||
|
{
|
||||||
|
FlagName = "CK",
|
||||||
|
FullName = "Cook Islands"
|
||||||
|
};
|
||||||
|
|
||||||
AddStep("Set country", () => countryBindable.Value = country);
|
AddStep("Set country", () => countryBindable.Value = country);
|
||||||
AddAssert("Check scope is Performance", () => scope.Value == RankingsScope.Performance);
|
AddAssert("Check scope is Performance", () => scope.Value == RankingsScope.Performance);
|
||||||
AddStep("Set scope to Score", () => scope.Value = RankingsScope.Score);
|
AddStep("Set scope to Score", () => scope.Value = RankingsScope.Score);
|
||||||
AddAssert("Check country is Null", () => countryBindable.Value == null);
|
AddAssert("Check country is Null", () => countryBindable.Value == null);
|
||||||
|
AddStep("Set country with no flag", () => countryBindable.Value = unknownCountry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Users.Drawables
|
|||||||
if (ts == null)
|
if (ts == null)
|
||||||
throw new ArgumentNullException(nameof(ts));
|
throw new ArgumentNullException(nameof(ts));
|
||||||
|
|
||||||
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}");
|
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}") ?? ts.Get(@"Flags/__");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user