diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangePlugin.java
index c1c92c2f38..3728bad6dd 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangePlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangePlugin.java
@@ -710,13 +710,15 @@ public class GrandExchangePlugin extends Plugin
case "setGETitle":
setGeTitle();
break;
- case "geExamineText":
+ case "geBuyExamineText":
+ case "geSellExamineText":
{
+ boolean buy = "geBuyExamineText".equals(event.getEventName());
String[] stack = client.getStringStack();
int sz = client.getStringStackSize();
String fee = stack[sz - 2];
String examine = stack[sz - 3];
- String text = setExamineText(examine, fee);
+ String text = setExamineText(examine, fee, buy);
if (text != null)
{
stack[sz - 1] = text;
@@ -807,12 +809,12 @@ public class GrandExchangePlugin extends Plugin
}
}
- private String setExamineText(String examine, String fee)
+ private String setExamineText(String examine, String fee, boolean buy)
{
final int itemId = client.getVar(VarPlayer.CURRENT_GE_ITEM);
StringBuilder sb = new StringBuilder();
- if (config.enableGELimits())
+ if (buy && config.enableGELimits())
{
final ItemStats itemStats = itemManager.getItemStats(itemId, false);
@@ -823,7 +825,7 @@ public class GrandExchangePlugin extends Plugin
}
}
- if (config.enableGELimitReset())
+ if (buy && config.enableGELimitReset())
{
Instant resetTime = getLimitResetTime(itemId);
if (resetTime != null)
@@ -851,7 +853,13 @@ public class GrandExchangePlugin extends Plugin
return null;
}
- return shortenExamine(examine) + "
" + sb + "
" + fee;
+ if (!fee.isEmpty())
+ {
+ sb.append("
").append(fee);
+ }
+
+ // Sell offers include an additional fee text which doesn't fit, so we truncate the examine text
+ return (!buy ? shortenExamine(examine) : examine) + "
" + sb;
}
private static String shortenExamine(String examine)
diff --git a/runelite-client/src/main/scripts/GeExamineInfoText.rs2asm b/runelite-client/src/main/scripts/GeExamineInfoText.rs2asm
index 07eb5a9c1a..08ac1952de 100644
--- a/runelite-client/src/main/scripts/GeExamineInfoText.rs2asm
+++ b/runelite-client/src/main/scripts/GeExamineInfoText.rs2asm
@@ -51,8 +51,8 @@ LABEL35:
sload 0 ; examine
sload 1 ; Convenience fee
- sload 2 ; "<$string0>
<$string1>"
- sconst "geExamineText"
+ sload 2 ; "<$string0>
<$string1>" or "<$string0>
<$string1>"
+ sconst "geSellExamineText"
runelite_callback
sstore 2 ; final text
pop_string ; Convenience fee
@@ -157,6 +157,16 @@ LABEL35:
LABEL131:
sload 0
sstore 2
+
+ sload 0 ; examine
+ sload 1 ; ""
+ sload 2 ; examine
+ sconst "geBuyExamineText"
+ runelite_callback
+ sstore 2 ; final text
+ pop_string ; ""
+ pop_string ; examine
+
iconst 1
iload 1
if_sethide