public static BitmapSource Load(string databaseRootPath, string hyphenKey, double dpi = 96, TankIconType type = TankIconType.Normal) { if (hyphenKey == VirtualTankIconKey) { hyphenKey = "ussr-Observer"; } var path = TankIcon.GetEntryKey(hyphenKey, type); if (PackageStream.IsFileExisted(Path.Combine(databaseRootPath, PackageImage.GuiPackage), path)) { return(PackageImage.Load(databaseRootPath, PackageImage.GuiPackage, path)); } return(PackageImage.Load(databaseRootPath, PackageImage.GuiPackage, TankIcon.GetEntryKey("noImage", type))); }
public static BitmapSource Load(string databaseRootPath, ShellType shellType, double dpi = 96) { string key; switch (shellType) { case ShellType.Ap: key = "ARMOR_PIERCING"; break; case ShellType.Apcr: key = "ARMOR_PIERCING_CR"; break; case ShellType.Aphe: key = "ARMOR_PIERCING_HE"; break; case ShellType.He: key = "HIGH_EXPLOSIVE"; break; case ShellType.PremiumHe: key = "HIGH_EXPLOSIVE_PREMIUM"; break; case ShellType.Heat: key = "HOLLOW_CHARGE"; break; default: return(null); } var entryKey = Path.Combine(IconRelativePath, key + ".png").Replace('\\', '/'); return(PackageImage.Load(databaseRootPath, PackageImage.GuiPackage, entryKey)); }