aboutsummaryrefslogtreecommitdiff
path: root/features/betterGuis/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-08-24 07:20:59 +0800
committerGitHub <noreply@github.com>2022-08-24 07:20:59 +0800
commitc05218bf0023aa1dcfe15ec4dfe1d9584c890ec0 (patch)
treee1063475e56e760a4773e5f6c443fcbe87941d78 /features/betterGuis/index.js
parentf9d4adb1ec2dfe8b8aa4befc17da7a9bad32d58c (diff)
parenta1239ebfe638d07fdc2f3167aeabf12191dc220b (diff)
downloadSoopyV2-c05218bf0023aa1dcfe15ec4dfe1d9584c890ec0.tar.gz
SoopyV2-c05218bf0023aa1dcfe15ec4dfe1d9584c890ec0.tar.bz2
SoopyV2-c05218bf0023aa1dcfe15ec4dfe1d9584c890ec0.zip
Merge pull request #47 from DalwynWasTaken/healthbar-ct-methods
Switching to CT methods
Diffstat (limited to 'features/betterGuis/index.js')
-rw-r--r--features/betterGuis/index.js21
1 files changed, 11 insertions, 10 deletions
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) {