From 3bbdee583d8678ed284bc760133fa26fd49fbae8 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 4 Aug 2014 20:16:12 -0700 Subject: [PATCH 1/5] Better problem alert layout for alerts that include hints. --- app/styles/play/level/tome/problem_alert.sass | 16 ++++++---------- app/styles/play/level/tome/spell.sass | 2 +- .../play/level/tome/ProblemAlertView.coffee | 1 + 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/styles/play/level/tome/problem_alert.sass b/app/styles/play/level/tome/problem_alert.sass index 4d503ba0f..70920356d 100644 --- a/app/styles/play/level/tome/problem_alert.sass +++ b/app/styles/play/level/tome/problem_alert.sass @@ -3,18 +3,22 @@ .problem-alert z-index: 10 position: absolute - bottom: -120px + bottom: -135px left: 10px right: 10px background: transparent border: 0 - padding: 7px 20px + padding: 0 text-shadow: none color: white word-wrap: break-word border-image: url(/images/level/code_editor_error_background.png) 16 20 fill round border-width: 16px 20px + &.no-hint + // Since it's probably only one line, let's make it not look weird by being tiny. + padding: 7px + .close @include opacity(0.80) text-shadow: none @@ -35,10 +39,6 @@ &.alert-info border-image-source: url(/images/level/code_editor_info_background.png) - - &.alert-style - // Do we ever want to do this for style? - border-image-source: url(/images/level/code_editor_info_background.png) html.no-borderimage .problem-alert @@ -53,7 +53,3 @@ html.no-borderimage &.alert-info background-image: url(/images/level/code_editor_info_background.png) - - &.alert-style - // Do we ever want to do this for style? - background-image: url(/images/level/code_editor_info_background.png) \ No newline at end of file diff --git a/app/styles/play/level/tome/spell.sass b/app/styles/play/level/tome/spell.sass index e01f63a0e..653e30709 100644 --- a/app/styles/play/level/tome/spell.sass +++ b/app/styles/play/level/tome/spell.sass @@ -62,7 +62,7 @@ overflow: visible &.user-code-problem.spell-cast - @include editor-height(40px) + @include editor-height(60px) &.disabled @include opacity(80) diff --git a/app/views/play/level/tome/ProblemAlertView.coffee b/app/views/play/level/tome/ProblemAlertView.coffee index 1756b2775..f90bab513 100644 --- a/app/views/play/level/tome/ProblemAlertView.coffee +++ b/app/views/play/level/tome/ProblemAlertView.coffee @@ -32,6 +32,7 @@ module.exports = class ProblemAlertView extends CocoView afterRender: -> super() @$el.addClass('alert').addClass("alert-#{@problem.aetherProblem.level}").hide().fadeIn('slow') + @$el.addClass('no-hint') unless @problem.aetherProblem.hint Backbone.Mediator.publish 'play-sound', trigger: 'error_appear', volume: 1.0 onRemoveClicked: -> From 30998ecbec8fb67841442c0051b5beaf80d44207 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Tue, 5 Aug 2014 13:21:45 -0700 Subject: [PATCH 2/5] Fixed components w/out changes sometimes showing up in the save level modal. --- app/views/editor/level/modals/SaveLevelModal.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/editor/level/modals/SaveLevelModal.coffee b/app/views/editor/level/modals/SaveLevelModal.coffee index 2cbf62b9c..413d285e7 100644 --- a/app/views/editor/level/modals/SaveLevelModal.coffee +++ b/app/views/editor/level/modals/SaveLevelModal.coffee @@ -24,7 +24,7 @@ module.exports = class SaveLevelModal extends SaveVersionModal context = super(context) context.level = @level context.levelNeedsSave = @level.hasLocalChanges() - context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity + window.mc = context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity context.modifiedSystems = _.filter @supermodel.getModels(LevelSystem), @shouldSaveEntity context.hasChanges = (context.levelNeedsSave or context.modifiedComponents.length or context.modifiedSystems.length) @lastContext = context @@ -47,7 +47,7 @@ module.exports = class SaveLevelModal extends SaveVersionModal shouldSaveEntity: (m) -> return false unless m.hasWriteAccess() - return true if m.hasLocalChanges() + return false unless m.hasLocalChanges() return true if (m.get('version').major is 0 and m.get('version').minor is 0) or not m.isPublished() and not m.collection # Sometimes we have two versions: one in a search collection and one with a URL. We only save changes to the latter. false From c5d496c0639d145e77ba2f3ad3fcba12213c81bb Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Tue, 5 Aug 2014 13:40:36 -0700 Subject: [PATCH 3/5] Removed a bit for debugging. --- app/views/editor/level/modals/SaveLevelModal.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/editor/level/modals/SaveLevelModal.coffee b/app/views/editor/level/modals/SaveLevelModal.coffee index 413d285e7..04c32e670 100644 --- a/app/views/editor/level/modals/SaveLevelModal.coffee +++ b/app/views/editor/level/modals/SaveLevelModal.coffee @@ -24,7 +24,7 @@ module.exports = class SaveLevelModal extends SaveVersionModal context = super(context) context.level = @level context.levelNeedsSave = @level.hasLocalChanges() - window.mc = context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity + context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity context.modifiedSystems = _.filter @supermodel.getModels(LevelSystem), @shouldSaveEntity context.hasChanges = (context.levelNeedsSave or context.modifiedComponents.length or context.modifiedSystems.length) @lastContext = context From d5a8d8dc72fa80e294e286b23245c4b621ee0379 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Tue, 5 Aug 2014 14:56:11 -0700 Subject: [PATCH 4/5] Fixed ComponentDocsView's components collection overwriting data for other level editor data. Related to #1108. --- app/views/editor/level/LevelEditView.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/editor/level/LevelEditView.coffee b/app/views/editor/level/LevelEditView.coffee index 8844cc61d..a8b651192 100644 --- a/app/views/editor/level/LevelEditView.coffee +++ b/app/views/editor/level/LevelEditView.coffee @@ -74,7 +74,7 @@ module.exports = class LevelEditView extends RootView @insertSubView new ScriptsTabView world: @world, supermodel: @supermodel, files: @files @insertSubView new ComponentsTabView supermodel: @supermodel @insertSubView new SystemsTabView supermodel: @supermodel - @insertSubView new ComponentDocsView supermodel: @supermodel + @insertSubView new ComponentDocsView() Backbone.Mediator.publish 'level-loaded', level: @level @showReadOnly() if me.get('anonymous') From eceac0bbc9c06ed5692f07187058b0fe7584f360 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Tue, 5 Aug 2014 15:06:11 -0700 Subject: [PATCH 5/5] Hiding the randomize button overlay until #1409 is handled. --- app/styles/editor/level/thangs_tab.sass | 1 + 1 file changed, 1 insertion(+) diff --git a/app/styles/editor/level/thangs_tab.sass b/app/styles/editor/level/thangs_tab.sass index ac5509f64..0bbf859e1 100644 --- a/app/styles/editor/level/thangs_tab.sass +++ b/app/styles/editor/level/thangs_tab.sass @@ -212,6 +212,7 @@ $mobile: 1050px position: relative #canvas-overlay + display: none position: absolute width: 100% height: 100%