summaryrefslogtreecommitdiffstats
path: root/js/mapspecs.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/mapspecs.js')
-rw-r--r--js/mapspecs.js14
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.