public static string GetHeadIconPath(this CfgCard card) { string AnimationID = card.Anim_id.ToString(); string RessourceHeadIconFolder = "/images/ui/headIcon/"; try { string Id = AnimationID.Substring(0, 4); string elite = AnimationID.Substring(4, AnimationID.Length - 4); try { int tID = Convert.ToInt32(Id); if (tID > 2099 && tID < 3000) { elite = "6"; } } catch { } string fileName = Id + "_" + elite; string name = "h_" + fileName + ".jpg"; string name2 = "h_" + fileName + ".png"; string usedPath = MapPaths.GetPath("/images") + "ui/headIcon/"; if (File.Exists(usedPath + name)) { return(RessourceHeadIconFolder + name); } if (File.Exists(usedPath + name2)) { return(RessourceHeadIconFolder + name2); } return(RessourceHeadIconFolder + "h_dummy_hero_icon.jpg"); } catch (Exception ex) { return(RessourceHeadIconFolder + "h_dummy_hero_icon.jpg"); } }
public static string GetName(this CfgCard c) { return(Translate("TextCard_" + c.Root_card_id + "_name", c.Name)); }