replaced buttons fixed restart

This commit is contained in:
Garrett Finucane 2015-03-09 17:32:59 -04:00
parent 13c51e1aae
commit dd310aeaba
5 changed files with 18 additions and 23 deletions

View file

@ -82,7 +82,7 @@
</div>
<div id="openSideBar" class = 'helpText'><i class="fa fa-info-circle fa-lg"></i> <i class="fa fa-arrow-left"><b> Help</b></i></div>
<div class="faded overlay"></div>
<div id = 'pauseBtn'><div id = 'pauseBtnInner'><i class="fa fa-pause fa-2x"></i></div></div>
<div id = 'pauseBtn'><div id = 'pauseBtnInner'><img src="./images/btn_pause.svg" /></div></div>
<div id = 'restartBtn'><div id = 'restartBtnInner'><i class="fa fa-refresh fa-2x"></i></div></div>
<div id="bottombar">
<div style="bottom:4px; padding-right:4px;" class="fb-like" data-href="http://hextris.github.io/hextris" data-width="20" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>

View file

@ -66,7 +66,7 @@ function addKeyListeners() {
keys: "enter",
on_keydown: function() {
if (gameState==2 || gameState==1 || importing == 1) {
init(1);
init();
}
if (gameState===0) {
resumeGame();
@ -115,13 +115,13 @@ function addKeyListeners() {
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
$("#restartBtn").on('touchstart', function() {
init(1);
init();
canRestart = false;
});
}
else {
$("#restartBtn").on('mousedown', function() {
init(1);
init();
canRestart = false;
});
}
@ -174,7 +174,7 @@ function handleClickTap(x,y) {
}
else{
if (gameState != 1) {
init(1);
init();
}
}
return;
@ -192,7 +192,7 @@ function handleClickTap(x,y) {
resumeGame();
}
else {
init(1);
init();
}
}
@ -204,7 +204,7 @@ function handleClickTap(x,y) {
resumeGame();
}
else {
init(1);
init();
}
}
MainHex.rotate(-1);

View file

@ -66,7 +66,7 @@ function hideUIElements() {
}
function init(b) {
if(settings.ending_block==true && b == 1){return;}
if(settings.ending_block && b == 1){return;}
if (b) {
hidebottombar();
@ -83,7 +83,7 @@ function init(b) {
}
infobuttonfading = true;
$("#pauseBtnInner").html('<i class="fa fa-pause fa-2x"></i>');
$("#pauseBtnInner").html('<img src="./images/btn_pause.svg">');
hideUIElements();
var saveState = localStorage.getItem("saveState") || "{}";
saveState = JSONfn.parse(saveState);
@ -331,7 +331,7 @@ function showHelp() {
pause();
}
if($($("#pauseBtnInner").children()[0]).hasClass("fa-pause") && gameState != 0 && !infobuttonfading) {
if($("#pauseBtnInner").children()[0].src.replace(/^.*[\\\/]/, '') == "btn_pause.svg" && gameState != 0 && !infobuttonfading) {
return;
}

View file

@ -110,7 +110,7 @@ function showText(text) {
}
if (text == 'gameover') {
Clay('client.share.any', {text: 'Think you can beat my score of '+ score + ' in Super Cool Game?'})
//Clay('client.share.any', {text: 'Think you can beat my score of '+ score + ' in Super Cool Game?'})
var allZ = 1;
var i;
@ -155,10 +155,10 @@ function setMainMenu() {
canRestart = 's';
}, 500);
$('#restartBtn').hide();
if ($($("#pauseBtn").children()[0]).attr('class').indexOf('pause') == -1) {
$("#pauseBtnInner").html('<i class="fa fa-pause fa-2x"></i>');
if ($($("#pauseBtn").children()[0]).replace(/^.*[\\\/]/, '') == "btn_pause.svg") {
$("#pauseBtnInner").html('<img src="./images/btn_pause.svg" />');
} else {
$("#pauseBtnInner").html('<i class="fa fa-play fa-2x"></i>');
$("#pauseBtnInner").html('<img src="./images/btn_resume.svg" />');
}
}
@ -230,7 +230,7 @@ function pause(o) {
$('#helpScreen').fadeOut(150, "linear");
}
$("#pauseBtnInner").html('<i class="fa fa-pause fa-2x"></i>');
$("#pauseBtnInner").html('<img src="./images/btn_resume.svg" />');
$('.helpText').fadeOut(200, 'linear');
hideText();
hidebottombar();
@ -245,7 +245,7 @@ function pause(o) {
showText(message);
}
$("#pauseBtnInner").html('<i class="fa fa-play fa-2x"></i>');
$("#pauseBtnInner").html('<img src="./images/btn_resume.svg" />');
prevGameState = gameState;
gameState = -1;
}

View file

@ -83,10 +83,10 @@ button:focus {
#pauseBtn {
position: absolute;
margin-bottom: 3px;
margin-bottom: 20px;
width:60px;
height:60px;
margin-right: 7px;
margin-right: 25px;
z-index: 3000;
color:#232323;
cursor:pointer;
@ -96,11 +96,6 @@ button:focus {
z-index:99;
}
#pauseBtnInner {
margin-left:35px;
margin-top:28px;
}
#restartBtnInner {
margin-top:28px;
}