Drop old purchase views and models

This commit is contained in:
Eden Kirin
2023-05-10 15:49:08 +02:00
parent 24d05dc234
commit 69e087c0c9
8 changed files with 79 additions and 127 deletions

View File

@ -96,6 +96,17 @@ function renderGameDump(data) {
renderPlayers(data.players);
}
function playerReachedDestination(data) {
console.log(data);
const dlgElement = document.getElementById("player-on-destination-modal");
dlgElement.querySelector(".player-name").textContent = data.player.name;
dlgElement.querySelector(".move-count").textContent = data.player.move_count;
const modal = new bootstrap.Modal(dlgElement);
modal.show();
}
function productPurchaseStart(products, purchaseTimeout) {
console.log("productPurchaseStart:", products);
const containerElement = document.getElementById("purchase-container");
@ -149,6 +160,9 @@ function wsConnect() {
case "game_dump":
renderGameDump(wsMessage.data);
break;
case "player_on_destination":
playerReachedDestination(wsMessage.data);
break;
case "product_purchase_start":
productPurchaseStart(wsMessage.data.products, wsMessage.data.timeout);
break;