feat: biem boem bam
This commit is contained in:
@@ -18,9 +18,11 @@ import com.openosrs.injector.injectors.RSApiInjector;
|
||||
import com.openosrs.injector.injectors.raw.AddPlayerToMenu;
|
||||
import com.openosrs.injector.injectors.raw.ClearColorBuffer;
|
||||
import com.openosrs.injector.injectors.raw.DrawMenu;
|
||||
import com.openosrs.injector.injectors.raw.GraphicsObject;
|
||||
import com.openosrs.injector.injectors.raw.Occluder;
|
||||
import com.openosrs.injector.injectors.raw.RasterizerAlpha;
|
||||
import com.openosrs.injector.injectors.raw.RenderDraw;
|
||||
import com.openosrs.injector.injectors.raw.RuneliteObject;
|
||||
import com.openosrs.injector.injectors.raw.ScriptVM;
|
||||
import com.openosrs.injector.rsapi.RSApi;
|
||||
import com.openosrs.injector.transformers.InjectTransformer;
|
||||
@@ -109,6 +111,8 @@ public class Injector extends InjectData implements InjectTaskHandler
|
||||
|
||||
inject(new CreateAnnotations(this));
|
||||
|
||||
inject(new RuneliteObject(this));
|
||||
|
||||
inject(new InterfaceInjector(this));
|
||||
|
||||
inject(new RasterizerAlpha(this));
|
||||
@@ -138,6 +142,8 @@ public class Injector extends InjectData implements InjectTaskHandler
|
||||
|
||||
inject(new AddPlayerToMenu(this));
|
||||
|
||||
inject(new GraphicsObject(this));
|
||||
|
||||
validate(new InjectorValidator(this));
|
||||
|
||||
transform(new SourceChanger(this));
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
package com.openosrs.injector.injection;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.openosrs.injector.InjectUtil;
|
||||
import com.openosrs.injector.injectors.Injector;
|
||||
import com.openosrs.injector.rsapi.RSApi;
|
||||
@@ -45,7 +44,7 @@ public abstract class InjectData
|
||||
/**
|
||||
* Deobfuscated ClassFiles -> Vanilla ClassFiles
|
||||
*/
|
||||
public Map<ClassFile, ClassFile> toVanilla;
|
||||
public final Map<ClassFile, ClassFile> toVanilla = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Strings -> Deobfuscated ClassFiles
|
||||
@@ -53,14 +52,12 @@ public abstract class InjectData
|
||||
* - Obfuscated name
|
||||
* - RSApi implementing name
|
||||
*/
|
||||
private final Map<String, ClassFile> toDeob = new HashMap<>();
|
||||
public final Map<String, ClassFile> toDeob = new HashMap<>();
|
||||
|
||||
public abstract void runChildInjector(Injector injector);
|
||||
|
||||
public void initToVanilla()
|
||||
{
|
||||
ImmutableMap.Builder<ClassFile, ClassFile> toVanillaB = ImmutableMap.builder();
|
||||
|
||||
for (final ClassFile deobClass : deobfuscated)
|
||||
{
|
||||
if (deobClass.getName().startsWith("net/runelite/") || deobClass.getName().startsWith("netscape"))
|
||||
@@ -73,13 +70,14 @@ public abstract class InjectData
|
||||
{
|
||||
toDeob.put(obName, deobClass);
|
||||
|
||||
// Can't be null
|
||||
final ClassFile obClass = this.vanilla.findClass(obName);
|
||||
toVanillaB.put(deobClass, obClass);
|
||||
|
||||
if (obClass != null)
|
||||
{
|
||||
toVanilla.put(deobClass, obClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.toVanilla = toVanillaB.build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Owain van Brakel <https://github.com/Owain94>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is licensed under GPL3, see the complete license in
|
||||
* the LICENSE file in the root directory of this submodule.
|
||||
*/
|
||||
package com.openosrs.injector.injectors.raw;
|
||||
|
||||
import com.openosrs.injector.injection.InjectData;
|
||||
import com.openosrs.injector.injectors.AbstractInjector;
|
||||
import net.runelite.asm.ClassFile;
|
||||
import net.runelite.asm.Method;
|
||||
import net.runelite.asm.attributes.Code;
|
||||
import net.runelite.asm.attributes.code.Instructions;
|
||||
import net.runelite.asm.attributes.code.instructions.ALoad;
|
||||
import net.runelite.asm.attributes.code.instructions.InvokeSpecial;
|
||||
import net.runelite.asm.attributes.code.instructions.VReturn;
|
||||
import net.runelite.asm.signature.Signature;
|
||||
|
||||
public class GraphicsObject extends AbstractInjector
|
||||
{
|
||||
public GraphicsObject(InjectData inject)
|
||||
{
|
||||
super(inject);
|
||||
}
|
||||
|
||||
public void inject()
|
||||
{
|
||||
final ClassFile graphicsObjectVanilla = inject.toVanilla(
|
||||
inject.getDeobfuscated()
|
||||
.findClass("GraphicsObject")
|
||||
);
|
||||
|
||||
final ClassFile renderableVanilla = inject.toVanilla(
|
||||
inject.getDeobfuscated()
|
||||
.findClass("Renderable")
|
||||
);
|
||||
|
||||
graphicsObjectVanilla.clearFinal();
|
||||
|
||||
Method initGraphicsObject = new Method(graphicsObjectVanilla, "<init>", new Signature("()V"));
|
||||
initGraphicsObject.setPublic();
|
||||
|
||||
final Code code = new Code(initGraphicsObject);
|
||||
code.setMaxStack(1);
|
||||
initGraphicsObject.setCode(code);
|
||||
graphicsObjectVanilla.addMethod(initGraphicsObject);
|
||||
|
||||
Instructions ins = code.getInstructions();
|
||||
|
||||
ins.addInstruction(new ALoad(ins, 0));
|
||||
ins.addInstruction(new InvokeSpecial(ins, new net.runelite.asm.pool.Method(renderableVanilla.getPoolClass(), "<init>", new Signature("()V"))));
|
||||
ins.addInstruction(new VReturn(ins));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Owain van Brakel <https://github.com/Owain94>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is licensed under GPL3, see the complete license in
|
||||
* the LICENSE file in the root directory of this submodule.
|
||||
*/
|
||||
package com.openosrs.injector.injectors.raw;
|
||||
|
||||
import com.openosrs.injector.injection.InjectData;
|
||||
import com.openosrs.injector.injectors.AbstractInjector;
|
||||
import java.util.List;
|
||||
import net.runelite.asm.ClassFile;
|
||||
import net.runelite.asm.Method;
|
||||
import net.runelite.asm.attributes.Code;
|
||||
import net.runelite.asm.attributes.code.Instruction;
|
||||
import net.runelite.asm.attributes.code.InstructionType;
|
||||
import net.runelite.asm.attributes.code.Instructions;
|
||||
import net.runelite.asm.attributes.code.instructions.ALoad;
|
||||
import net.runelite.asm.attributes.code.instructions.Dup;
|
||||
import net.runelite.asm.attributes.code.instructions.InvokeSpecial;
|
||||
import net.runelite.asm.attributes.code.instructions.New;
|
||||
import net.runelite.asm.attributes.code.instructions.Return;
|
||||
import net.runelite.asm.attributes.code.instructions.VReturn;
|
||||
import net.runelite.asm.signature.Signature;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
public class RuneliteObject extends AbstractInjector
|
||||
{
|
||||
private static final String RUNELITE_OBJECT = "RuneLiteObject";
|
||||
|
||||
public RuneliteObject(InjectData inject)
|
||||
{
|
||||
super(inject);
|
||||
}
|
||||
|
||||
public void inject()
|
||||
{
|
||||
ClassFile runeliteObjectVanilla = inject.vanilla.findClass(RUNELITE_OBJECT);
|
||||
|
||||
final ClassFile graphicsObjectVanilla = inject.toVanilla(
|
||||
inject.getDeobfuscated()
|
||||
.findClass("GraphicsObject")
|
||||
);
|
||||
|
||||
graphicsObjectVanilla.clearFinal();
|
||||
|
||||
final ClassFile clientVanilla = inject.toVanilla(
|
||||
inject.getDeobfuscated()
|
||||
.findClass("Client")
|
||||
);
|
||||
|
||||
final ClassFile runeLiteObjectDeob = inject.getDeobfuscated()
|
||||
.findClass(RUNELITE_OBJECT);
|
||||
|
||||
if (runeliteObjectVanilla == null)
|
||||
{
|
||||
runeliteObjectVanilla = new ClassFile(inject.vanilla);
|
||||
runeliteObjectVanilla.setName(RUNELITE_OBJECT);
|
||||
runeliteObjectVanilla.setParentClass(graphicsObjectVanilla.getPoolClass());
|
||||
runeliteObjectVanilla.setAccess(Opcodes.ACC_PUBLIC);
|
||||
runeliteObjectVanilla.setVersion(Opcodes.V1_8);
|
||||
inject.vanilla.addClass(runeliteObjectVanilla);
|
||||
|
||||
inject.toVanilla.put(runeLiteObjectDeob, runeliteObjectVanilla);
|
||||
}
|
||||
|
||||
{
|
||||
Method initRuneliteObject = new Method(runeliteObjectVanilla, "<init>", new Signature("()V"));
|
||||
initRuneliteObject.setPublic();
|
||||
|
||||
final Code code = new Code(initRuneliteObject);
|
||||
code.setMaxStack(1);
|
||||
initRuneliteObject.setCode(code);
|
||||
runeliteObjectVanilla.addMethod(initRuneliteObject);
|
||||
|
||||
final Instructions instructions = code.getInstructions();
|
||||
final List<Instruction> ins = instructions.getInstructions();
|
||||
|
||||
ins.add(new ALoad(instructions, 0));
|
||||
ins.add(new InvokeSpecial(instructions, new net.runelite.asm.pool.Method(graphicsObjectVanilla.getPoolClass(), "<init>", new Signature("()V"))));
|
||||
ins.add(new VReturn(instructions));
|
||||
}
|
||||
|
||||
{
|
||||
Method copy = new Method(clientVanilla, "createRuneLiteObject", new Signature("()Lnet/runelite/api/RuneLiteObject;"));
|
||||
copy.setPublic();
|
||||
|
||||
final Code code = new Code(copy);
|
||||
code.setMaxStack(2);
|
||||
copy.setCode(code);
|
||||
clientVanilla.addMethod(copy);
|
||||
|
||||
final Instructions instructions = code.getInstructions();
|
||||
final List<Instruction> ins = instructions.getInstructions();
|
||||
|
||||
ins.add(new New(instructions, runeliteObjectVanilla.getPoolClass()));
|
||||
ins.add(new Dup(instructions));
|
||||
ins.add(new InvokeSpecial(instructions, new net.runelite.asm.pool.Method(runeliteObjectVanilla.getPoolClass(), "<init>", new Signature("()V"))));
|
||||
ins.add(new Return(instructions, InstructionType.ARETURN));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,9 +53,18 @@ import net.runelite.api.IntegerNode;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.MenuAction;
|
||||
import static net.runelite.api.MenuAction.*;
|
||||
import static net.runelite.api.MenuAction.PLAYER_EIGTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_FIFTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_FIRST_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_FOURTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_SECOND_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_SEVENTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_SIXTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_THIRD_OPTION;
|
||||
import static net.runelite.api.MenuAction.UNKNOWN;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.Model;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NameableContainer;
|
||||
@@ -68,6 +77,7 @@ import net.runelite.api.Point;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.Projectile;
|
||||
import net.runelite.api.ScriptEvent;
|
||||
import net.runelite.api.Sequence;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.StructComposition;
|
||||
@@ -124,8 +134,8 @@ import net.runelite.api.widgets.WidgetConfig;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.rs.api.RSArchive;
|
||||
import net.runelite.rs.api.RSAbstractArchive;
|
||||
import net.runelite.rs.api.RSArchive;
|
||||
import net.runelite.rs.api.RSChatChannel;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSEnumComposition;
|
||||
@@ -133,6 +143,7 @@ import net.runelite.rs.api.RSFriendSystem;
|
||||
import net.runelite.rs.api.RSIndexedSprite;
|
||||
import net.runelite.rs.api.RSInterfaceParent;
|
||||
import net.runelite.rs.api.RSItemContainer;
|
||||
import net.runelite.rs.api.RSModelData;
|
||||
import net.runelite.rs.api.RSNPC;
|
||||
import net.runelite.rs.api.RSNode;
|
||||
import net.runelite.rs.api.RSNodeDeque;
|
||||
@@ -2311,5 +2322,33 @@ public abstract class RSClientMixin implements RSClient
|
||||
scene.setTileShapes(Arrays.copyOf(tileShapes, tileShapes.length));
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
public Model loadModel(int id)
|
||||
{
|
||||
return loadModel(id, null, null);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public Model loadModel(int id, short[] colorToFind, short[] colorToReplace)
|
||||
{
|
||||
RSModelData modeldata = client.getModelData(client.getObjectDefinition_modelsArchive(), id, 0);
|
||||
|
||||
if (colorToFind != null)
|
||||
{
|
||||
for (int i = 0; i < colorToFind.length; ++i)
|
||||
{
|
||||
modeldata.recolor(colorToFind[i], colorToReplace[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return modeldata.toModel(modeldata.getAmbient() + 64, modeldata.getContrast() + 850, -30, -50, -30);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public Sequence loadAnimation(int id)
|
||||
{
|
||||
return client.getSequenceDefinition(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.RuneLiteObject;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.GraphicsObjectCreated;
|
||||
import net.runelite.api.mixins.Copy;
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Replace;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSGraphicsObject;
|
||||
import net.runelite.rs.api.RSModel;
|
||||
import net.runelite.rs.api.RSRuneLiteObject;
|
||||
|
||||
@Mixin(RSGraphicsObject.class)
|
||||
public abstract class RSGraphicsObjectMixin implements RSGraphicsObject
|
||||
@@ -27,4 +32,34 @@ public abstract class RSGraphicsObjectMixin implements RSGraphicsObject
|
||||
{
|
||||
return new LocalPoint(this.getX(), this.getY());
|
||||
}
|
||||
|
||||
|
||||
@Copy("advance")
|
||||
@Replace("advance")
|
||||
public void copy$advance(int var1)
|
||||
{
|
||||
if (this instanceof RuneLiteObject)
|
||||
{
|
||||
((RSRuneLiteObject) this).advanceRL(var1);
|
||||
}
|
||||
else
|
||||
{
|
||||
copy$advance(var1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Copy("getModel")
|
||||
@Replace("getModel")
|
||||
public RSModel copy$getModel()
|
||||
{
|
||||
if (this instanceof RuneLiteObject)
|
||||
{
|
||||
return ((RSRuneLiteObject) this).getModelRl();
|
||||
}
|
||||
else
|
||||
{
|
||||
return copy$getModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.IterableHashTable;
|
||||
import net.runelite.api.Node;
|
||||
import net.runelite.api.NodeCache;
|
||||
import net.runelite.api.mixins.*;
|
||||
import net.runelite.rs.api.RSBuffer;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
@@ -16,6 +17,16 @@ public abstract class RSObjectCompositionMixin implements RSObjectComposition
|
||||
@Inject
|
||||
private int accessBitMask = 0;
|
||||
|
||||
@MethodHook(value = "<init>", end = true)
|
||||
@Inject
|
||||
public void rl$init()
|
||||
{
|
||||
NodeCache cachedModels2 = client.getCachedModels2();
|
||||
cachedModels2.setCapacity(256);
|
||||
cachedModels2.setRemainingCapacity(256);
|
||||
cachedModels2.reset();
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getAccessBitMask()
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright (c) 2018, OpenOSRS
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.Model;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Sequence;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSModel;
|
||||
import net.runelite.rs.api.RSRuneLiteObject;
|
||||
import net.runelite.rs.api.RSSequenceDefinition;
|
||||
|
||||
@Mixin(RSRuneLiteObject.class)
|
||||
public abstract class RuneLiteObjectMixin implements RSRuneLiteObject
|
||||
{
|
||||
@Shadow("client")
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
private static boolean loop;
|
||||
|
||||
@Inject
|
||||
private static RSModel model;
|
||||
|
||||
@Inject
|
||||
RuneLiteObjectMixin()
|
||||
{
|
||||
setFinished(true);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setModel(Model var1)
|
||||
{
|
||||
model = (RSModel) var1;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setLocation(LocalPoint localPoint, int plane)
|
||||
{
|
||||
setX(localPoint.getX());
|
||||
setY(localPoint.getY());
|
||||
setLevel(plane);
|
||||
setHeight(Perspective.getTileHeight(client, localPoint, plane));
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void advanceRL(int var1)
|
||||
{
|
||||
if (getSequenceDefinition() != null)
|
||||
{
|
||||
if (!finished())
|
||||
{
|
||||
setFrameCycle(getFrameCycle() + var1);
|
||||
|
||||
while (getFrameCycle() > getSequenceDefinition().getFrameLengths()[getFrame()])
|
||||
{
|
||||
setFrameCycle(getFrameCycle() - getSequenceDefinition().getFrameLengths()[getFrame()]);
|
||||
setFrame(getFrame() + 1);
|
||||
if (getFrame() >= getSequenceDefinition().getFrameIDs().length)
|
||||
{
|
||||
setFinished(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (loop && finished())
|
||||
{
|
||||
setFinished(false);
|
||||
setFrame(0);
|
||||
setFrameCycle(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
public boolean isActive()
|
||||
{
|
||||
return !finished();
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setActive(boolean active)
|
||||
{
|
||||
if (finished() == active)
|
||||
{
|
||||
setFinished(!active);
|
||||
|
||||
if (active)
|
||||
{
|
||||
setFrame(0);
|
||||
setFrameCycle(0);
|
||||
client.getGraphicsObjectDeque().addFirst(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setShouldLoop(boolean var1)
|
||||
{
|
||||
loop = var1;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setAnimation(Sequence var1)
|
||||
{
|
||||
setFrame(0);
|
||||
setFrameCycle(0);
|
||||
setSequenceDefinition((RSSequenceDefinition) var1);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public RSModel getModelRl()
|
||||
{
|
||||
RSModel model = RuneLiteObjectMixin.model;
|
||||
if (getSequenceDefinition() != null)
|
||||
{
|
||||
model = getSequenceDefinition().transformSpotAnimationModel(model, getFrame());
|
||||
}
|
||||
else
|
||||
{
|
||||
model = model.toSharedModel(true);
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@@ -1451,4 +1451,10 @@ public interface RSClient extends RSGameEngine, Client
|
||||
|
||||
@Import("Tiles_shapes")
|
||||
byte[][][] getTileShapes();
|
||||
|
||||
@Import("SpotAnimationDefinition_get")
|
||||
RSSpotAnimationDefinition getSpotAnimationDefinition(int id);
|
||||
|
||||
@Import("ModelData_get")
|
||||
RSModelData getModelData(RSAbstractArchive var0, int var1, int var2);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ public interface RSGraphicsObject extends GraphicsObject, RSRenderable
|
||||
@Override
|
||||
int getId();
|
||||
|
||||
@Import("id")
|
||||
void setId(int id);
|
||||
|
||||
@Import("x")
|
||||
int getX();
|
||||
|
||||
@@ -30,4 +33,37 @@ public interface RSGraphicsObject extends GraphicsObject, RSRenderable
|
||||
@Import("isFinished")
|
||||
@Override
|
||||
boolean finished();
|
||||
|
||||
@Import("frame")
|
||||
int getFrame();
|
||||
|
||||
@Import("frame")
|
||||
void setFrame(int frame);
|
||||
|
||||
@Import("frameCycle")
|
||||
int getFrameCycle();
|
||||
|
||||
@Import("frameCycle")
|
||||
void setFrameCycle(int frameCycle);
|
||||
|
||||
@Import("isFinished")
|
||||
void setFinished(boolean finished);
|
||||
|
||||
@Import("plane")
|
||||
void setLevel(int level);
|
||||
|
||||
@Import("x")
|
||||
void setX(int x);
|
||||
|
||||
@Import("y")
|
||||
void setY(int y);
|
||||
|
||||
@Import("height")
|
||||
void setHeight(int height);
|
||||
|
||||
@Import("sequenceDefinition")
|
||||
RSSequenceDefinition getSequenceDefinition();
|
||||
|
||||
@Import("sequenceDefinition")
|
||||
void setSequenceDefinition(RSSequenceDefinition sequenceDefinition);
|
||||
}
|
||||
|
||||
@@ -51,4 +51,16 @@ public interface RSModelData extends RSRenderable
|
||||
|
||||
@Import("vertexVertices")
|
||||
RSVertexNormal[] getVertexVertices();
|
||||
|
||||
@Import("recolor")
|
||||
void recolor(short var1, short var2);
|
||||
|
||||
@Import("toModel")
|
||||
RSModel toModel(int var1, int var2, int var3, int var4, int var5);
|
||||
|
||||
@Import("ambient")
|
||||
short getAmbient();
|
||||
|
||||
@Import("contrast")
|
||||
short getContrast();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package net.runelite.rs.api;
|
||||
|
||||
import net.runelite.api.RuneLiteObject;
|
||||
|
||||
public interface RSRuneLiteObject extends RuneLiteObject, RSGraphicsObject
|
||||
{
|
||||
void advanceRL(int var1);
|
||||
|
||||
RSModel getModelRl();
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package net.runelite.rs.api;
|
||||
|
||||
import net.runelite.api.Sequence;
|
||||
import net.runelite.api.SequenceDefinition;
|
||||
import net.runelite.mapping.Import;
|
||||
|
||||
public interface RSSequenceDefinition extends RSNode, SequenceDefinition
|
||||
public interface RSSequenceDefinition extends RSNode, SequenceDefinition, Sequence
|
||||
{
|
||||
// @Import("stretches")
|
||||
// boolean getStretches();
|
||||
@@ -35,4 +36,7 @@ public interface RSSequenceDefinition extends RSNode, SequenceDefinition
|
||||
@Import("chatFrameIds")
|
||||
@Override
|
||||
int[] getChatFrameIds();
|
||||
|
||||
@Import("transformSpotAnimationModel")
|
||||
RSModel transformSpotAnimationModel(RSModel var1, int var2);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
package net.runelite.rs.api;
|
||||
|
||||
public interface RSSpotAnimationDefinition {}
|
||||
import net.runelite.mapping.Import;
|
||||
|
||||
public interface RSSpotAnimationDefinition
|
||||
{
|
||||
@Import("getModel")
|
||||
RSModel getModel(int var1);
|
||||
|
||||
@Import("recolorFrom")
|
||||
void setRecolorFrom(short[] from);
|
||||
|
||||
@Import("recolorTo")
|
||||
void setRecolorTo(short[] to);
|
||||
|
||||
@Import("sequence")
|
||||
int getSequence();
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class BuddyRankComparator extends AbstractUserComparator {
|
||||
}
|
||||
|
||||
if (var3 == 6) {
|
||||
float var5 = ((float)VarbitComposition.clientPreferences.field1193 - 0.5F) * 200.0F;
|
||||
float var5 = ((float)VarbitComposition.clientPreferences.brightness - 0.5F) * 200.0F;
|
||||
var4 = 100 - Math.round(var5);
|
||||
} else if (var3 == 7) {
|
||||
var4 = Math.round((float)VarbitComposition.clientPreferences.musicVolume / 2.55F);
|
||||
|
||||
@@ -43,7 +43,8 @@ public class ClientPreferences {
|
||||
@Export("hideUsername")
|
||||
boolean hideUsername;
|
||||
@ObfuscatedName("a")
|
||||
double field1193;
|
||||
@Export("brightness")
|
||||
double brightness;
|
||||
@ObfuscatedName("u")
|
||||
@ObfuscatedGetter(
|
||||
intValue = -970652687
|
||||
@@ -79,7 +80,7 @@ public class ClientPreferences {
|
||||
this.windowMode = 1;
|
||||
this.rememberedUsername = null;
|
||||
this.hideUsername = false;
|
||||
this.field1193 = 0.8D;
|
||||
this.brightness = 0.8D;
|
||||
this.musicVolume = 127;
|
||||
this.soundEffectsVolume = 127;
|
||||
this.areaSoundEffectsVolume = 127;
|
||||
@@ -95,7 +96,7 @@ public class ClientPreferences {
|
||||
this.windowMode = 1;
|
||||
this.rememberedUsername = null;
|
||||
this.hideUsername = false;
|
||||
this.field1193 = 0.8D;
|
||||
this.brightness = 0.8D;
|
||||
this.musicVolume = 127;
|
||||
this.soundEffectsVolume = 127;
|
||||
this.areaSoundEffectsVolume = 127;
|
||||
@@ -135,7 +136,7 @@ public class ClientPreferences {
|
||||
}
|
||||
|
||||
if (var2 > 6) {
|
||||
this.field1193 = (double)var1.readUnsignedByte() / 100.0D;
|
||||
this.brightness = (double)var1.readUnsignedByte() / 100.0D;
|
||||
this.musicVolume = var1.readUnsignedByte();
|
||||
this.soundEffectsVolume = var1.readUnsignedByte();
|
||||
this.areaSoundEffectsVolume = var1.readUnsignedByte();
|
||||
@@ -184,7 +185,7 @@ public class ClientPreferences {
|
||||
|
||||
var1.writeStringCp1252NullTerminated(this.rememberedUsername != null ? this.rememberedUsername : "");
|
||||
var1.writeBoolean(this.hideUsername);
|
||||
var1.writeByte((int)(100.0D * this.field1193));
|
||||
var1.writeByte((int)(100.0D * this.brightness));
|
||||
var1.writeByte(this.musicVolume);
|
||||
var1.writeByte(this.soundEffectsVolume);
|
||||
var1.writeByte(this.areaSoundEffectsVolume);
|
||||
|
||||
@@ -525,9 +525,9 @@ public class Fonts {
|
||||
Login.Login_loadingText = "Loading textures - " + "0%";
|
||||
Login.Login_loadingPercent = 90;
|
||||
} else {
|
||||
MusicPatch.textureProvider = new TextureProvider(VarcInt.archive9, World.archive8, 20, VarbitComposition.clientPreferences.field1193, Client.isLowDetail ? 64 : 128);
|
||||
MusicPatch.textureProvider = new TextureProvider(VarcInt.archive9, World.archive8, 20, VarbitComposition.clientPreferences.brightness, Client.isLowDetail ? 64 : 128);
|
||||
Rasterizer3D.Rasterizer3D_setTextureLoader(MusicPatch.textureProvider);
|
||||
Rasterizer3D.Rasterizer3D_setBrightness(VarbitComposition.clientPreferences.field1193);
|
||||
Rasterizer3D.Rasterizer3D_setBrightness(VarbitComposition.clientPreferences.brightness);
|
||||
Client.titleLoadingStage = 100;
|
||||
}
|
||||
} else if (Client.titleLoadingStage == 100) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.runelite.mapping.ObfuscatedSignature;
|
||||
|
||||
@ObfuscatedName("bu")
|
||||
@Implements("GraphicsObject")
|
||||
public final class GraphicsObject extends Renderable {
|
||||
public class GraphicsObject extends Renderable {
|
||||
@ObfuscatedName("hu")
|
||||
@ObfuscatedSignature(
|
||||
descriptor = "[Loc;"
|
||||
@@ -91,13 +91,18 @@ public final class GraphicsObject extends Renderable {
|
||||
|
||||
}
|
||||
|
||||
public GraphicsObject()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ObfuscatedName("n")
|
||||
@ObfuscatedSignature(
|
||||
descriptor = "(II)V",
|
||||
garbageValue = "1654884246"
|
||||
)
|
||||
@Export("advance")
|
||||
final void advance(int var1) {
|
||||
void advance(int var1) {
|
||||
if (!this.isFinished) {
|
||||
this.frameCycle += var1;
|
||||
|
||||
@@ -119,7 +124,7 @@ public final class GraphicsObject extends Renderable {
|
||||
garbageValue = "18"
|
||||
)
|
||||
@Export("getModel")
|
||||
protected final Model getModel() {
|
||||
protected Model getModel() {
|
||||
SpotAnimationDefinition var1 = TaskHandler.SpotAnimationDefinition_get(this.id);
|
||||
Model var2;
|
||||
if (!this.isFinished) {
|
||||
|
||||
68
runescape-client/src/main/java/RuneLiteObject.java
Normal file
68
runescape-client/src/main/java/RuneLiteObject.java
Normal file
@@ -0,0 +1,68 @@
|
||||
public class RuneLiteObject extends GraphicsObject
|
||||
{
|
||||
public Model model;
|
||||
public boolean loop;
|
||||
|
||||
public RuneLiteObject() {
|
||||
super.isFinished = true;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return !super.isFinished;
|
||||
}
|
||||
|
||||
public void setActive(boolean active)
|
||||
{
|
||||
if (super.isFinished == active)
|
||||
{
|
||||
super.isFinished = !active;
|
||||
|
||||
if (active)
|
||||
{
|
||||
super.frame = 0;
|
||||
super.frameCycle = 0;
|
||||
Client.graphicsObjects.addFirst(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void setShouldLoop(boolean var1) {
|
||||
this.loop = var1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void advance(int var1)
|
||||
{
|
||||
if (super.sequenceDefinition != null) {
|
||||
super.advance(var1);
|
||||
if (this.loop && super.isFinished) {
|
||||
super.isFinished = false;
|
||||
super.frame = 0;
|
||||
super.frameCycle = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Model getModel()
|
||||
{
|
||||
if (super.sequenceDefinition != null)
|
||||
{
|
||||
return super.sequenceDefinition.transformSpotAnimationModel(this.model, super.frame);
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.model.toSharedSequenceModel(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void setModel(Model var1) {
|
||||
this.model = var1;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class Varps {
|
||||
Rasterizer3D.Rasterizer3D_setBrightness(var0);
|
||||
((TextureProvider)Rasterizer3D.Rasterizer3D_textureLoader).setBrightness(var0);
|
||||
ItemComposition.ItemDefinition_cachedSprites.clear();
|
||||
VarbitComposition.clientPreferences.field1193 = var0;
|
||||
VarbitComposition.clientPreferences.brightness = var0;
|
||||
DevicePcmPlayerProvider.savePreferences();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ public class class184 implements WorldMapSection {
|
||||
Varps.method4858((double)(0.5F + (float)var10 / 200.0F));
|
||||
return 1;
|
||||
} else if (var0 == 3182) {
|
||||
float var3 = ((float)VarbitComposition.clientPreferences.field1193 - 0.5F) * 200.0F;
|
||||
float var3 = ((float)VarbitComposition.clientPreferences.brightness - 0.5F) * 200.0F;
|
||||
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = 100 - Math.round(var3);
|
||||
return 1;
|
||||
} else if (var0 != 3183 && var0 != 3184) {
|
||||
|
||||
Reference in New Issue
Block a user