Make updatemappings parameter renamer work, add importmappings parameter renamer, more refactoring
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user