xpdrop: fix recoloring xp drops with hide skill icons enabled

This commit is contained in:
ThatGamerBlue
2020-07-18 02:25:36 +01:00
committed by Adam
parent 11d244bd06
commit 4e3c887e87

View File

@@ -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())