xpdrop: fix recoloring xp drops with hide skill icons enabled
This commit is contained in:
@@ -96,15 +96,10 @@ public class XpDropPlugin extends Plugin
|
|||||||
// child 0 is the xpdrop text, everything else are sprite ids for skills
|
// child 0 is the xpdrop text, everything else are sprite ids for skills
|
||||||
final Widget text = children[0];
|
final Widget text = children[0];
|
||||||
|
|
||||||
if (config.hideSkillIcons())
|
|
||||||
{
|
|
||||||
// keep only text
|
|
||||||
Arrays.fill(children, 1, children.length, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
PrayerType prayer = getActivePrayerType();
|
PrayerType prayer = getActivePrayerType();
|
||||||
if (prayer == null)
|
if (prayer == null)
|
||||||
{
|
{
|
||||||
|
hideSkillIcons(xpdrop);
|
||||||
resetTextColor(text);
|
resetTextColor(text);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -150,6 +145,8 @@ public class XpDropPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
resetTextColor(text);
|
resetTextColor(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hideSkillIcons(xpdrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetTextColor(Widget widget)
|
private void resetTextColor(Widget widget)
|
||||||
@@ -160,6 +157,16 @@ public class XpDropPlugin extends Plugin
|
|||||||
widget.setTextColor(color);
|
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()
|
private PrayerType getActivePrayerType()
|
||||||
{
|
{
|
||||||
for (XpPrayer prayer : XpPrayer.values())
|
for (XpPrayer prayer : XpPrayer.values())
|
||||||
|
|||||||
Reference in New Issue
Block a user