From ab5cdbc799ee2780ef39c133430cf78c747465ec Mon Sep 17 00:00:00 2001 From: alterdekim Date: Tue, 9 Jul 2024 03:08:56 +0300 Subject: [PATCH] json parsing fix 4 --- src/main/resources/static/javascript/game.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/static/javascript/game.js b/src/main/resources/static/javascript/game.js index ccaf851..aa43c0d 100644 --- a/src/main/resources/static/javascript/game.js +++ b/src/main/resources/static/javascript/game.js @@ -294,35 +294,35 @@ function changeBoardState(body) { function parseBoardGUI(body) { let t_html = ''; for( let i = 0; i < body.top.length; i++ ) { - let board_tile = body.top[i]; + let board_tile = body.top[i][1]; t_html += '
'+board_tile.cost+'
'+board_tile.stars+'
'; } $("#top_board_tiles").replaceWith(t_html); let r_html = ''; for( let i = 0; i < body.right.length; i++ ) { - let board_tile = body.right[i]; + let board_tile = body.right[i][1]; r_html += '
'+board_tile.cost+'
'+board_tile.stars+'
'; } $("#right_board_tiles").replaceWith(r_html); let b_html = ''; for( let i = 0; i < body.bottom.length; i++ ) { - let board_tile = body.bottom[i]; + let board_tile = body.bottom[i][1]; b_html += '
'+board_tile.stars+'
'+board_tile.cost+'
'; } $("#bottom_board_tiles").replaceWith(b_html); let l_html = ''; for( let i = 0; i < body.left.length; i++ ) { - let board_tile = body.left[i]; + let board_tile = body.left[i][1]; l_html += '
'+board_tile.cost+'
'+board_tile.stars+'
'; } $("#left_board_tiles").replaceWith(l_html); let corners = $(".corner"); for(let i = 0; i < body.corners.length; i++ ) { - $(corners[i]).find("img").attr("src", body.corners[i].img); + $(corners[i]).find("img").attr("src", body.corners[1][i][1].img); } resizeTable(); }