summaryrefslogtreecommitdiff
path: root/public/js/components/player-info.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/components/player-info.js')
-rw-r--r--public/js/components/player-info.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/public/js/components/player-info.js b/public/js/components/player-info.js
new file mode 100644
index 0000000..6110756
--- /dev/null
+++ b/public/js/components/player-info.js
@@ -0,0 +1,16 @@
+/* global AFRAME */
+// Who someone is. Lives on each person's rig and is synced by Networked-A-Frame,
+// so remote copies fire 'player-info-changed' whenever the owner updates it.
+AFRAME.registerComponent('player-info', {
+ schema: {
+ name: { default: '' },
+ color: { type: 'color', default: '#ffb36b' },
+ avatar: { default: '' },
+ muted: { default: false },
+ seat: { type: 'int', default: -1 }, // index into the campsite's seats, or -1 standing
+ },
+
+ update() {
+ this.el.emit('player-info-changed', this.data, false);
+ },
+});