From 1c73d4ecb06a2452bb3b3487b2e9ae48bf85e1ac Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Mon, 12 Dec 2022 09:32:14 +0100 Subject: [PATCH] Friends list and message displayed in 3D/XR --- index.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 30ee9c5..addd705 100644 --- a/index.html +++ b/index.html @@ -266,8 +266,20 @@ setTimeout( _ => { immersClient = document.querySelector("immers-hud").immersClient console.log(immersClient.profile.displayName, "connected") //addNewNote(immersClient.profile.displayName+ " connected") + immersClient.addEventListener("immers-client-new-message", e => addNewNote(e.detail.message.messageHTML) ) + + immersClient.friendsList().then( r => { + if (r.length>0) addNewNote( "Friends:", "-1 1.65 -0.5") + r.map( (u,i) => { + let friendData = u.profile.displayName + if (u.locationName) friendData += " at " + u.locationName + if (u.locationURL) friendData += " (" + u.locationURL + " )" + addNewNote( friendData, "-1 " + (1.6-i/20) + " -0.5") // should make this interpretable to join there + } ) + } ) }) -}, 1000) +}, 1000) // unsure when it will be loaded + /* not sure what's the right way... but timeout works, others don't. document.addEventListener("immers-client-connected", _ => console.log("connected")) window.addEventListener("immers-client-connected", _ => console.log("connected"))