diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 299664294b..d4748a80ee 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -25,7 +25,7 @@ object ProjectVersions { const val launcherVersion = "2.2.0" - const val rlVersion = "1.6.32" + const val rlVersion = "1.6.35" const val openosrsVersion = "3.5.4" diff --git a/runelite-api/src/main/java/net/runelite/api/MenuEntry.java b/runelite-api/src/main/java/net/runelite/api/MenuEntry.java index 2b5b0a477c..60ff56452b 100644 --- a/runelite-api/src/main/java/net/runelite/api/MenuEntry.java +++ b/runelite-api/src/main/java/net/runelite/api/MenuEntry.java @@ -37,14 +37,14 @@ public class MenuEntry implements Cloneable /** * The option text added to the menu (ie. "Walk here", "Use"). */ - private String menuOption; + private String option; /** * The target of the action (ie. Item or Actor name). *
* If the option does not apply to any target, this field
* will be set to empty string.
*/
- private String menuTarget;
+ private String target;
/**
* An identifier value for the target of the action.
*/
@@ -61,7 +61,7 @@ public class MenuEntry implements Cloneable
/**
* A second additional parameter for the action.
*/
- private int widgetId;
+ private int actionParam1;
/**
* If this field is true and you have single mouse button on and this entry is
* the top entry the right click menu will not be opened when you left click
@@ -70,14 +70,14 @@ public class MenuEntry implements Cloneable
*/
private boolean forceLeftClick;
- public MenuEntry(String menuOption, String menuTarget, int type, int opcode, int actionParam0, int widgetId, boolean forceLeftClick)
+ public MenuEntry(String option, String target, int type, int opcode, int actionParam0, int actionParam1, boolean forceLeftClick)
{
- this.menuOption = menuOption;
- this.menuTarget = menuTarget;
+ this.option = option;
+ this.target = target;
this.type = type;
this.opcode = opcode;
this.actionParam0 = actionParam0;
- this.widgetId = widgetId;
+ this.actionParam1 = actionParam1;
this.forceLeftClick = forceLeftClick;
}
@@ -94,6 +94,16 @@ public class MenuEntry implements Cloneable
}
}
+ public void setParam0(int i)
+ {
+ this.actionParam0 = i;
+ }
+
+ public void setParam1(int i)
+ {
+ this.actionParam1 = i;
+ }
+
/**
* Get opcode, but as it's enum counterpart
*/
diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java
index c17c92bfdc..cb567b17f5 100644
--- a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java
+++ b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java
@@ -86,12 +86,12 @@ public class MenuOptionClicked extends MenuEntry implements Event
public void setMenuEntry(MenuEntry e)
{
- setMenuOption(e.getMenuOption());
- setMenuTarget(e.getMenuTarget());
+ setOption(e.getOption());
+ setTarget(e.getTarget());
setType(e.getType());
setOpcode(e.getOpcode());
setActionParam0(e.getActionParam0());
- setWidgetId(e.getWidgetId());
+ setActionParam1(e.getActionParam1());
setForceLeftClick(e.isForceLeftClick());
}
}
diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java b/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java
index ab0911c1f4..9894e41492 100644
--- a/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java
+++ b/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java
@@ -28,6 +28,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.annotation.Nullable;
+import net.runelite.http.api.RuneLiteAPI;
import okhttp3.HttpUrl;
public class RuneLiteProperties
@@ -144,7 +145,7 @@ public class RuneLiteProperties
public static HttpUrl getPluginHubBase()
{
String version = System.getProperty(PLUGINHUB_VERSION, properties.getProperty(PLUGINHUB_VERSION));
- return HttpUrl.parse(properties.get(PLUGINHUB_BASE) + "/" + version);
+ return HttpUrl.parse(properties.get(PLUGINHUB_BASE) + "/" + RuneLiteAPI.getVersion());
}
public static String getImgurClientId()
diff --git a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java
index d7e353df4c..0329cbb229 100644
--- a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java
+++ b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java
@@ -24,6 +24,7 @@
*/
package net.runelite.client.callback;
+import com.google.inject.Injector;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
@@ -39,22 +40,27 @@ import java.awt.image.VolatileImage;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
+import net.runelite.api.BufferProvider;
import net.runelite.api.Client;
+import net.runelite.api.Entity;
import net.runelite.api.MainBufferProvider;
import net.runelite.api.NullItemID;
import net.runelite.api.RenderOverview;
import net.runelite.api.Skill;
import net.runelite.api.WorldMapManager;
+import net.runelite.api.events.BeforeMenuRender;
import net.runelite.api.events.BeforeRender;
import net.runelite.api.events.FakeXpDrop;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.hooks.Callbacks;
+import net.runelite.api.hooks.DrawCallbacks;
import net.runelite.api.widgets.Widget;
import static net.runelite.api.widgets.WidgetInfo.WORLD_MAP_VIEW;
import net.runelite.api.widgets.WidgetItem;
import net.runelite.client.Notifier;
+import net.runelite.client.RuneLite;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.eventbus.Subscribe;
@@ -84,8 +90,8 @@ public class Hooks implements Callbacks
private static final GameTick GAME_TICK = new GameTick();
private static final BeforeRender BEFORE_RENDER = new BeforeRender();
- @Inject
- private Client client;
+ private static final Injector injector = RuneLite.getInjector();
+ private static final Client client = injector.getInstance(Client.class);
@Inject
private OverlayRenderer renderer;
@@ -535,4 +541,43 @@ public class Hooks implements Callbacks
);
eventBus.post(fakeXpDrop);
}
+
+ public static void clearColorBuffer(int x, int y, int width, int height, int color)
+ {
+ BufferProvider bp = client.getBufferProvider();
+ int canvasWidth = bp.getWidth();
+ int[] pixels = bp.getPixels();
+
+ int pixelPos = y * canvasWidth + x;
+ int pixelJump = canvasWidth - width;
+
+ for (int cy = y; cy < y + height; cy++)
+ {
+ for (int cx = x; cx < x + width; cx++)
+ {
+ pixels[pixelPos++] = 0;
+ }
+ pixelPos += pixelJump;
+ }
+ }
+
+ public static void renderDraw(Entity entity, int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash)
+ {
+ DrawCallbacks drawCallbacks = client.getDrawCallbacks();
+ if (drawCallbacks != null)
+ {
+ drawCallbacks.draw(entity, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
+ }
+ else
+ {
+ entity.draw(orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
+ }
+ }
+
+ public static boolean drawMenu()
+ {
+ BeforeMenuRender event = new BeforeMenuRender();
+ client.getCallbacks().post(event);
+ return event.isConsumed();
+ }
}
diff --git a/runelite-client/src/main/java/net/runelite/client/externalplugins/ExternalPluginClient.java b/runelite-client/src/main/java/net/runelite/client/externalplugins/ExternalPluginClient.java
index 0df12bf1ed..4a1cb05c7c 100644
--- a/runelite-client/src/main/java/net/runelite/client/externalplugins/ExternalPluginClient.java
+++ b/runelite-client/src/main/java/net/runelite/client/externalplugins/ExternalPluginClient.java
@@ -67,12 +67,13 @@ public class ExternalPluginClient
{
HttpUrl manifest = RuneLiteProperties.getPluginHubBase()
.newBuilder()
- .addPathSegments("manifest.js")
+ .addPathSegment("manifest.js")
.build();
try (Response res = okHttpClient.newCall(new Request.Builder().url(manifest).build()).execute())
{
if (res.code() != 200)
{
+ System.out.println(manifest.url().toString());
throw new IOException("Non-OK response code: " + res.code());
}
diff --git a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java
index 7b10e95b3b..d4c77068e2 100644
--- a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java
+++ b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java
@@ -109,8 +109,8 @@ public class MenuManager
{
for (MenuEntry menuEntry : client.getMenuEntries())
{
- String option = menuEntry.getMenuOption();
- String target = menuEntry.getMenuTarget();
+ String option = menuEntry.getOption();
+ String target = menuEntry.getTarget();
if (option.equals(customMenuOption.getMenuOption()) && target.equals(customMenuOption.getMenuTarget()))
{
@@ -128,7 +128,7 @@ public class MenuManager
return;
}
- int widgetId = event.getWidgetId();
+ int widgetId = event.getActionParam1();
Collection5
username
String username = Text.removeTags(target).split("[(]")[0].trim();
PlayerMenuOptionClicked playerMenuOptionClicked = new PlayerMenuOptionClicked();
- playerMenuOptionClicked.setMenuOption(event.getMenuOption());
+ playerMenuOptionClicked.setMenuOption(event.getOption());
playerMenuOptionClicked.setMenuTarget(username);
eventBus.post(playerMenuOptionClicked);
diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java
index 053ed3e2ef..2cb0b1641e 100644
--- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java
+++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java
@@ -148,7 +148,7 @@ public class OverlayManager
{
List