public static void LoadAvatars() { for (int i = 0; i < _Avatars.Count; i++) { STexture texture = _Avatars[i].Texture; CDraw.RemoveTexture(ref texture); } _Avatars.Clear(); List <string> files = new List <string>(); files.AddRange(Helper.ListFiles(CSettings.sFolderProfiles, "*.png", true, true)); files.AddRange(Helper.ListFiles(CSettings.sFolderProfiles, "*.jpg", true, true)); files.AddRange(Helper.ListFiles(CSettings.sFolderProfiles, "*.jpeg", true, true)); files.AddRange(Helper.ListFiles(CSettings.sFolderProfiles, "*.bmp", true, true)); foreach (string file in files) { STexture tex = CDraw.AddTexture(file); if (tex.index != -1) { SAvatar avatar = new SAvatar(); avatar.Texture = tex; avatar.FileName = Path.GetFileName(file); _Avatars.Add(avatar); } } }
public static void LoadAvatars() { for (int i = 0; i < _Avatars.Count; i++) { STexture texture = _Avatars[i].Texture; CDraw.RemoveTexture(ref texture); } _Avatars.Clear(); List<string> files = new List<string>(); files.AddRange(Helper.ListFiles(CSettings.sFolderProfiles, "*.png", true, true)); files.AddRange(Helper.ListFiles(CSettings.sFolderProfiles, "*.jpg", true, true)); files.AddRange(Helper.ListFiles(CSettings.sFolderProfiles, "*.jpeg", true, true)); files.AddRange(Helper.ListFiles(CSettings.sFolderProfiles, "*.bmp", true, true)); foreach (string file in files) { STexture tex = CDraw.AddTexture(file); if (tex.index != -1) { SAvatar avatar = new SAvatar(); avatar.Texture = tex; avatar.FileName = Path.GetFileName(file); _Avatars.Add(avatar); } } }