A few bugfixes, plus gigantic child window convenience for me editing levels.

This commit is contained in:
Nick Winter 2014-07-19 20:26:13 -07:00
parent d45c2d31de
commit 1537754a16
4 changed files with 8 additions and 2 deletions
app
lib
views
editor/level
play/level/tome

View file

@ -213,6 +213,8 @@ module.exports = class Angel extends CocoClass
work.t1 = now()
Math.random = work.testWorld.rand.randf # so user code is predictable
Aether.replaceBuiltin('Math', Math)
replacedLoDash = _.runInContext(window)
_[key] = replacedLoDash[key] for key, val of replacedLoDash
i = 0
while i < work.testWorld.totalFrames
frame = work.testWorld.getFrame i++

View file

@ -94,7 +94,10 @@ module.exports = class EditorLevelView extends RootView
# Create a new Window with a blank LevelView
scratchLevelID = @level.get('slug') + '?dev=true'
scratchLevelID += "&team=#{team}" if team
@childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=1024,height=560,left=10,top=10,location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0', true)
if me.get('name') is 'Nick!'
@childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=2560,height=1080,left=0,top=-1600,location=1,menubar=1,scrollbars=1,status=0,titlebar=1,toolbar=1', true)
else
@childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=1024,height=560,left=10,top=10,location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0', true)
@childWindow.onPlayLevelViewLoaded = (e) => sendLevel() # still a hack
@childWindow.focus()

View file

@ -90,6 +90,7 @@ module.exports = class Spell
problems = spellThang.aether.problems
#console.log 'aether transpiled', source.length, 'to', spellThang.aether.pure.length, 'for', thangID, @spellKey
else
spellThang.aether.raw = source
spellThang.aether.pure = pure
spellThang.aether.problems = problems
#console.log 'aether reused transpilation for', thangID, @spellKey

View file

@ -396,7 +396,7 @@ module.exports = class SpellView extends CocoView
displayAether: (aether, isCast=false) ->
@displayedAether = aether
isCast = isCast or not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'}
isCast = isCast or not _.isEmpty(aether.metrics) or _.some aether.getAllProblems(), {type: 'runtime'}
problem.destroy() for problem in @problems # Just in case another problem was added since clearAetherDisplay() ran.
@problems = []
annotations = []