use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.
the class InventoryManager method load.
public void load() throws IOException {
InventoryLoader loader = new InventoryLoader();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.CONFIGS);
Archive archive = index.getArchive(ConfigType.INV.getId());
byte[] archiveData = storage.loadArchive(archive);
ArchiveFiles files = archive.getFiles(archiveData);
for (FSFile file : files.getFiles()) {
InventoryDefinition inv = loader.load(file.getFileId(), file.getContents());
inventories.add(inv);
}
}
use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.
the class InterfaceManager method load.
public void load() throws IOException {
InterfaceLoader loader = new InterfaceLoader();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.INTERFACES);
int max = index.getArchives().stream().mapToInt(a -> a.getArchiveId()).max().getAsInt();
interfaces = new InterfaceDefinition[max + 1][];
for (Archive archive : index.getArchives()) {
int archiveId = archive.getArchiveId();
byte[] archiveData = storage.loadArchive(archive);
ArchiveFiles files = archive.getFiles(archiveData);
InterfaceDefinition[] ifaces = interfaces[archiveId];
if (ifaces == null) {
ifaces = interfaces[archiveId] = new InterfaceDefinition[archive.getFileData().length];
}
for (FSFile file : files.getFiles()) {
int fileId = file.getFileId();
int widgetId = (archiveId << 16) + fileId;
InterfaceDefinition iface = loader.load(widgetId, file.getContents());
ifaces[fileId] = iface;
}
}
}
use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.
the class NpcManager method load.
public void load() throws IOException {
NpcLoader loader = new NpcLoader();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.CONFIGS);
Archive archive = index.getArchive(ConfigType.NPC.getId());
byte[] archiveData = storage.loadArchive(archive);
ArchiveFiles files = archive.getFiles(archiveData);
for (FSFile f : files.getFiles()) {
NpcDefinition npc = loader.load(f.getFileId(), f.getContents());
npcs.add(npc);
}
}
use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.
the class ObjectManager method load.
public void load() throws IOException {
ObjectLoader loader = new ObjectLoader();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.CONFIGS);
Archive archive = index.getArchive(ConfigType.OBJECT.getId());
byte[] archiveData = storage.loadArchive(archive);
ArchiveFiles files = archive.getFiles(archiveData);
for (FSFile f : files.getFiles()) {
ObjectDefinition def = loader.load(f.getFileId(), f.getContents());
objects.put(f.getFileId(), def);
}
}
use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.
the class TextureManager method load.
public void load() throws IOException {
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.TEXTURES);
Archive archive = index.getArchive(0);
byte[] archiveData = storage.loadArchive(archive);
ArchiveFiles files = archive.getFiles(archiveData);
TextureLoader loader = new TextureLoader();
for (FSFile file : files.getFiles()) {
TextureDefinition texture = loader.load(file.getFileId(), file.getContents());
textures.add(texture);
}
}
Aggregations