Update slayer points in tooltip while in rewards screen (#7620)

Slayer points are updated while in the rewards menu, including before
and after a purchase. Previously, the points variable was updated on
each tick to whatever was displayed in the "Slayer points: "
widget, but that change was never reflected in the tooltip until the
next tooltip update. The tooltip now updates whenever a change in
slayer points is detected while in the rewards menu.

Closes #7611
This commit is contained in:
daiya7
2019-01-30 02:32:23 -06:00
committed by Tomas Slusny
parent 32f683cd71
commit 53a1a9bb7f

View File

@@ -372,7 +372,15 @@ public class SlayerPlugin extends Plugin
Matcher mPoints = REWARD_POINTS.matcher(w.getText());
if (mPoints.find())
{
final int prevPoints = points;
points = Integer.parseInt(mPoints.group(1).replaceAll(",", ""));
if (prevPoints != points)
{
removeCounter();
addCounter();
}
break;
}
}