From a1239ebfe638d07fdc2f3167aeabf12191dc220b Mon Sep 17 00:00:00 2001 From: Dalwyn <100111505+DalwynWasTaken@users.noreply.github.com> Date: Mon, 22 Aug 2022 21:44:05 +0200 Subject: Switching to CT methods --- features/betterGuis/index.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'features/betterGuis/index.js') diff --git a/features/betterGuis/index.js b/features/betterGuis/index.js index 9f65dc4..e748227 100644 --- a/features/betterGuis/index.js +++ b/features/betterGuis/index.js @@ -204,20 +204,21 @@ class BetterGuis extends Feature { let left = Renderer.screen.getWidth() / 2 - 91; let top = Renderer.screen.getHeight() - 40; - Renderer.retainTransforms(true) - Renderer.translate(left, top) + Renderer.retainTransforms(true); + Renderer.translate(left, top); - let totalAmt = Math.max(Player.getPlayer()[m.getMaxHealth](), Player.getHP() + Player.getPlayer()[m.getAbsorptionAmount]()) + let totalAmt = Math.max(Player.asPlayerMP().getMaxHP(), Player.getHP() + Player.asPlayerMP().getAbsorption()); - let hpPercent = Player.getHP() / totalAmt - let abPercent = Player.getPlayer()[m.getAbsorptionAmount]() / totalAmt + let hpPercent = Player.getHP() / totalAmt; + let abPercent = Player.asPlayerMP().getAbsorption() / totalAmt; - Renderer.drawRect(Renderer.color(0, 0, 0), 0, 0, 80, 10) - Renderer.drawRect(Renderer.color(50, 50, 50), 2, 2, 76, 6) - Renderer.drawRect(Renderer.color(255, 0, 0), 2, 2, hpPercent * 76, 6) - Renderer.drawRect(Renderer.color(255, 255, 0), 2 + hpPercent * 76, 2, abPercent * 76, 6) - Renderer.retainTransforms(false) + Renderer.drawRect(Renderer.color(0, 0, 0), 0, 0, 80, 10); + Renderer.drawRect(Renderer.color(50, 50, 50), 2, 2, 76, 6); + Renderer.drawRect(Renderer.color(255, 0, 0), 2, 2, hpPercent * 76, 6); + Renderer.drawRect(Renderer.color(255, 255, 0), 2 + hpPercent * 76, 2, abPercent * 76, 6); + + Renderer.retainTransforms(false); } postGuiRender(x, y, gui) { -- cgit