Skip to content

Commit

Permalink
status bars: Override hitpoints and prayer max values in LMS
Browse files Browse the repository at this point in the history
While playing Last Man Standing, your hitpoints and prayer values behave
as though their maximum values were 99 instead of their actual max
values.
  • Loading branch information
Nightfirecat committed May 26, 2022
1 parent 88e39ab commit c7ea7a7
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.Map;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.Experience;
import net.runelite.api.MenuEntry;
import net.runelite.api.Point;
import net.runelite.api.Prayer;
Expand Down Expand Up @@ -117,7 +118,7 @@ private void initRenderers()
{
barRenderers.put(BarMode.DISABLED, null);
barRenderers.put(BarMode.HITPOINTS, new BarRenderer(
() -> client.getRealSkillLevel(Skill.HITPOINTS),
() -> inLms() ? Experience.MAX_REAL_LEVEL : client.getRealSkillLevel(Skill.HITPOINTS),
() -> client.getBoostedSkillLevel(Skill.HITPOINTS),
() -> getRestoreValue(Skill.HITPOINTS.getName()),
() ->
Expand Down Expand Up @@ -170,7 +171,7 @@ private void initRenderers()
}
));
barRenderers.put(BarMode.PRAYER, new BarRenderer(
() -> client.getRealSkillLevel(Skill.PRAYER),
() -> inLms() ? Experience.MAX_REAL_LEVEL : client.getRealSkillLevel(Skill.PRAYER),
() -> client.getBoostedSkillLevel(Skill.PRAYER),
() -> getRestoreValue(Skill.PRAYER.getName()),
() ->
Expand Down Expand Up @@ -349,4 +350,9 @@ private BufferedImage loadAndResize(int spriteId)

return ImageUtil.resizeCanvas(image, ICON_DIMENSIONS.width, ICON_DIMENSIONS.height);
}

private boolean inLms()
{
return client.getWidget(WidgetInfo.LMS_KDA) != null;
}
}

0 comments on commit c7ea7a7

Please sign in to comment.