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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user