From 4e3c887e878012949019ebcb2747b32e07bb9bdf Mon Sep 17 00:00:00 2001 From: ThatGamerBlue Date: Sat, 18 Jul 2020 02:25:36 +0100 Subject: [PATCH] xpdrop: fix recoloring xp drops with hide skill icons enabled --- .../plugins/experiencedrop/XpDropPlugin.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java index b5ddf8bb22..51498bd9f9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java @@ -96,15 +96,10 @@ public class XpDropPlugin extends Plugin // child 0 is the xpdrop text, everything else are sprite ids for skills final Widget text = children[0]; - if (config.hideSkillIcons()) - { - // keep only text - Arrays.fill(children, 1, children.length, null); - } - PrayerType prayer = getActivePrayerType(); if (prayer == null) { + hideSkillIcons(xpdrop); resetTextColor(text); return; } @@ -150,6 +145,8 @@ public class XpDropPlugin extends Plugin { resetTextColor(text); } + + hideSkillIcons(xpdrop); } private void resetTextColor(Widget widget) @@ -160,6 +157,16 @@ public class XpDropPlugin extends Plugin widget.setTextColor(color); } + private void hideSkillIcons(Widget xpdrop) + { + if (config.hideSkillIcons()) + { + Widget[] children = xpdrop.getChildren(); + // keep only text + Arrays.fill(children, 1, children.length, null); + } + } + private PrayerType getActivePrayerType() { for (XpPrayer prayer : XpPrayer.values())