aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
Diffstat (limited to 'features')
-rw-r--r--features/dungeonMap/index.js2
-rw-r--r--features/hud/HudTextElement.js45
2 files changed, 25 insertions, 22 deletions
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js
index 96683ea..0098cd1 100644
--- a/features/dungeonMap/index.js
+++ b/features/dungeonMap/index.js
@@ -660,7 +660,7 @@ class DungeonMap extends Feature {
this.playerImages[uuid]= "Loading"
new Thread(()=>{
- this.playerImages[uuid] = new Image("skull-" + uuid,"https://cravatar.eu/helmavatar/" + uuid)
+ this.playerImages[uuid] = new Image("skull-" + uuid+"-v2","https://crafatar.com/avatars/" + uuid+"?size=8")
}).start()
return this.defaultPlayerImage
}
diff --git a/features/hud/HudTextElement.js b/features/hud/HudTextElement.js
index 8177c43..2acbe67 100644
--- a/features/hud/HudTextElement.js
+++ b/features/hud/HudTextElement.js
@@ -82,28 +82,31 @@ class HudTextElement{
}
renderRaw(){
- let [text, blackText] = this.getText()
+ try{
+ let [text, blackText] = this.getText()
+
+ text.forEach((line, i)=>{
+ Renderer.scale(this.locationSetting.scale, this.locationSetting.scale)
+ switch(this.locationSetting.shadowType){
+ case 0:
+ Renderer.drawString(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ break;
+ case 1:
+ Renderer.drawStringWithShadow(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ break;
+ case 2:
+ Renderer.drawString(blackText[i], (this.locationSetting.x+1)/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ Renderer.drawString(blackText[i], (this.locationSetting.x-1)/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ Renderer.drawString(blackText[i], this.locationSetting.x/this.locationSetting.scale, (this.locationSetting.y+1)/this.locationSetting.scale +9*i)
+ Renderer.drawString(blackText[i], this.locationSetting.x/this.locationSetting.scale, (this.locationSetting.y-1)/this.locationSetting.scale +9*i)
- text.forEach((line, i)=>{
- Renderer.scale(this.locationSetting.scale, this.locationSetting.scale)
- switch(this.locationSetting.shadowType){
- case 0:
- Renderer.drawString(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- break;
- case 1:
- Renderer.drawStringWithShadow(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- break;
- case 2:
- Renderer.drawString(blackText[i], (this.locationSetting.x+1)/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- Renderer.drawString(blackText[i], (this.locationSetting.x-1)/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- Renderer.drawString(blackText[i], this.locationSetting.x/this.locationSetting.scale, (this.locationSetting.y+1)/this.locationSetting.scale +9*i)
- Renderer.drawString(blackText[i], this.locationSetting.x/this.locationSetting.scale, (this.locationSetting.y-1)/this.locationSetting.scale +9*i)
-
- Renderer.drawString(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- break;
- }
- })
- Renderer.scale(1, 1)
+ Renderer.drawString(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ break;
+ }
+ })
+ Renderer.scale(1, 1)
+ }catch(e){ //incase of wrong opengl context
+ }
}
}