-
--Hint--
+
+
+
Hint
+
+
+
{{ current + 1 }}
+
/
+
+ {{ sessionManager.hints.value.length }}
+
+
+
+
+
+
+
+ {{ sessionManager.hints.value[current] }}
+
+
+
diff --git a/app/src/library.js b/app/src/library.js
index f637869..0ae4b82 100644
--- a/app/src/library.js
+++ b/app/src/library.js
@@ -12,6 +12,7 @@ import {
faTerminal,
faArrowRotateLeft,
faArrowRightFromBracket,
+ faArrowRight,
} from '@fortawesome/free-solid-svg-icons'
import {
@@ -33,5 +34,6 @@ library.add(
faArrowRotateLeft,
faCircleRight,
faTerminal,
- faArrowRightFromBracket
+ faArrowRightFromBracket,
+ faArrowRight
)
diff --git a/app/src/utils/session.js b/app/src/utils/session.js
index 1bf5a21..ada7725 100644
--- a/app/src/utils/session.js
+++ b/app/src/utils/session.js
@@ -6,6 +6,7 @@ class SessionManager {
constructor(questId) {
this.questId = questId
this.session = ref(null)
+ this.hints = ref([])
this.graph = ref(
new FileGraph({
path: '/',
@@ -24,6 +25,7 @@ class SessionManager {
console.log('Update session:', session)
this.session.value = session
this.graph.value = new FileGraph(session.graph)
+ this.hints.value = session.hints
}
handleGraphUpdate(event) {
@@ -35,6 +37,11 @@ class SessionManager {
}
}
+ handleHintUpdate(event) {
+ console.log(event)
+ this.hints.value = [...this.hints.value, ...event]
+ }
+
setTasks(tasks) {
this.session.value.tasks = tasks
}
diff --git a/app/src/views/GamePage.vue b/app/src/views/GamePage.vue
index 27f152d..207ced4 100644
--- a/app/src/views/GamePage.vue
+++ b/app/src/views/GamePage.vue
@@ -21,6 +21,9 @@ onMounted(async () => {
socket.on('graph', (event) => {
sessionManager.handleGraphUpdate(event)
})
+ socket.on('hints', (event) => {
+ sessionManager.handleHintUpdate(event)
+ })
socket.on('tasks', (tasks) => {
sessionManager.setTasks(tasks)
})
diff --git a/packages/client/index.js b/packages/client/index.js
index e03f9ca..a732579 100644
--- a/packages/client/index.js
+++ b/packages/client/index.js
@@ -91,6 +91,10 @@ async function connect(sessionId, cookie) {
debug('receive graph:', data)
})
+ socket.on('hints', (data) => {
+ debug('receive hints:', data)
+ })
+
socket.on('tasks', (data) => {
debug('receive tasks:', data)
})