diff --git a/app/views/editor/components/main.coffee b/app/views/editor/components/main.coffee index 6210e66bd..4b0a3276d 100644 --- a/app/views/editor/components/main.coffee +++ b/app/views/editor/components/main.coffee @@ -3,6 +3,7 @@ template = require 'templates/editor/components/main' Level = require 'models/Level' LevelComponent = require 'models/LevelComponent' +LevelSystem = require 'models/LevelSystem' ComponentsCollection = require 'collections/ComponentsCollection' ComponentConfigView = require './config' @@ -157,6 +158,18 @@ module.exports = class ThangComponentEditView extends CocoView @reportChanges() onAddComponentEnterPressed: (node) => + extantSystems = + (@supermodel.getModelByOriginalAndMajorVersion LevelSystem, sn.original, sn.majorVersion).attributes.name.toLowerCase() for idx, sn of @level.get('systems') + requireSystem = node.data.system.toLowerCase() + + if requireSystem not in extantSystems + warn_element = 'Component ' + node.data.name + ' requires system ' + requireSystem + ' which is currently not specified in this level.' + noty({ + text: warn_element, + layout: 'bottomLeft', + type: 'warning' + }) + currentSelection = @addComponentsTreema?.getLastSelectedTreema()?.data._id id = node.data._id diff --git a/app/views/editor/level/component/edit.coffee b/app/views/editor/level/component/edit.coffee index d1ecea023..7571e9a80 100644 --- a/app/views/editor/level/component/edit.coffee +++ b/app/views/editor/level/component/edit.coffee @@ -34,7 +34,7 @@ module.exports = class LevelComponentEditView extends View schema = _.cloneDeep LevelComponent.schema.attributes schema.properties = _.pick schema.properties, (value, key) => key in @editableSettings schema.required = _.intersection schema.required, @editableSettings - + treemaOptions = supermodel: @supermodel schema: schema diff --git a/vendor/scripts/jquery.noty.packaged.min.js b/vendor/scripts/jquery.noty.packaged.min.js new file mode 100644 index 000000000..a304cd9c1 --- /dev/null +++ b/vendor/scripts/jquery.noty.packaged.min.js @@ -0,0 +1 @@ +"function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b}),function(a){var b={init:function(b){return this.options=a.extend({},a.noty.defaults,b),this.options.layout=this.options.custom?a.noty.layouts.inline:a.noty.layouts[this.options.layout],a.noty.themes[this.options.theme]?this.options.theme=a.noty.themes[this.options.theme]:b.themeClassName=this.options.theme,delete b.layout,delete b.theme,this.options=a.extend({},this.options,this.options.layout.options),this.options.id="noty_"+(new Date).getTime()*Math.floor(1e6*Math.random()),this.options=a.extend({},this.options,b),this._build(),this},_build:function(){var b=a('
').attr("id",this.options.id);if(b.append(this.options.template).find(".noty_text").html(this.options.text),this.$bar=null!==this.options.layout.parent.object?a(this.options.layout.parent.object).css(this.options.layout.parent.css).append(b):b,this.options.themeClassName&&this.$bar.addClass(this.options.themeClassName).addClass("noty_container_type_"+this.options.type),this.options.buttons){this.options.closeWith=[],this.options.timeout=!1;var c=a("
").addClass("noty_buttons");null!==this.options.layout.parent.object?this.$bar.find(".noty_bar").append(c):this.$bar.append(c);var d=this;a.each(this.options.buttons,function(b,c){var e=a("