mixins: these are still broken lol
This commit is contained in:
@@ -287,9 +287,9 @@ public class RuneLite
|
|||||||
|
|
||||||
PROFILES_DIR.mkdirs();
|
PROFILES_DIR.mkdirs();
|
||||||
|
|
||||||
log.info("OpenOSRS {} (launcher version {}) starting up, args: {}",
|
log.info("OpenOSRS {} (RuneLite version {}, launcher version {}) starting up, args: {}",
|
||||||
RuneLiteProperties.getVersion(), RuneLiteProperties.getLauncherVersion() == null ? "unknown" : RuneLiteProperties.getLauncherVersion(),
|
OpenOSRS.SYSTEM_VERSION, RuneLiteProperties.getVersion() == null ? "unknown" : RuneLiteProperties.getVersion(),
|
||||||
args.length == 0 ? "none" : String.join(" ", args));
|
RuneLiteProperties.getLauncherVersion(), args.length == 0 ? "none" : String.join(" ", args));
|
||||||
|
|
||||||
final long start = System.currentTimeMillis();
|
final long start = System.currentTimeMillis();
|
||||||
|
|
||||||
@@ -530,6 +530,7 @@ public class RuneLite
|
|||||||
//Fixes win10 scaling when not 100% while using Anti-Aliasing with GPU
|
//Fixes win10 scaling when not 100% while using Anti-Aliasing with GPU
|
||||||
System.setProperty("sun.java2d.uiScale", "1.0");
|
System.setProperty("sun.java2d.uiScale", "1.0");
|
||||||
|
|
||||||
System.setProperty("runelite.launcher.version", "" + RuneLiteAPI.getVersion());
|
String launcherVersion = System.getProperty("launcher.version");
|
||||||
|
System.setProperty("runelite.launcher.version", launcherVersion == null ? "unknown" : launcherVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,9 +33,9 @@ import net.runelite.api.mixins.Inject;
|
|||||||
import net.runelite.api.mixins.Mixin;
|
import net.runelite.api.mixins.Mixin;
|
||||||
import net.runelite.api.mixins.Shadow;
|
import net.runelite.api.mixins.Shadow;
|
||||||
import net.runelite.rs.api.RSClient;
|
import net.runelite.rs.api.RSClient;
|
||||||
import net.runelite.rs.api.RSRenderable;
|
|
||||||
import net.runelite.rs.api.RSGameObject;
|
import net.runelite.rs.api.RSGameObject;
|
||||||
import net.runelite.rs.api.RSModel;
|
import net.runelite.rs.api.RSModel;
|
||||||
|
import net.runelite.rs.api.RSRenderable;
|
||||||
|
|
||||||
@Mixin(RSGameObject.class)
|
@Mixin(RSGameObject.class)
|
||||||
public abstract class RSGameObjectMixin implements RSGameObject
|
public abstract class RSGameObjectMixin implements RSGameObject
|
||||||
@@ -43,6 +43,23 @@ public abstract class RSGameObjectMixin implements RSGameObject
|
|||||||
@Shadow("client")
|
@Shadow("client")
|
||||||
private static RSClient client;
|
private static RSClient client;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private int gameObjectPlane;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Override
|
||||||
|
public int getPlane()
|
||||||
|
{
|
||||||
|
return gameObjectPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Override
|
||||||
|
public void setPlane(int plane)
|
||||||
|
{
|
||||||
|
this.gameObjectPlane = plane;
|
||||||
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public Point getSceneMinLocation()
|
public Point getSceneMinLocation()
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ import net.runelite.api.mixins.Inject;
|
|||||||
import net.runelite.api.mixins.Mixin;
|
import net.runelite.api.mixins.Mixin;
|
||||||
import net.runelite.api.mixins.Shadow;
|
import net.runelite.api.mixins.Shadow;
|
||||||
import net.runelite.rs.api.RSActor;
|
import net.runelite.rs.api.RSActor;
|
||||||
|
import net.runelite.rs.api.RSBoundaryObject;
|
||||||
import net.runelite.rs.api.RSClient;
|
import net.runelite.rs.api.RSClient;
|
||||||
|
import net.runelite.rs.api.RSFloorDecoration;
|
||||||
import net.runelite.rs.api.RSRenderable;
|
import net.runelite.rs.api.RSRenderable;
|
||||||
import net.runelite.rs.api.RSGameObject;
|
import net.runelite.rs.api.RSGameObject;
|
||||||
import net.runelite.rs.api.RSGraphicsObject;
|
import net.runelite.rs.api.RSGraphicsObject;
|
||||||
@@ -70,6 +72,7 @@ import net.runelite.rs.api.RSNodeDeque;
|
|||||||
import net.runelite.rs.api.RSProjectile;
|
import net.runelite.rs.api.RSProjectile;
|
||||||
import net.runelite.rs.api.RSTile;
|
import net.runelite.rs.api.RSTile;
|
||||||
import net.runelite.rs.api.RSTileItem;
|
import net.runelite.rs.api.RSTileItem;
|
||||||
|
import net.runelite.rs.api.RSWallDecoration;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
@Mixin(RSTile.class)
|
@Mixin(RSTile.class)
|
||||||
@@ -261,10 +264,18 @@ public abstract class RSTileMixin implements RSTile
|
|||||||
public void wallObjectChanged(int idx)
|
public void wallObjectChanged(int idx)
|
||||||
{
|
{
|
||||||
WallObject previous = previousWallObject;
|
WallObject previous = previousWallObject;
|
||||||
WallObject current = getWallObject();
|
RSBoundaryObject current = (RSBoundaryObject) getWallObject();
|
||||||
|
|
||||||
previousWallObject = current;
|
previousWallObject = current;
|
||||||
|
|
||||||
|
if (current != null)
|
||||||
|
{
|
||||||
|
if ((client.getTileSettings()[1][getX()][getY()] & 2) == 2)
|
||||||
|
{
|
||||||
|
current.setPlane(getRenderLevel() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (current == null && previous != null)
|
if (current == null && previous != null)
|
||||||
{
|
{
|
||||||
WallObjectDespawned wallObjectDespawned = new WallObjectDespawned();
|
WallObjectDespawned wallObjectDespawned = new WallObjectDespawned();
|
||||||
@@ -294,10 +305,18 @@ public abstract class RSTileMixin implements RSTile
|
|||||||
public void decorativeObjectChanged(int idx)
|
public void decorativeObjectChanged(int idx)
|
||||||
{
|
{
|
||||||
DecorativeObject previous = previousDecorativeObject;
|
DecorativeObject previous = previousDecorativeObject;
|
||||||
DecorativeObject current = getDecorativeObject();
|
RSWallDecoration current = (RSWallDecoration) getDecorativeObject();
|
||||||
|
|
||||||
previousDecorativeObject = current;
|
previousDecorativeObject = current;
|
||||||
|
|
||||||
|
if (current != null)
|
||||||
|
{
|
||||||
|
if ((client.getTileSettings()[1][getX()][getY()] & 2) == 2)
|
||||||
|
{
|
||||||
|
current.setPlane(getRenderLevel() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (current == null && previous != null)
|
if (current == null && previous != null)
|
||||||
{
|
{
|
||||||
DecorativeObjectDespawned decorativeObjectDespawned = new DecorativeObjectDespawned();
|
DecorativeObjectDespawned decorativeObjectDespawned = new DecorativeObjectDespawned();
|
||||||
@@ -327,10 +346,18 @@ public abstract class RSTileMixin implements RSTile
|
|||||||
public void groundObjectChanged(int idx)
|
public void groundObjectChanged(int idx)
|
||||||
{
|
{
|
||||||
GroundObject previous = previousGroundObject;
|
GroundObject previous = previousGroundObject;
|
||||||
GroundObject current = getGroundObject();
|
RSFloorDecoration current = (RSFloorDecoration) getGroundObject();
|
||||||
|
|
||||||
previousGroundObject = current;
|
previousGroundObject = current;
|
||||||
|
|
||||||
|
if (current != null)
|
||||||
|
{
|
||||||
|
if ((client.getTileSettings()[1][getX()][getY()] & 2) == 2)
|
||||||
|
{
|
||||||
|
current.setPlane(getRenderLevel() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (current == null && previous != null)
|
if (current == null && previous != null)
|
||||||
{
|
{
|
||||||
GroundObjectDespawned groundObjectDespawned = new GroundObjectDespawned();
|
GroundObjectDespawned groundObjectDespawned = new GroundObjectDespawned();
|
||||||
@@ -378,11 +405,13 @@ public abstract class RSTileMixin implements RSTile
|
|||||||
// Update previous object to current
|
// Update previous object to current
|
||||||
previousGameObjects[idx] = current;
|
previousGameObjects[idx] = current;
|
||||||
|
|
||||||
// Last game object
|
if (current != null)
|
||||||
RSGameObject last = lastGameObject;
|
{
|
||||||
|
if ((client.getTileSettings()[1][getX()][getY()] & 2) == 2)
|
||||||
// Update last game object
|
{
|
||||||
lastGameObject = current;
|
current.setPlane(getRenderLevel() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Duplicate event, return
|
// Duplicate event, return
|
||||||
if (current == previous)
|
if (current == previous)
|
||||||
@@ -390,14 +419,6 @@ public abstract class RSTileMixin implements RSTile
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current != null && current == last)
|
|
||||||
{
|
|
||||||
// When >1 tile objects are added to the scene, the same GameObject is added to
|
|
||||||
// multiple tiles. We keep lastGameObject to prevent duplicate spawn events from
|
|
||||||
// firing for these objects.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// actors, projectiles, and graphics objects are added and removed from the scene each frame as GameObjects,
|
// actors, projectiles, and graphics objects are added and removed from the scene each frame as GameObjects,
|
||||||
// so ignore them.
|
// so ignore them.
|
||||||
boolean currentInvalid = false, prevInvalid = false;
|
boolean currentInvalid = false, prevInvalid = false;
|
||||||
@@ -405,12 +426,14 @@ public abstract class RSTileMixin implements RSTile
|
|||||||
{
|
{
|
||||||
RSRenderable renderable = current.getRenderable();
|
RSRenderable renderable = current.getRenderable();
|
||||||
currentInvalid = renderable instanceof RSActor || renderable instanceof RSProjectile || renderable instanceof RSGraphicsObject;
|
currentInvalid = renderable instanceof RSActor || renderable instanceof RSProjectile || renderable instanceof RSGraphicsObject;
|
||||||
|
currentInvalid |= current.getStartX() != this.getX() || current.getStartY() != this.getY();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (previous != null)
|
if (previous != null)
|
||||||
{
|
{
|
||||||
RSRenderable renderable = previous.getRenderable();
|
RSRenderable renderable = previous.getRenderable();
|
||||||
prevInvalid = renderable instanceof RSActor || renderable instanceof RSProjectile || renderable instanceof RSGraphicsObject;
|
prevInvalid = renderable instanceof RSActor || renderable instanceof RSProjectile || renderable instanceof RSGraphicsObject;
|
||||||
|
prevInvalid |= previous.getStartX() != this.getX() || previous.getStartY() != this.getY();
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger logger = client.getLogger();
|
Logger logger = client.getLogger();
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ public interface RSGameObject extends GameObject
|
|||||||
@Import("renderable")
|
@Import("renderable")
|
||||||
RSRenderable getRenderable();
|
RSRenderable getRenderable();
|
||||||
|
|
||||||
@Import("plane")
|
|
||||||
int getPlane();
|
|
||||||
|
|
||||||
@Import("startX")
|
@Import("startX")
|
||||||
int getStartX();
|
int getStartX();
|
||||||
|
|
||||||
@@ -45,4 +42,8 @@ public interface RSGameObject extends GameObject
|
|||||||
@Import("flags")
|
@Import("flags")
|
||||||
@Override
|
@Override
|
||||||
int getFlags();
|
int getFlags();
|
||||||
|
|
||||||
|
int getPlane();
|
||||||
|
|
||||||
|
void setPlane(int plane);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user