Repository: runelite/runelite
Pull request #18602 (2024-12-10 21:31:10)

idle notifier: Add crossbow(u) actions


Patch:
diff --git a/runelite-api/src/main/java/net/runelite/api/AnimationID.java b/runelite-api/src/main/java/net/runelite/api/AnimationID.java
index 4d71df539..74e0390b3 100644
--- a/runelite-api/src/main/java/net/runelite/api/AnimationID.java
+++ b/runelite-api/src/main/java/net/runelite/api/AnimationID.java
@@ -109,6 +109,14 @@ public final class AnimationID
 	public static final int HUNTER_LAY_MANIACAL_MONKEY_BOULDER_TRAP = 7259; // setting up maniacal monkey boulder trap
 	public static final int HUNTER_CHECK_BIRD_SNARE = 5207;
 	public static final int HERBLORE_MAKE_TAR = 5249;
+	public static final int FLETCHING_ATTACH_STOCK_TO_BRONZE_LIMBS = 4436;
+	public static final int FLETCHING_ATTACH_STOCK_TO_BLURITE_LIMBS = 4437;
+	public static final int FLETCHING_ATTACH_STOCK_TO_IRON_LIMBS = 4438;
+	public static final int FLETCHING_ATTACH_STOCK_TO_STEEL_LIMBS = 4439;
+	public static final int FLETCHING_ATTACH_STOCK_TO_MITHRIL_LIMBS = 4440;
+	public static final int FLETCHING_ATTACH_STOCK_TO_ADAMANTITE_LIMBS = 4441;
+	public static final int FLETCHING_ATTACH_STOCK_TO_RUNITE_LIMBS = 4442;
+	public static final int FLETCHING_ATTACH_STOCK_TO_DRAGON_LIMBS = 7860;
 	public static final int FLETCHING_STRING_NORMAL_SHORTBOW = 6678;
 	public static final int FLETCHING_STRING_NORMAL_LONGBOW = 6684;
 	public static final int FLETCHING_STRING_OAK_SHORTBOW = 6679;
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java
index 2af1b914c..59183351f 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java
@@ -49,6 +49,7 @@ import static net.runelite.api.ChatMessageType.GAMEMESSAGE;
 import static net.runelite.api.ChatMessageType.ITEM_EXAMINE;
 import static net.runelite.api.ChatMessageType.MODCHAT;
 import static net.runelite.api.ChatMessageType.NPC_EXAMINE;
+import static net.runelite.api.ChatMessageType.NPC_SAY;
 import static net.runelite.api.ChatMessageType.OBJECT_EXAMINE;
 import static net.runelite.api.ChatMessageType.PUBLICCHAT;
 import static net.runelite.api.ChatMessageType.SPAM;
@@ -92,7 +93,8 @@ public class ChatFilterPlugin extends Plugin
 		OBJECT_EXAMINE,
 		SPAM,
 		PUBLICCHAT,
-		MODCHAT
+		MODCHAT,
+		NPC_SAY
 	);
 
 	private static final CharMatcher jagexPrintableCharMatcher = Text.JAGEX_PRINTABLE_CHAR_MATCHER;
@@ -224,6 +226,7 @@ public class ChatFilterPlugin extends Plugin
 			case CLAN_MESSAGE:
 			case CLAN_GUEST_MESSAGE:
 			case CLAN_GIM_MESSAGE:
+			case NPC_SAY:
 				if (config.filterGameChat())
 				{
 					message = censorMessage(messageNode, null, message);
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java
index fed853ed6..16b4ef477 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java
@@ -593,6 +593,10 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
 				return "#define THREAD_COUNT " + threadCount + "\n" +
 					"#define FACES_PER_THREAD " + facesPerThread + "\n";
 			}
+			if ("texture_config".equals(key))
+			{
+				return "#define TEXTURE_COUNT " + TextureManager.TEXTURE_COUNT + "\n";
+			}
 			return null;
 		});
 		template.addInclude(GpuPlugin.class);
@@ -1509,6 +1513,15 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
 			// Avoid drawing the last frame's buffer during LOADING after LOGIN_SCREEN
 			targetBufferOffset = 0;
 		}
