Files
runelite/runescape-client/src/main/java/WorldMapArchiveLoader.java
Lucwousin e7a1983158 rev185
2019-10-31 16:57:45 +01:00

110 lines
2.3 KiB
Java

import net.runelite.mapping.Export;
import net.runelite.mapping.Implements;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
@ObfuscatedName("lp")
@Implements("WorldMapArchiveLoader")
public class WorldMapArchiveLoader {
@ObfuscatedName("v")
@Export("cacheName")
String cacheName;
@ObfuscatedName("l")
@ObfuscatedSignature(
signature = "Lhq;"
)
@Export("archive")
AbstractArchive archive;
@ObfuscatedName("c")
@ObfuscatedGetter(
intValue = -1799315399
)
@Export("percentLoaded")
int percentLoaded;
@ObfuscatedName("o")
@Export("loaded")
boolean loaded;
@ObfuscatedSignature(
signature = "(Lhq;)V"
)
WorldMapArchiveLoader(AbstractArchive var1) {
this.percentLoaded = 0;
this.loaded = false;
this.archive = var1;
}
@ObfuscatedName("a")
@ObfuscatedSignature(
signature = "(Ljava/lang/String;I)V",
garbageValue = "926060886"
)
@Export("reset")
void reset(String var1) {
if (var1 != null && !var1.isEmpty()) {
if (var1 != this.cacheName) {
this.cacheName = var1;
this.percentLoaded = 0;
this.loaded = false;
this.load();
}
}
}
@ObfuscatedName("t")
@ObfuscatedSignature(
signature = "(I)I",
garbageValue = "-910181849"
)
@Export("load")
int load() {
if (this.percentLoaded < 33) {
if (!this.archive.tryLoadFileByNames(WorldMapCacheName.field289.name, this.cacheName)) {
return this.percentLoaded;
}
this.percentLoaded = 33;
}
if (this.percentLoaded == 33) {
if (this.archive.isValidFileName(WorldMapCacheName.field290.name, this.cacheName) && !this.archive.tryLoadFileByNames(WorldMapCacheName.field290.name, this.cacheName)) {
return this.percentLoaded;
}
this.percentLoaded = 66;
}
if (this.percentLoaded == 66) {
if (!this.archive.tryLoadFileByNames(this.cacheName, WorldMapCacheName.field292.name)) {
return this.percentLoaded;
}
this.percentLoaded = 100;
this.loaded = true;
}
return this.percentLoaded;
}
@ObfuscatedName("n")
@ObfuscatedSignature(
signature = "(B)Z",
garbageValue = "71"
)
@Export("isLoaded")
boolean isLoaded() {
return this.loaded;
}
@ObfuscatedName("q")
@ObfuscatedSignature(
signature = "(B)I",
garbageValue = "25"
)
@Export("getPercentLoaded")
int getPercentLoaded() {
return this.percentLoaded;
}
}