summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/datas.php18
-rw-r--r--js/mapspecs.js46
-rw-r--r--js/scores.js4
3 files changed, 32 insertions, 36 deletions
diff --git a/includes/datas.php b/includes/datas.php
index de812f1..4d42c1a 100644
--- a/includes/datas.php
+++ b/includes/datas.php
@@ -690,15 +690,19 @@ function getChampionPointsArray() {
//TYPE 5
function getPerfectDayArray() {
//($required, $unlockType, $unlockValue, $unlockName, $unlockSubtype)
- //$cp[0] = array(requiredpoints, type, 'value', 'name');
+
$r[1] = array(1, UNLOCK_EXTRAS, '5', 'Insane Speed', MISC_UNLOCK_INSANE_SPEED);
- //Give 0* at the same time
$r[2] = array(5, UNLOCK_WALL_ORIENTATION, '1', '90*', 0);
- $r[3] = array(50, UNLOCK_WALL_ORIENTATION, '2', '180*', 0);
- $r[4] = array(100, UNLOCK_WALL_ORIENTATION, '3', '270*', 0);
- //These numbers temporarly unreasonable
- $r[5] = array(9275, UNLOCK_WALL_EMBLEM, 'CircleSmall_W_I.png', 'Inverted Bright Small Circle', 0);
- $r[6] = array(10000, UNLOCK_WALL_EMBLEM, 'DiamondLarge_W_I.png', 'Inverted Light Large Diamond', 0);
+
+ //TODO: Move these elsewhere
+ //$r[3] = array(1, UNLOCK_WALL_ORIENTATION, '2', '180*', 0);
+ //$r[4] = array(1, UNLOCK_WALL_ORIENTATION, '3', '270*', 0);
+
+ //Use CSS Generated gradients for background colors instead of these?
+ //$r[5] = array(1, UNLOCK_WALL_EMBLEM, 'DiagonalShade_W.png', 'Bright Diagonal Shade', 0);
+ //$r[6] = array(1, UNLOCK_WALL_EMBLEM, 'DiagonalShade_B.png', 'Dark Diagonal Shade', 0);
+ //$r[7] = array(9275, UNLOCK_WALL_EMBLEM, 'CircleSmall_W_I.png', 'Inverted Bright Small Circle', 0);
+ //$r[8] = array(10000, UNLOCK_WALL_EMBLEM, 'DiamondLarge_W_I.png', 'Inverted Light Large Diamond', 0);
return $r;
}
diff --git a/js/mapspecs.js b/js/mapspecs.js
index cf2450a..d8b4ed3 100644
--- a/js/mapspecs.js
+++ b/js/mapspecs.js
@@ -91,6 +91,16 @@ function linkEmblem(emblem, orientation) {
if (orientation == 0) return url+emblem;
return url+'rotate.php?r='+orientation+'&emblem='+emblem;
}
+function setWallStyle(playerObject) {
+
+ if (typeof playerObject !== 'object') return;
+
+ wallColor = playerObject.wallColor;
+ wallEmblem = playerObject.wallEmblem;
+ wallOrientation = playerObject.wallOrientation;
+}
+
+
function grid_click(obj) {
@@ -136,30 +146,10 @@ function grid_click(obj) {
//childdiv.removeAttribute("class");
childdiv.setAttribute("class", "child w");
- if (wallColor == false) {
- if (typeof playerWallColor === 'undefined' || playerWallColor == '') {
- wallColor = '#666666';
- playerWallColor = '#666666';
- } else {
- wallColor = playerWallColor;
- }
- }
- if (wallEmblem == false) {
- if (typeof playerWallEmblem !== 'undefined' && playerWallEmblem !== '') {
- wallEmblem = playerWallEmblem;
- }
- }
- //TODO: Copy below - above w/ userObj
- if (wallOrientation == false) {
- if (typeof userObj !== 'undefined' && userObj.wallOrientation !== '') {
- wallOrientation = userObj.wallOrientation;
- }
- }
+ if (wallColor == false) setWallStyle(userObj);
obj.style.backgroundColor = wallColor;
- if (wallEmblem !== false) {
- //obj.style.backgroundImage="url(images/marks/"+wallEmblem+")";
- //obj.style.backgroundImage="url(images/marks/rotate.php?r=1&emblem="+wallEmblem+")";
+ if (wallEmblem) {
obj.style.backgroundImage="url("+linkEmblem(wallEmblem, wallOrientation)+")";
}
@@ -774,14 +764,14 @@ function contains(a, obj) {
//Shows a solution temporarly
-function useSolution(mapid, inputSolution, moves, tempWallColor, tempWallEmblem, solutionID) {
+function useSolution(mapid, inputSolution, moves, tempWallColor, tempWallEmblem, tempWallOrientation, solutionID) {
$('.solutionSelected').removeClass('solutionSelected');
$('#solution_'+solutionID).addClass('solutionSelected');
solution[mapid] = inputSolution;
- var animateA = "showTempSolution(\""+mapid+"\", \""+inputSolution+"\", \""+moves+"\", \""+tempWallColor+"\", \""+tempWallEmblem+"\");";
- var animateB = "showTempSolution(\""+mapid+"\", \""+inputSolution+"\", \""+moves+"\", false, false);";
+ var animateA = "showTempSolution(\""+mapid+"\", \""+inputSolution+"\", \""+moves+"\", \""+tempWallColor+"\", \""+tempWallEmblem+"\", \""+tempWallOrientation+"\");";
+ var animateB = "showTempSolution(\""+mapid+"\", \""+inputSolution+"\", \""+moves+"\", false, false, false);";
//TODO: Sticky colors for the placed walls by the user would be cool.
//var animateC = "wallColor = false; wallEmblem = false;";
setTimeout(animateA, 50);
@@ -792,7 +782,7 @@ function useSolution(mapid, inputSolution, moves, tempWallColor, tempWallEmblem,
setTimeout(animateB, 550);
}
//Shows a solution for temporary use, see 'RestoreSolution'
-function showTempSolution(mapid, tempSolution, moves, tempWallColor, tempWallEmblem) {
+function showTempSolution(mapid, tempSolution, moves, tempWallColor, tempWallEmblem, tempWallOrientation) {
//console.log('showTempSolution', mapid, solution, moves, tempWallColor, tempWallEmblem);
var savedSolution = '';
@@ -801,8 +791,10 @@ function showTempSolution(mapid, tempSolution, moves, tempWallColor, tempWallEmb
if (typeof solution[mapid] !== 'undefined') {
savedSolution = solution[mapid];
}
- wallEmblem = tempWallEmblem;
+
wallColor = tempWallColor;
+ wallEmblem = tempWallEmblem;
+ wallOrientation = tempWallOrientation;
position = tempSolution.split('.');
diff --git a/js/scores.js b/js/scores.js
index 3e01ca8..9bbfedf 100644
--- a/js/scores.js
+++ b/js/scores.js
@@ -170,8 +170,8 @@ function scoresFormatPage(JO) {
if (solutionsGiven) {
rowclass += ' scoreRowSolutionAvailable';
p += "<tr class='"+rowclass+"' id='solution_"+u.solutionID+"'";
- p += "onmouseover='showTempSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\")'";
- p += "onclick='useSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\", \""+u.solutionID+"\");saveScoreLocation("+JO.page+", "+u.solutionID+");'";
+ p += "onmouseover='showTempSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\", \""+u.wallOrientation+"\")'";
+ p += "onclick='useSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\", \""+u.wallOrientation+"\", \""+u.solutionID+"\");saveScoreLocation("+JO.page+", "+u.solutionID+");'";
p += "onmouseout='restoreSolution(\""+JO.mapid+"\")' ";
p += " style='"+styleClass+";' title='Last improved "+scoredTimeStr+"'>";
} else {