From 5e92646a8518c4b4d6119c3fd1d67a346cfb7d43 Mon Sep 17 00:00:00 2001 From: armored-dragon Date: Sat, 26 Oct 2024 16:07:36 -0500 Subject: [PATCH 1/2] Fixed nametag positions. Reenabled listing. --- applications/metadata.js | 2 +- applications/nametags/nametags.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/metadata.js b/applications/metadata.js index 2398a11..6507bad 100644 --- a/applications/metadata.js +++ b/applications/metadata.js @@ -82,7 +82,7 @@ var metadata = { "applications": "caption": "REFRESH" }, { - "isActive": false, + "isActive": true, "directory": "nametags", "name": "Nametags", "description": "Display users' display names above their heads.", diff --git a/applications/nametags/nametags.js b/applications/nametags/nametags.js index 3f4a419..cdc5550 100644 --- a/applications/nametags/nametags.js +++ b/applications/nametags/nametags.js @@ -71,6 +71,7 @@ text: display_name, backgroundAlpha: 0.0, billboardMode: "full", + dimensions: { x: 0.8, y: 0.2, z: 0.1 }, unlit: true, parentID: user_uuid, position: Vec3.sum(user.position, { x: 0, y: 0.4 + jointInObjectFrame.y, z: 0 }), @@ -109,9 +110,9 @@ // https://apidocs.overte.org/Entities.html#.textSize Script.setTimeout(() => { let textSize = Entities.textSize(user_nametags[user_uuid].text, display_name); - Entities.editEntity(user_nametags[user_uuid].text, { dimensions: { x: textSize.width + 0.25, y: textSize.height - 0.05, z: 0.1 } }); + Entities.editEntity(user_nametags[user_uuid].text, { dimensions: { x: textSize.width + 0.25, y: textSize.height + 0.07, z: 0.1 } }); Entities.editEntity(user_nametags[user_uuid].background, { - dimensions: { x: Math.max(textSize.width + 0.25, 0.6), y: textSize.height - 0.05, z: 0.1 }, + dimensions: { x: Math.max(textSize.width + 0.25, 0.6), y: textSize.height+0.05, z: 0.1 }, }); }, 100); } From 4e35d25ed0d989076e1a83d424d25fbf21c25426 Mon Sep 17 00:00:00 2001 From: armored-dragon Date: Tue, 29 Oct 2024 04:13:25 -0500 Subject: [PATCH 2/2] Attempt bandage fix for nametag clipping issues. --- applications/nametags/nametags.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/nametags/nametags.js b/applications/nametags/nametags.js index cdc5550..d1b190b 100644 --- a/applications/nametags/nametags.js +++ b/applications/nametags/nametags.js @@ -112,7 +112,7 @@ let textSize = Entities.textSize(user_nametags[user_uuid].text, display_name); Entities.editEntity(user_nametags[user_uuid].text, { dimensions: { x: textSize.width + 0.25, y: textSize.height + 0.07, z: 0.1 } }); Entities.editEntity(user_nametags[user_uuid].background, { - dimensions: { x: Math.max(textSize.width + 0.25, 0.6), y: textSize.height+0.05, z: 0.1 }, + dimensions: { x: Math.max(textSize.width + 0.25, 0.6), y: textSize.height + 0.05, z: 0.1 }, }); }, 100); } @@ -139,7 +139,7 @@ const headJointIndex = user.getJointIndex("Head"); const jointInObjectFrame = user.getAbsoluteJointTranslationInObjectFrame(headJointIndex); Entities.editEntity(user_nametags[user_uuid].text, { - position: Vec3.sum(user.position, { x: 0, y: jointInObjectFrame.y + Math.abs(user.scale - 1) + 0.4, z: 0 }), + position: Vec3.sum(user.position, { x: 0.01, y: jointInObjectFrame.y + Math.abs(user.scale - 1) + 0.4, z: 0 }), text: display_name, }); });