From c5175d4a06c993ff7f42c16178b6d4db49b7387e Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Mon, 18 Mar 2013 01:32:14 -0700 Subject: Wall orientation achievements - huge commit. --- js/mapspecs.js | 19 ++++++++++++++++++- js/scores.js | 13 +++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) (limited to 'js') diff --git a/js/mapspecs.js b/js/mapspecs.js index 5a124b1..cf2450a 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -21,6 +21,7 @@ else if (document.attachEvent) { // IE 8- var wallColor = false; var wallEmblem = false; +var wallOrientation = 0; var isChallenge = false; var isTutorial = false; @@ -84,6 +85,13 @@ function changeWallEmblem(newEmblem) { loadSol(null); } +function linkEmblem(emblem, orientation) { + orientation = orientation - 0; + var url = 'images/marks/'; + if (orientation == 0) return url+emblem; + return url+'rotate.php?r='+orientation+'&emblem='+emblem; +} + function grid_click(obj) { //Prepare data @@ -141,9 +149,18 @@ function grid_click(obj) { wallEmblem = playerWallEmblem; } } + //TODO: Copy below - above w/ userObj + if (wallOrientation == false) { + if (typeof userObj !== 'undefined' && userObj.wallOrientation !== '') { + wallOrientation = userObj.wallOrientation; + } + } + obj.style.backgroundColor = wallColor; if (wallEmblem !== false) { - obj.style.backgroundImage="url(images/marks/"+wallEmblem+")"; + //obj.style.backgroundImage="url(images/marks/"+wallEmblem+")"; + //obj.style.backgroundImage="url(images/marks/rotate.php?r=1&emblem="+wallEmblem+")"; + obj.style.backgroundImage="url("+linkEmblem(wallEmblem, wallOrientation)+")"; } //Add Wall diff --git a/js/scores.js b/js/scores.js index 0e81213..3e01ca8 100644 --- a/js/scores.js +++ b/js/scores.js @@ -188,7 +188,7 @@ function scoresFormatPage(JO) { } p = p+ i+ ""; p = p+ ""; - p = p+ "
"; + p = p+ "
"; p = p+ "
"; p = p+ "
"; p = p+ "
"; @@ -443,19 +443,20 @@ function membersFormatPage(JO) { var styleClass = ''; - if (previousI != i + 1) - if (previousI < i - 1 && previousI != 0) + if (previousI != i + 1) { + if (previousI < i - 1 && previousI != 0) { styleClass = 'border-top: 6px solid #777799;'; + } + } - if (u.wallEmblem == undefined) - u.wallEmblem = 'blank.png'; + if (u.wallEmblem == undefined) u.wallEmblem = 'blank.png'; p = p+ ""; p = p+ ""; p = p+ i+ ""; p = p+ ""; - p = p+ "
"; + p = p+ "
"; p = p+ "
"; p = p+ "
"; p = p+ "
"; -- cgit v1.2.3