Files
runelite/runescape-client/src/main/java/WorldMapArchiveLoader.java
Lucwousin db705f5dd5 rs-client: refactoring (#1344)
* Rename some things to be more consistent everywhere

* rs-client: refactoring

* MenuAction -> MenuOpcode merge
2019-08-20 22:24:51 +02: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("lh")
@Implements("WorldMapArchiveLoader")
public class WorldMapArchiveLoader {
@ObfuscatedName("k")
@Export("cacheName")
String cacheName;
@ObfuscatedName("l")
@ObfuscatedSignature(
signature = "Lhp;"
)
@Export("archive")
AbstractArchive archive;
@ObfuscatedName("b")
@ObfuscatedGetter(
intValue = 431285519
)
@Export("percentLoaded")
int percentLoaded;
@ObfuscatedName("i")
@Export("loaded")
boolean loaded;
@ObfuscatedSignature(
signature = "(Lhp;)V"
)
WorldMapArchiveLoader(AbstractArchive var1) {
this.percentLoaded = 0;
this.loaded = false;
this.archive = var1;
}
@ObfuscatedName("q")
@ObfuscatedSignature(
signature = "(Ljava/lang/String;B)V",
garbageValue = "124"
)
@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("w")
@ObfuscatedSignature(
signature = "(I)I",
garbageValue = "52307485"
)
@Export("load")
int load() {
if (this.percentLoaded < 33) {
if (!this.archive.tryLoadFileByNames(WorldMapCacheName.COMPOSITEMAP.name, this.cacheName)) {
return this.percentLoaded;
}
this.percentLoaded = 33;
}
if (this.percentLoaded == 33) {
if (this.archive.isValidFileName(WorldMapCacheName.COMPOSITETEXTURE.name, this.cacheName) && !this.archive.tryLoadFileByNames(WorldMapCacheName.COMPOSITETEXTURE.name, this.cacheName)) {
return this.percentLoaded;
}
this.percentLoaded = 66;
}
if (this.percentLoaded == 66) {
if (!this.archive.tryLoadFileByNames(this.cacheName, WorldMapCacheName.LABELS.name)) {
return this.percentLoaded;
}
this.percentLoaded = 100;
this.loaded = true;
}
return this.percentLoaded;
}
@ObfuscatedName("e")
@ObfuscatedSignature(
signature = "(I)Z",
garbageValue = "1906092832"
)
@Export("isLoaded")
boolean isLoaded() {
return this.loaded;
}
@ObfuscatedName("p")
@ObfuscatedSignature(
signature = "(I)I",
garbageValue = "-805069530"
)
@Export("getPercentLoaded")
int getPercentLoaded() {
return this.percentLoaded;
}
}