|
|
@ -12,15 +12,21 @@ function updateAvatar () {
|
|
|
|
var avatar=fd.get("player_avatar")
|
|
|
|
var avatar=fd.get("player_avatar")
|
|
|
|
console.log("avatar", avatar);
|
|
|
|
console.log("avatar", avatar);
|
|
|
|
localStorage.myavatar=avatar;
|
|
|
|
localStorage.myavatar=avatar;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// store username in local storage + make sure the player added it
|
|
|
|
|
|
|
|
|
|
|
|
// store username in local storage + make sure the player added their preferences, if yes it redirect to the following page
|
|
|
|
|
|
|
|
|
|
|
|
function storeName(){
|
|
|
|
function storeName(){
|
|
|
|
var inputPlayer = document.querySelector('#player_name').value;
|
|
|
|
var inputPlayer = document.querySelector('#player_name').value;
|
|
|
|
localStorage.playerName=inputPlayer;
|
|
|
|
localStorage.playerName=inputPlayer;
|
|
|
|
if( document.querySelector('#player_name').value === '' ){
|
|
|
|
|
|
|
|
alert('empty');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (document.querySelector('#player_name').value === '') {
|
|
|
|
|
|
|
|
alert('Please make sure you declared your preferences');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
window.location.href = "0_start.html";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|