Endgame WS messages & docs

This commit is contained in:
Eden Kirin
2023-05-11 19:36:16 +02:00
parent 76ee207bce
commit d660845d30
6 changed files with 47 additions and 115 deletions

View File

@ -22,9 +22,6 @@
<h1 class="mt-1 mb-2">
FairHopper Visualisation Client
</h1>
<button type="button" class="btn btn-primary test-button">
Launch demo modal
</button>
<div id="purchase-container" class="purchase-container d-none">
<div class="d-flex header">
<h3>
@ -68,18 +65,6 @@
</div>
</div>
</div>
<script>
document.querySelector(".test-button").onclick = () => {
playerReachedDestination({
player: {
name: "Pero Perić",
move_count: 123,
}
});
}
</script>
</body>
</html>

View File

@ -104,6 +104,10 @@ function playerReachedDestination(data) {
playerOnDestinationModal.show();
}
function productSelectionTimeout() {
playerOnDestinationModal.hide();
}
function productSelectionDone() {
playerOnDestinationModal.hide();
}
@ -127,6 +131,9 @@ function wsConnect() {
case "player_reached_destination":
playerReachedDestination(wsMessage.data);
break;
case "product_selection_timeout":
productSelectionTimeout();
break;
case "product_selection_done":
productSelectionDone();
break;