diff --git a/truthseeker/static/js/game.js b/truthseeker/static/js/game.js index 2de9b05..611bae2 100644 --- a/truthseeker/static/js/game.js +++ b/truthseeker/static/js/game.js @@ -16,6 +16,15 @@ function hideEmotionAndCulpritChoices(){ document.getElementsByClassName("emotion_and_culprit_choices")[0].classList.add("hidden"); } +function setListenerToInterrogationNextBtn(){ + document.getElementById("interrogation_next_btn").addEventListener("click", showInterogationView) +} + +function showInterogationView(){ + hideInterogation(); + showEmotionAndCulpritChoices(); +} + function renderAnswerSelectionPanel() { npcs_ids.forEach(element => { console.log(element); @@ -89,6 +98,7 @@ async function initGame(){ //initSock(); renderAnswerSelectionPanel(); renderInterogation(); + setListenerToInterrogationNextBtn(); showInterogation(); } diff --git a/truthseeker/static/js/game_start_page.js b/truthseeker/static/js/game_start_page.js index a57470d..11d58a0 100644 --- a/truthseeker/static/js/game_start_page.js +++ b/truthseeker/static/js/game_start_page.js @@ -108,16 +108,6 @@ function areInputsValid(checkRoomCode) { return true; } -function startSoloGame() { - if (!areInputsValid(false)) { - return; - } - - hideInvalidInputErrorMessage(); - - //TODO: code to start solo game -} - function createMultiPlayerRoom() { if (!areInputsValid(false)) { return; @@ -209,6 +199,13 @@ function changeTheme() { } async function startSoloGame(){ + + if (!areInputsValid(false)) { + return; + } + + hideInvalidInputErrorMessage(); + username = document.getElementById("game_username").value; let data = {} data["username"] = username;