Make updatemappings parameter renamer work, add importmappings parameter renamer, more refactoring

This commit is contained in:
Lucas
2019-07-07 12:15:54 +02:00
parent c92553f86f
commit e1a815eddd
98 changed files with 41069 additions and 32880 deletions

View File

@@ -27,6 +27,33 @@ public class InjectUtil
public static Method findMethod(Inject inject, String name) throws InjectionException
{
return findMethod(inject, name, null);
}
public static Method findMethod(Inject inject, String name, String hint) throws InjectionException
{
if (hint != null)
{
ClassFile c = inject.getDeobfuscated().findClass(hint);
if (c == null)
{
throw new InjectionException("Class " + hint + " doesn't exist. (check capitalization)");
}
Method deob = c.findMethod(name);
if (deob != null)
{
String obfuscatedName = DeobAnnotations.getObfuscatedName(deob.getAnnotations());
Signature obfuscatedSignature = DeobAnnotations.getObfuscatedSignature(deob);
ClassFile ob = inject.toObClass(c);
return ob.findMethod(obfuscatedName, (obfuscatedSignature != null) ? obfuscatedSignature : deob.getDescriptor());
}
}
for (ClassFile c : inject.getDeobfuscated().getClasses())
{
for (Method m : c.getMethods())

View File

@@ -76,8 +76,8 @@ public class DrawAfterWidgets
@Export("drawLoggedIn")
final void drawLoggedIn() {
if(rootWidgetGroup != -1) {
ClientPreferences.method1809(rootWidgetGroup);
if(rootInterface != -1) {
ClientPreferences.method1809(rootInterface);
}
int var1;
@@ -94,9 +94,9 @@ public class DrawAfterWidgets
__client_lq = -1;
__client_ln = -1;
UserComparator6.__fg_jh = null;
if(rootWidgetGroup != -1) {
if(rootInterface != -1) {
rootWidgetCount = 0;
Interpreter.method1977(rootWidgetGroup, 0, 0, SoundCache.canvasWidth, Huffman.canvasHeight, 0, 0, -1);
Interpreter.method1977(rootInterface, 0, 0, SoundCache.canvasWidth, Huffman.canvasHeight, 0, 0, -1);
}
< -- here appearantly

View File

@@ -21,7 +21,7 @@ public class RenderDraw
private static final Logger log = LoggerFactory.getLogger(RenderDraw.class);
private static final net.runelite.asm.pool.Method renderDraw = new net.runelite.asm.pool.Method(
new Class("net.runelite.client.callback.Hooks"),
"renderDraw",
"draw",
new Signature("(Lnet/runelite/api/Renderable;IIIIIIIIJ)V")
);
private final Inject inject;
@@ -36,7 +36,7 @@ public class RenderDraw
Stopwatch stopwatch = Stopwatch.createStarted();
net.runelite.asm.Method obmethod = findMethod(inject, "drawTile");
Method renderDraw = findMethod(inject, "renderDraw").getPoolMethod();
Method renderDraw = findMethod(inject, "draw", "Entity").getPoolMethod();
Instructions ins = obmethod.getCode().getInstructions();
replace(ins, renderDraw);
@@ -69,7 +69,7 @@ public class RenderDraw
}
else if (count != 21)
{
log.warn("Found {} renderDraws while 21 were expected. Rev update?", count);
log.warn("Found {} draws while 21 were expected. Rev update?", count);
}
else
{