aboutsummaryrefslogtreecommitdiff
path: root/features/hud
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-29 21:15:14 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-29 21:15:14 +0800
commitd8aa514a40f3856376e50f180da3c3f79c608004 (patch)
tree82addd0df2d34e5d3fff980d6d71cdb1ce99562d /features/hud
parentc1f2703faf17aa31eafb28e7ae98c1b771b6e6ff (diff)
downloadSoopyV2-d8aa514a40f3856376e50f180da3c3f79c608004.tar.gz
SoopyV2-d8aa514a40f3856376e50f180da3c3f79c608004.tar.bz2
SoopyV2-d8aa514a40f3856376e50f180da3c3f79c608004.zip
more forge side rendering changes
Diffstat (limited to 'features/hud')
-rw-r--r--features/hud/HudTextElement.js9
-rw-r--r--features/hud/index.js9
2 files changed, 17 insertions, 1 deletions
diff --git a/features/hud/HudTextElement.js b/features/hud/HudTextElement.js
index de031a2..834ef28 100644
--- a/features/hud/HudTextElement.js
+++ b/features/hud/HudTextElement.js
@@ -21,6 +21,10 @@ class HudTextElement {
this.renderElm = new HudText([""], 0, 0, true).startRender()
}
+ delete() {
+ this.renderElm.stopRender()
+ }
+
setBaseEditWidth(width) {
this.editBaseWidth = width
return this
@@ -49,6 +53,11 @@ class HudTextElement {
this.renderElm.stopRender()
}
}
+ if (this.toggleSetting.getValue()) {
+ this.renderElm.startRender()
+ } else {
+ this.renderElm.stopRender()
+ }
return this
}
setLocationSetting(setting) {
diff --git a/features/hud/index.js b/features/hud/index.js
index b7ea05a..7c679ff 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -130,6 +130,7 @@ class Hud extends Feature {
.setLocationSetting(new LocationSetting("Spotify Location", "Allows you to edit the location of the spotify text", "spotify_now_playing_location", this, [10, 80, 1, 1])
.requires(this.showSpotifyPlaying)
.editTempText("&6Spotify&7> &cNot open"))
+ this.hudElements.push(this.spotifyElement)
this.spotifyElement2 = new HudTextElement().setToggleSetting(this.showSpotifyPlaying).setLocationSetting({
setParent: () => { },
x: this.spotifyElement.locationSetting.x + this.spotifyElement.getWidth(),
@@ -197,6 +198,7 @@ class Hud extends Feature {
// .editTempText("Test Line 1\nTest line 2\nTest line 3\nTest line 4 (longer KEKW)"))
// this.hudElements.push(this.dragonDamageElement)
+
this.step_5second()
this.lastTickTime = 0
@@ -225,7 +227,7 @@ class Hud extends Feature {
this.fps = new SoopyNumber(0)
this.lowFps = new SoopyNumber(0)
- this.registerEvent("renderOverlay", this.renderHud)
+ this.registerEvent("renderOverlay", this.renderHud).registeredWhen(() => this.showSpotifyPlaying.getValue() || this.witherImpactCooldownSetting.getValue())
this.registerStep(true, 5, this.step)
this.registerStep(false, 5, this.step_5second)
this.registerEvent("renderWorld", this.renderWorld).registeredWhen(() => this.fpsEnabledSetting.getValue() && this.fpsFastSetting.getValue())
@@ -333,6 +335,9 @@ class Hud extends Feature {
this.fpsFastSetting.delete()
this.cpsEnabledSetting.delete()
+ this.hudStat.forEach(h => h.textElement.delete())
+ this.hudElements.forEach(h => h.delete())
+
this.initVariables()
if (this.packetReceived) this.packetReceived.unregister()
@@ -640,6 +645,8 @@ class Hud extends Feature {
this.hudStat.forEach(stat => {
if (stat.enabled.getValue()) {
this.updateHudThing(stat, insb)
+ } else {
+ stat.textElement.setText("")
}
})
}