aboutsummaryrefslogtreecommitdiff
path: root/features/dungeonMap
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-07-07 10:56:41 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-07-07 10:56:41 +0800
commit2e85c8dd13084bc1aefe7328e56268a67b6ed7a3 (patch)
tree31cf353de3daa6e297666aea89fc93642539c0a6 /features/dungeonMap
parentf1c7bae88a2ccd42689b1c989b0bc8bc9aed774b (diff)
downloadSoopyV2-2e85c8dd13084bc1aefe7328e56268a67b6ed7a3.tar.gz
SoopyV2-2e85c8dd13084bc1aefe7328e56268a67b6ed7a3.tar.bz2
SoopyV2-2e85c8dd13084bc1aefe7328e56268a67b6ed7a3.zip
+ fix not loading class in spirit leap menu for players with long usernames
Diffstat (limited to 'features/dungeonMap')
-rw-r--r--features/dungeonMap/index.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js
index 71429ea..64faabc 100644
--- a/features/dungeonMap/index.js
+++ b/features/dungeonMap/index.js
@@ -843,14 +843,25 @@ class SpiritLeapOverlay {
this.buttonsContainer.clearChildren()
Object.keys(this.items).forEach((name, i) => {
- let button = new ButtonWithArrow().setText((ChatLib.removeFormatting(name) === this.parent.lastDoorOpener ? "&4" : "&2") + "[" + (this.players[ChatLib.removeFormatting(name)] || "?") + "] " + ChatLib.removeFormatting(name)).addEvent(new SoopyMouseClickEvent().setHandler(() => {
+
+ let name2 = ChatLib.removeFormatting(name)
+ let pClass = (this.players[name2] || "?")
+ if (pClass === "?") {
+ Object.keys(this.players).forEach(n => {
+ if (name2.startsWith(n)) {
+ pClass = this.players[n]
+ }
+ })
+ }
+
+ let button = new ButtonWithArrow().setText((name2 === this.parent.lastDoorOpener ? "&4" : "&2") + "[" + pClass + "] " + name2).addEvent(new SoopyMouseClickEvent().setHandler(() => {
Player.getContainer().click(itemsNew[name])
ChatLib.chat("Leaping to " + name)
})).setLocation((i % 2) * 0.5, Math.floor(i / 2) * 0.5, 0.5, 0.5)
button.text.setLocation(0.5, 0, 0.4, 1)
button.addEvent(new SoopyRenderEvent().setHandler(() => {
- if (!this.parent.nameToUUID[ChatLib.removeFormatting(name).toLowerCase()]) return
- let img = this.parent.getImageForPlayer(this.parent.nameToUUID[ChatLib.removeFormatting(name).toLowerCase()])
+ if (!this.parent.nameToUUID[name2.toLowerCase()]) return
+ let img = this.parent.getImageForPlayer(this.parent.nameToUUID[name2.toLowerCase()])
if (!img) return