aboutsummaryrefslogtreecommitdiff
path: root/features/hud/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-29 12:04:52 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-29 12:04:52 +0800
commita6593709b0e1e99e241b6c163fe66623685b6efc (patch)
tree9714e82716caf9edd6be05a1822fa492eb6756ed /features/hud/index.js
parenta7dcf231cc43c9ef73d6a969203c2dafd2ce8caf (diff)
downloadSoopyV2-a6593709b0e1e99e241b6c163fe66623685b6efc.tar.gz
SoopyV2-a6593709b0e1e99e241b6c163fe66623685b6efc.tar.bz2
SoopyV2-a6593709b0e1e99e241b6c163fe66623685b6efc.zip
first part of supporting java side rendering
Diffstat (limited to 'features/hud/index.js')
-rw-r--r--features/hud/index.js28
1 files changed, 10 insertions, 18 deletions
diff --git a/features/hud/index.js b/features/hud/index.js
index c6254d4..7d07085 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -137,6 +137,7 @@ class Hud extends Feature {
scale: this.spotifyElement.locationSetting.scale,
shadowType: this.spotifyElement.locationSetting.shadowType
})
+ this.spotifyElement2.renderElm.stopRender()
let hudStatTypes = {
"cata": "Catacombs level + Exp",
@@ -311,6 +312,14 @@ class Hud extends Feature {
}
tick() {
+ if (this.fpsFastSetting.getValue()) {
+ if (this.fpsLowSetting.getValue()) {
+ this.fpsElement.setText("&6Fps&7> &f" + Math.round(this.fps.get()) + "&7/" + Math.round(this.lowFps.get()))
+ } else {
+ this.fpsElement.setText("&6Fps&7> &f" + Math.round(this.fps.get()))
+ }
+ }
+
if (!this.lagEnabled.getValue()) return
if (this.packetMoves > 0) {
this.secondPackets++
@@ -329,22 +338,9 @@ class Hud extends Feature {
}
renderHud() {
- if (this.fpsFastSetting.getValue()) {
- if (this.fpsLowSetting.getValue()) {
- this.fpsElement.setText("&6Fps&7> &f" + Math.round(this.fps.get()) + "&7/" + Math.round(this.lowFps.get()))
- } else {
- this.fpsElement.setText("&6Fps&7> &f" + Math.round(this.fps.get()))
- }
- }
-
- for (let element of this.hudElements) {
- element.render()
- }
-
if (this.showSpotifyPlaying.getValue() && Date.now() - this.spotifyElement.tempDisableTime > 100) {
let scale = this.spotifyElement.locationSetting.scale
let spotifyWidth1 = this.spotifyElement.getWidth() * scale
- this.spotifyElement.render()
this.spotifyElement2.locationSetting.x = this.spotifyElement.locationSetting.x + spotifyWidth1
this.spotifyElement2.locationSetting.y = this.spotifyElement.locationSetting.y
this.spotifyElement2.locationSetting.scale = scale
@@ -373,10 +369,6 @@ class Hud extends Feature {
if (this.witherImpactCooldownSetting.getValue() && Date.now() - this.lastWitherImpact < 10000) {
Renderer.drawString(Math.max(0, Math.ceil((5000 - (Date.now() - this.lastWitherImpact)) / 1000)) + "s", Renderer.screen.getWidth() / 2 - Renderer.getStringWidth(Math.max(0, Math.ceil((5000 - (Date.now() - this.lastWitherImpact)) / 1000)) + "s") / 2, Renderer.screen.getHeight() / 2 - 15)
}
-
- for (let stat of this.hudStat) {
- stat.textElement.render()
- }
}
renderWorld() {
@@ -484,7 +476,7 @@ class Hud extends Feature {
if (!Player.getPlayer()) return
if (!Player.getInventory()) return
- if (!this.FeatureManager.features["dataLoader"].class.isInSkyblock) {
+ if (this.FeatureManager.features["dataLoader"] && !this.FeatureManager.features["dataLoader"].class.isInSkyblock) {
this.soulflowElement.setText("")
this.petElement.setText("")
return