public override Task Load() { return(Task.Run(() => { if (SkillsCount > 0) { return; } string path = Path.Combine(FileManager.UoFolderPath, "skills.mul"); string pathidx = Path.Combine(FileManager.UoFolderPath, "Skills.idx"); FileSystemHelper.EnsureFileExists(path); FileSystemHelper.EnsureFileExists(pathidx); _file = new UOFileMul(path, pathidx, 0, 16); _file.FillEntries(ref Entries); for (int i = 0; i < Entries.Length; i++) { GetSkill(i); } SkillNames = _skills.Select(o => o.Value.Name).ToArray(); })); }
public override Task Load() { return(Task.Run(() => { string path = Path.Combine(FileManager.UoFolderPath, "light.mul"); string pathidx = Path.Combine(FileManager.UoFolderPath, "lightidx.mul"); FileSystemHelper.EnsureFileExists(path); FileSystemHelper.EnsureFileExists(pathidx); _file = new UOFileMul(path, pathidx, Constants.MAX_LIGHTS_DATA_INDEX_COUNT); _file.FillEntries(ref Entries); })); }
public override Task Load() { return(Task.Run ( () => { if (SkillsCount > 0) { return; } string path = UOFileManager.GetUOFilePath("skills.mul"); string pathidx = UOFileManager.GetUOFilePath("Skills.idx"); FileSystemHelper.EnsureFileExists(path); FileSystemHelper.EnsureFileExists(pathidx); _file = new UOFileMul(path, pathidx, 0, 16); _file.FillEntries(ref Entries); for (int i = 0, count = 0; i < Entries.Length; i++) { ref UOFileIndex entry = ref GetValidRefEntry(i); if (entry.Length > 0) { _file.SetData(entry.Address, entry.FileSize); _file.Seek(entry.Offset); bool hasAction = _file.ReadBool(); string name = Encoding.UTF8.GetString(_file.ReadArray <byte>(entry.Length - 1)).TrimEnd('\0'); /* * if(skillUseless.Contains(name)) // giga487, UoMars * { * continue; // se carico le skill che ho messo dentro il vettore string skillUseless vado avanti. * } */ SkillEntry skill = new SkillEntry(count++, name, hasAction); Skills.Add(skill); } } SortedSkills.AddRange(Skills); SortedSkills.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.InvariantCulture)); }
public override Task Load() { return(Task.Run ( () => { string path = UOFileManager.GetUOFilePath("light.mul"); string pathidx = UOFileManager.GetUOFilePath("lightidx.mul"); FileSystemHelper.EnsureFileExists(path); FileSystemHelper.EnsureFileExists(pathidx); _file = new UOFileMul(path, pathidx, Constants.MAX_LIGHTS_DATA_INDEX_COUNT); _file.FillEntries(ref Entries); _spriteInfos = new SpriteInfo[Entries.Length]; } )); }
public override Task Load() { return(Task.Run ( () => { if (SkillsCount > 0) { return; } string path = UOFileManager.GetUOFilePath("skills.mul"); string pathidx = UOFileManager.GetUOFilePath("Skills.idx"); FileSystemHelper.EnsureFileExists(path); FileSystemHelper.EnsureFileExists(pathidx); _file = new UOFileMul(path, pathidx, 0, 16); _file.FillEntries(ref Entries); for (int i = 0, count = 0; i < Entries.Length; i++) { ref UOFileIndex entry = ref GetValidRefEntry(i); if (entry.Length > 0) { _file.Seek(entry.Offset); bool hasAction = _file.ReadBool(); string name = Encoding.UTF8.GetString (_file.ReadArray <byte>(entry.Length - 1)) .TrimEnd('\0'); SkillEntry skill = new SkillEntry(count++, name, hasAction); Skills.Add(skill); } } SortedSkills.AddRange(Skills); SortedSkills.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.InvariantCulture)); }
public override Task Load() { return(Task.Run(() => { if (SkillsCount > 0) { return; } string path = UOFileManager.GetUOFilePath("skills.mul"); string pathidx = UOFileManager.GetUOFilePath("Skills.idx"); FileSystemHelper.EnsureFileExists(path); FileSystemHelper.EnsureFileExists(pathidx); _file = new UOFileMul(path, pathidx, 0, 16); _file.FillEntries(ref Entries); for (int i = 0, count = 0; i < Entries.Length; i++) { ref readonly var entry = ref GetValidRefEntry(i);