diff --git a/client/public/scrabble/game.js b/client/public/scrabble/game.js
index a81ff90..d48e7ac 100644
--- a/client/public/scrabble/game.js
+++ b/client/public/scrabble/game.js
@@ -15,10 +15,22 @@ function initGame(boardstate, tileset, myplayer, players)
let drawerStructure = [];
for (const tile of myplayer.activetiles)
{
+
+ let points = 0;
+ // for (const pointband of tileset)
+ // {
+ // console.log(pointband)
+ // }
+
+ const piece = {
+ letter: tile,
+ score: points
+ }
+ drawerStructure.push(piece);
console.log(tile);
}
- addPiecesToDrawer();
+ addPiecesToDrawer(drawerStructure);
return true;
}
diff --git a/client/public/scrabble/index.html b/client/public/scrabble/index.html
index f34132d..c102649 100644
--- a/client/public/scrabble/index.html
+++ b/client/public/scrabble/index.html
@@ -294,13 +294,13 @@
diff --git a/client/public/scrabble/network.js b/client/public/scrabble/network.js
index 39b7cfa..fb452a9 100644
--- a/client/public/scrabble/network.js
+++ b/client/public/scrabble/network.js
@@ -39,7 +39,8 @@ function onIdentify(socket, args)
{
socket.disconnect();
ConnectionState.innerHTML = 'Identify cannot proceed, no user';
- document.location.href += '../';
+ document.qu
+ window.location = `/`;
return;
}
@@ -51,7 +52,7 @@ function onIdentify(socket, args)
{
socket.disconnect();
ConnectionState.innerHTML = 'Identify cannot proceed, corrupted user';
- document.location.href += '../';
+ window.location = `/`;
return;
}
@@ -59,7 +60,7 @@ function onIdentify(socket, args)
{
socket.disconnect();
ConnectionState.innerHTML = 'Identify cannot proceed, corrupted user';
- document.location.href += '../';
+ window.location = `/`;
return;
}
@@ -69,7 +70,7 @@ function onIdentify(socket, args)
{
socket.disconnect();
ConnectionState.innerHTML = 'Identify cannot proceed, corrupted lobby';
- document.location.href += '../';
+ window.location = `/`;
return;
}
diff --git a/client/public/scrabble/pieces.js b/client/public/scrabble/pieces.js
index 3427473..04406a6 100644
--- a/client/public/scrabble/pieces.js
+++ b/client/public/scrabble/pieces.js
@@ -28,18 +28,21 @@ TILE OBJECT
*/
let PiecesDrawer = [];
+// Expects structure [{letter: '', score: int}]
// Returns array of tile IDs that were added
function addPiecesToDrawer(pieces)
{
- const piece = document.createElement('piece');
- piece.innerText = 'A';
- piece.classList.add('unselectable');
- piece.classList.add('unplayed-piece');
- const score = document.createElement('score');
- score.innerText = '2';
- piece.appendChild(score);
- Drawer.appendChild(piece);
-
+ for (const piece of pieces)
+ {
+ const domPiece = document.createElement('piece');
+ domPiece.innerText = piece.letter;
+ domPiece.classList.add('unselectable');
+ domPiece.classList.add('unplayed-piece');
+ const score = document.createElement('score');
+ score.innerText = piece.score;
+ domPiece.appendChild(score);
+ Drawer.appendChild(domPiece);
+ }
setupPieces();
updatePieceEventListeners();
}