diff options
author | BlueRaja <BlueRaja.admin@gmail.com> | 2013-03-07 03:00:04 -0600 |
---|---|---|
committer | BlueRaja <BlueRaja.admin@gmail.com> | 2013-03-07 03:00:04 -0600 |
commit | 534566ca37d8da800188b073652003671fc9671a (patch) | |
tree | cd14d9353d19a365a80b519a21feeefe9152efcd /js/mapspecs.js | |
parent | ef912adeeac6be3d623d602ce17f69b15ce65aa8 (diff) | |
parent | ee270d30697914e322dd1256e2e3e0b60df0ced5 (diff) | |
download | pathery-534566ca37d8da800188b073652003671fc9671a.tar.xz |
Merge branch 'master' of git.raylu.net:pathery
Conflicts:
includes/db.inc.php
Diffstat (limited to 'js/mapspecs.js')
-rw-r--r-- | js/mapspecs.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/js/mapspecs.js b/js/mapspecs.js index 2387a00..ecc5c9d 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -92,6 +92,12 @@ function grid_click(obj) { y = tmp[1];
x = tmp[2];
+
+ if(typeof(mapdata[mapid]) == 'Object' && mapdata[mapid].editMap == true) {
+ mapClick(obj);
+ return;
+ }
+
//The users solution - prepare it if it's not started
if (solution[mapid] == undefined) {
getmapdata(mapid);
@@ -838,7 +844,7 @@ var Tile = { "x" : "Single-Path-Rock"};
//Map as object. If target width is NULL or False, default width is used.
-function mapAsHTML(map, targetWidth, demo) {
+function mapAsHTML(map, targetWidth, mapEditor) {
map.mapid = map.ID;
//console.log("MapID:", map.mapid);
@@ -872,9 +878,9 @@ function mapAsHTML(map, targetWidth, demo) { // GOAL WOULD BE THIS LINE INSTEAD.. As it's not retarded.
//var idHandle = map.ID+','+x+','+y;
-
+
//oldy is used for Position too... for now
- if (type == 'o') {
+ if (type == 'o' || mapEditor == true) {
mapgrid += "<div style='float:left; width:"+tileWidth+"px; height:"+tileWidth+"px; ' class='mapcell "+type+value+"' title='Position: "+x+","+oldy+"' id='"+idHandle+"' onClick='grid_click(this)' >";
mapgrid += "<div id='child_"+idHandle+"' class='child'></div></div>";
} else {
@@ -885,6 +891,8 @@ function mapAsHTML(map, targetWidth, demo) { }
mapgrid += '</div>';
+ if (mapEditor == true) return mapgrid;
+
var r = '';
//TODO: Track down where that 1 pixel is comingfrom, width-1 is a hack.
|