Ejemplo n.º 1
0
        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)));
        }
Ejemplo n.º 2
0
 private static string GetEntryKey(string hyphenKey, TankIconType type)
 {
     return(Path.Combine(IconRelativePath, TankIcon.GetVehicleIconSubpath(type), hyphenKey + ".png").Replace('\\', '/'));
 }
Ejemplo n.º 3
0
        public static bool Exists(string databaseRootPath, string hyphenKey, TankIconType type = TankIconType.Normal)
        {
            if (hyphenKey == VirtualTankIconKey)
            {
                return(true);
            }

            return(PackageStream.IsFileExisted(Path.Combine(databaseRootPath, PackageImage.GuiPackage), TankIcon.GetEntryKey(hyphenKey, type)));
        }