+		if (gameStateChanged.getGameState() == GameState.STARTING)
+		{
+			if (textureArrayId != -1)
+			{
+				textureManager.freeTextureArray(textureArrayId);
+			}
+			textureArrayId = -1;
+			lastAnisotropicFilteringLevel = -1;
+		}
 	}
 
 	@Override
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/TextureManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/TextureManager.java
index 540c32b58..dc7957312 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/TextureManager.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/TextureManager.java
@@ -37,6 +37,7 @@ import org.lwjgl.opengl.GL43C;
 @Slf4j
 class TextureManager
 {
+	static final int TEXTURE_COUNT = 256;
 	private static final int TEXTURE_SIZE = 128;
 
 	int initTextureArray(TextureProvider textureProvider)
@@ -223,8 +224,14 @@ class TextureManager
 	float[] computeTextureAnimations(TextureProvider textureProvider)
 	{
 		Texture[] textures = textureProvider.getTextures();
-		float[] anims = new float[256 * 2];
-		for (int i = 0; i < textures.length; ++i)
+
+		if (textures.length > TEXTURE_COUNT)
+		{
+			log.warn("texture limit exceeded: {} > {}", textures.length, TEXTURE_COUNT);
+		}
+
+		float[] anims = new float[TEXTURE_COUNT * 2];
+		for (int i = 0; i < Math.min(TEXTURE_COUNT, textures.length); ++i)
 		{
 			Texture texture = textures[i];
 			if (texture == null)
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java
index 5a4ba5736..d91215a6b 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java
@@ -232,6 +232,14 @@ public class IdleNotifierPlugin extends Plugin
 			case CRAFTING_CRUSH_BLESSED_BONES:
 			/* Fletching(Cutting, Stringing, Adding feathers and heads) */
 			case FLETCHING_BOW_CUTTING:
+			case FLETCHING_ATTACH_STOCK_TO_BRONZE_LIMBS:
+			case FLETCHING_ATTACH_STOCK_TO_BLURITE_LIMBS:
+			case FLETCHING_ATTACH_STOCK_TO_IRON_LIMBS:
+			case FLETCHING_ATTACH_STOCK_TO_STEEL_LIMBS:
+			case FLETCHING_ATTACH_STOCK_TO_MITHRIL_LIMBS:
+			case FLETCHING_ATTACH_STOCK_TO_ADAMANTITE_LIMBS:
+			case FLETCHING_ATTACH_STOCK_TO_RUNITE_LIMBS:
+			case FLETCHING_ATTACH_STOCK_TO_DRAGON_LIMBS:
 			case FLETCHING_STRING_NORMAL_SHORTBOW:
 			case FLETCHING_STRING_OAK_SHORTBOW:
 			case FLETCHING_STRING_WILLOW_SHORTBOW:
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/StatBoost.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/StatBoost.java
index 0ad1682e5..00113033e 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/StatBoost.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/StatBoost.java
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.itemstats;
 import lombok.Getter;
 import lombok.Setter;
 import net.runelite.api.InventoryID;
+import net.runelite.api.ItemContainer;
 import net.runelite.api.ItemID;
 import net.runelite.api.Skill;
 import net.runelite.api.Varbits;
@@ -75,7 +76,8 @@ public abstract class StatBoost extends SingleEffect
 					multiplier += 0.2;
 				}
 
-				if (client.getItemContainer(InventoryID.EQUIPMENT).contains(ItemID.SUNLIT_BRACERS))
+				final ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT);
+				if (equipment != null && equipment.contains(ItemID.SUNLIT_BRACERS))
 				{
 					multiplier += 1;
 				}
diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/geom.glsl b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/geom.glsl
index 50f9078ed..8c72591a4 100644
--- a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/geom.glsl
+++ b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/geom.glsl
@@ -25,6 +25,8 @@
 
 #version 330
 
+#include texture_config
+
 //#define ZBUF
 
 // smallest unit of the texture which can be moved per tick. textures are all
@@ -47,7 +49,7 @@ layout(std140) uniform uniforms {
 
 #include "uv.glsl"
 
-uniform vec2 textureAnimations[256];
+uniform vec2 textureAnimations[TEXTURE_COUNT];
 uniform int tick;
 uniform mat4 projectionMatrix;
 
@@ -75,7 +77,7 @@ void main() {
     vec3 cameraPos = vec3(cameraX, cameraY, cameraZ);
     compute_uv(cameraPos, gVertex[0], gVertex[1], gVertex[2], gTexPos[0], gTexPos[1], gTexPos[2], uv[0], uv[1], uv[2]);
 
-    vec2 textureAnim = textureAnimations[textureId - 1];
+    vec2 textureAnim = textureAnimations[min(textureId - 1, TEXTURE_COUNT - 1)];
     for (int i = 0; i < 3; ++i) {
       uv[i] += tick * textureAnim * TEXTURE_ANIM_UNIT;
     }


Test patch:
diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java
index 1e177b0cd..13fe5341f 100644
--- a/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java
+++ b/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java
@@ -65,6 +65,10 @@ public class ShaderTest
 					return "#define THREAD_COUNT " + threadCount + "\n" +
 						"#define FACES_PER_THREAD " + facesPerThread + "\n";
 				}
+				if ("texture_config".equals(key))
+				{
+					return "#define TEXTURE_COUNT " + TextureManager.TEXTURE_COUNT + "\n";
+				}
 				return null;
 			}),
 		};