summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/models/floor.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/models/floor.js')
-rw-r--r--public/assets/javascripts/rectangles/models/floor.js39
1 files changed, 37 insertions, 2 deletions
diff --git a/public/assets/javascripts/rectangles/models/floor.js b/public/assets/javascripts/rectangles/models/floor.js
index 51537f3..417494b 100644
--- a/public/assets/javascripts/rectangles/models/floor.js
+++ b/public/assets/javascripts/rectangles/models/floor.js
@@ -68,8 +68,43 @@
}
return
}
+
- if (Scenery.nextWallpaper) {
+ var offset = offsetFromPoint(e, mx.el)
+ if (! offset) { return }
+
+ var x = mx.x + mx.width * (offset.left-0.5)
+ var z = mx.z + mx.height * (0.5-offset.top)
+
+ if (Scenery.nextMedia) {
+ e.preventDefault()
+
+ var sculpture = Sculpture.addNext({
+ position: { x: x, y: 0, z: z },
+ })
+
+ // scenery was not placed
+ if (! sculpture) {
+ e.stopPropagation()
+ return
+ }
+
+ app.controller.toolbar.resetPermissions()
+ Sculpture.resize.show(sculpture)
+ Sculpture.hovering = true
+
+ // app.controller.pick(sculpture)
+
+ UndoStack.push({
+ type: 'create-sculpture',
+ undo: { id: sculpture.id },
+ redo: sculpture.serialize(),
+ })
+
+ // TODO: watch individual sculpture object here
+ Minotaur.watch( app.router.editorView.settings )
+ }
+ else if (Scenery.nextWallpaper) {
var oldState = base.serialize()
base.wallpaper(Scenery.nextWallpaper)
// Scenery.nextWallpaper = null
@@ -98,7 +133,7 @@
this.mx.reverse()
}
}
-
+
Floor.prototype.color = function(color){
this.$els.css("background-color", color)
}