diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-01-14 15:09:02 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-01-14 15:09:02 +0800 |
commit | 4fd8b9502464c8c588221d175eb1d3bbf770dce2 (patch) | |
tree | 4da7c04188d5e1cf8596c55244fbd8fcca63878e /features/hud | |
parent | 40e2170876141da9b3739ed60fb5b90ff067e1c6 (diff) | |
download | SoopyV2-4fd8b9502464c8c588221d175eb1d3bbf770dce2.tar.gz SoopyV2-4fd8b9502464c8c588221d175eb1d3bbf770dce2.tar.bz2 SoopyV2-4fd8b9502464c8c588221d175eb1d3bbf770dce2.zip |
add exp/hour, runs/hour and average time per run (including downtime inbetween)
Diffstat (limited to 'features/hud')
-rw-r--r-- | features/hud/HudTextElement.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/features/hud/HudTextElement.js b/features/hud/HudTextElement.js index b56b350..5599b5c 100644 --- a/features/hud/HudTextElement.js +++ b/features/hud/HudTextElement.js @@ -16,7 +16,7 @@ class HudTextElement{ setText(text){ this.text = text - if(this.locationSetting.shadowType === 2){ + if(this.locationSetting && this.locationSetting.shadowType === 2){ this.blackText = "&0" + ChatLib.removeFormatting(text) } return this @@ -28,6 +28,10 @@ class HudTextElement{ setLocationSetting(setting){ this.locationSetting = setting setting.setParent(this) + + if(this.locationSetting.shadowType === 2){ + this.blackText = "&0" + ChatLib.removeFormatting(text) + } return this } @@ -38,6 +42,13 @@ class HudTextElement{ this.renderRaw() } + getWidth(){ + return Math.max(...(this.getText()[0].map(a=>Renderer.getStringWidth(ChatLib.removeFormatting(a))))) + } + getHeight(){ + return 9*this.getText()[0].length + } + getText(){ let text = this.text let blackText = this.blackText |