diff options
author | BlueRaja <BlueRaja.admin@gmail.com> | 2013-03-19 03:26:48 -0500 |
---|---|---|
committer | BlueRaja <BlueRaja.admin@gmail.com> | 2013-03-19 03:26:48 -0500 |
commit | b6680dd405fdf6cd2784facfe799742cfaf805ab (patch) | |
tree | e9cd81aebfc67c76053792583efb0a1fe942ff6c /js | |
parent | a600bd24aa5272dfd3b9f178ef9e2c81ec0525b9 (diff) | |
parent | bc57b007dfa5e6e723946143671a9db68a82f348 (diff) | |
download | pathery-b6680dd405fdf6cd2784facfe799742cfaf805ab.tar.xz |
Merge branch 'master' of git.raylu.net:pathery
Conflicts:
globe.php
pages/login.php
Diffstat (limited to 'js')
-rw-r--r-- | js/mapspecs.js | 30 | ||||
-rw-r--r-- | js/scores.js | 13 |
2 files changed, 28 insertions, 15 deletions
diff --git a/js/mapspecs.js b/js/mapspecs.js index 688c9dc..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
@@ -852,17 +869,12 @@ function mapAsHTML(map, targetWidth, mapEditor) { //console.log("MapObj", map);
mapdata[map.ID] = map;
+ //Map bigger than target width?
if (!targetWidth || (map.width * 35) <= targetWidth)
{
+ //Use standard size.
targetWidth = (map.width * 35);
}
- else
- {
- //Need to take into account padding of .grid_outer
- var fakeGridDom = $('<div class="grid_outer"></div>');
- var gridOuterPadding = parseInt(fakeGridDom.css('padding-left')) + parseInt(fakeGridDom.css('padding-right'));
- targetWidth -= gridOuterPadding;
- }
var scale = map.width / targetWidth;
//alert(scale);
@@ -1018,7 +1030,7 @@ function getSpeedOptions(mapID) { listObj[2] = 'Med';
listObj[3] = 'Fast';
listObj[4] = 'Ultra';
- listObj[5] = 'Insane';
+ if (userObj.hasInsaneSpeed) listObj[5] = 'Insane';
var r = '';
r += " <select onChange='savePref(\"speed\", this.value)' id='"+mapID+",speed'>";
for (var i in listObj) {
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+ "</td>";
p = p+ "<td style='vertical-align: middle;'>";
- p = p+ " <div class='grid_td' style='float:left; width:35px; height:35px; background:"+u.wallColor+" url(images/marks/"+u.wallEmblem+");'>";
+ p = p+ " <div class='grid_td' style='float:left; width:35px; height:35px; background:"+u.wallColor+" url("+linkEmblem(u.wallEmblem, u.wallOrientation)+");'>";
p = p+ " <div style='background-color:transparent;' class='grid_td_inner grid_td_rocks'>";
p = p+ " </div>";
p = p+ " </div>";
@@ -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+ "<tr style='"+styleClass+" background-color: "+u.background+"; color:"+u.displayColor+";' title=''>";
p = p+ "<td style='text-align:left;'>";
p = p+ i+ "</td>";
p = p+ "<td style='vertical-align: middle;width:180px;'>";
- p = p+ " <div class='grid_td' style='float:left; width:35px; height:35px; background:"+u.wallColor+" url(images/marks/"+u.wallEmblem+");'>";
+ p = p+ " <div class='grid_td' style='float:left; width:35px; height:35px; background:"+u.wallColor+" url("+linkEmblem(u.wallEmblem, u.wallOrientation)+");'>";
p = p+ " <div style='background-color:transparent;' class='grid_td_inner grid_td_rocks'>";
p = p+ " </div>";
p = p+ " </div>";
|