diff options
author | EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> | 2022-06-29 22:57:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 22:57:33 +0800 |
commit | a81b9d3371481e9a00c5db4d9a019428dcd242ba (patch) | |
tree | b37ee674430ce7f989e154fe546b2e0e5c6b8bb8 /features/betterGuis | |
parent | f0479a00f189a57d0f2651daed66d2b8e9dd6e16 (diff) | |
parent | fda166053d056062839b860041e7eadcd34aa273 (diff) | |
download | SoopyV2-a81b9d3371481e9a00c5db4d9a019428dcd242ba.tar.gz SoopyV2-a81b9d3371481e9a00c5db4d9a019428dcd242ba.tar.bz2 SoopyV2-a81b9d3371481e9a00c5db4d9a019428dcd242ba.zip |
Merge branch 'master' into patch-19
Diffstat (limited to 'features/betterGuis')
-rw-r--r-- | features/betterGuis/index.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/features/betterGuis/index.js b/features/betterGuis/index.js index f509674..3c9f264 100644 --- a/features/betterGuis/index.js +++ b/features/betterGuis/index.js @@ -8,6 +8,7 @@ import MuseumGui from "./museumGui.js"; import DungeonReadyGui from "./dungeonReadyGui"; import { SoopyGui } from "../../../guimanager"; import TextBox from "../../../guimanager/GuiElement/TextBox"; +import SoopyNumber from "../../../guimanager/Classes/SoopyNumber"; class BetterGuis extends Feature { constructor() { @@ -138,9 +139,9 @@ class BetterGuis extends Feature { this.invSearchTextBox = new TextBox().setPlaceholder("Click to search").setLocation(0.4, 0.05, 0.2, 0.05) this.invSearchSoopyGui.element.addChild(this.invSearchTextBox) - this.mana = 0 - this.overflowMana = 0 - this.maxMana = 0 + this.mana = new SoopyNumber(0) + this.overflowMana = new SoopyNumber(0) + this.maxMana = new SoopyNumber(0) this.lastOverFlow = Date.now() this.slotMatches = new Map() @@ -165,13 +166,13 @@ class BetterGuis extends Feature { if (curr.includes("Mana")) { curr = curr.split("&b").pop() } - this.mana = parseInt(curr) - this.maxMana = parseInt(max) - if (Date.now() - this.lastOverFlow > 1000) this.overflowMana = 0 + this.mana.set(parseInt(curr), 500) + this.maxMana.set(parseInt(max), 500) + if (Date.now() - this.lastOverFlow > 1000) this.overflowMana.set(0, 500) } actionbarOverflowMana(curr) { - this.overflowMana = parseInt(curr) + this.overflowMana.set(parseInt(curr), 500) this.lastOverFlow = Date.now() } @@ -184,10 +185,10 @@ class BetterGuis extends Feature { Renderer.retainTransforms(true) Renderer.translate(left, top) - let totalAmt = Math.max(this.maxMana, this.mana + this.overflowMana) + let totalAmt = Math.max(this.maxMana.get(), this.mana.get() + this.overflowMana.get()) - let manaPercent = this.mana / totalAmt - let ofPercent = this.overflowMana / totalAmt + let manaPercent = this.mana.get() / totalAmt + let ofPercent = this.overflowMana.get() / totalAmt Renderer.drawRect(Renderer.color(0, 0, 0), 0, 0, 80, 10) Renderer.drawRect(Renderer.color(50, 50, 50), 2, 2, 76, 6) |