示例#1
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)));
        }
示例#2
0
        private static string GetVehicleIconSubpath(TankIconType type)
        {
            switch (type)
            {
            case TankIconType.Contour:
                return(ContourPath);

            case TankIconType.Small:
                return(SmallPath);

            case TankIconType.Normal:
                return(NormalPath);

            default:
                return("");
            }
        }
示例#3
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)));
        }
示例#4
0
 private static string GetEntryKey(string hyphenKey, TankIconType type)
 {
     return(Path.Combine(IconRelativePath, TankIcon.GetVehicleIconSubpath(type), hyphenKey + ".png").Replace('\\', '/'));
 }