diff options
author | Valerio Virgillito | 2012-07-09 14:35:44 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-07-09 14:35:44 -0700 |
commit | 84b3327bd92faafab7954b5eb64c7abe24a3fe13 (patch) | |
tree | 3f56cbed2f08c5a81ea79eaf0bcb9bd031d8a627 /js/panels/Materials/materials-popup.reel/materials-popup.js | |
parent | c0a42c56f768a873ba637f5b86d5f6a84d4a3312 (diff) | |
parent | 40c6eb2c06b34f65a74d59ef9687251952858bab (diff) | |
download | ninja-84b3327bd92faafab7954b5eb64c7abe24a3fe13.tar.gz |
Merge branch 'normalize' of https://github.com/kriskowal/ninja-internal
Conflicts:
js/components/gradientpicker.reel/gradientpicker.js
js/components/tools-properties/text-properties.reel/text-properties.js
js/document/views/base.js
js/document/views/design.js
js/helper-classes/3D/StageLine.js
js/helper-classes/3D/draw-utils.js
js/lib/drawing/world.js
js/lib/geom/circle.js
js/lib/geom/line.js
js/lib/geom/rectangle.js
js/lib/geom/shape-primitive.js
js/lib/rdge/materials/bump-metal-material.js
js/lib/rdge/materials/flag-material.js
js/lib/rdge/materials/fly-material.js
js/lib/rdge/materials/julia-material.js
js/lib/rdge/materials/keleidoscope-material.js
js/lib/rdge/materials/mandel-material.js
js/lib/rdge/materials/material.js
js/lib/rdge/materials/plasma-material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/radial-gradient-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/water-material.js
js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
js/panels/Materials/materials-popup.reel/materials-popup.html
js/panels/Materials/materials-popup.reel/materials-popup.js
js/tools/LineTool.js
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/panels/Materials/materials-popup.reel/materials-popup.js')
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.js | 724 |
1 files changed, 362 insertions, 362 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index 0d0435a4..501df282 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js | |||
@@ -79,25 +79,25 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
79 | serializable: true | 79 | serializable: true |
80 | }, | 80 | }, |
81 | 81 | ||
82 | // Material Properties | 82 | // Material Properties |
83 | _materialName: { | 83 | _materialName: { |
84 | enumerable: true, | 84 | enumerable: true, |
85 | value: "" | 85 | value: "" |
86 | }, | 86 | }, |
87 | 87 | ||
88 | _useSelection: { value: false, enumerable: true }, | 88 | _useSelection: { value: false, enumerable: true }, |
89 | _whichMaterial: { value: "fill", enumerable: true }, | 89 | _whichMaterial: { value: "fill", enumerable: true }, |
90 | _originalValues: {value: null, enumerable: true }, | 90 | _originalValues: {value: null, enumerable: true }, |
91 | 91 | ||
92 | captureAction: { | 92 | captureAction: { |
93 | value:function(event) { | 93 | value:function(event) { |
94 | switch(event._currentTarget.label) | 94 | switch(event._currentTarget.label) |
95 | { | 95 | { |
96 | case "Cancel": | 96 | case "Cancel": |
97 | // console.log("Cancel material edit"); | 97 | // console.log("Cancel material edit"); |
98 | this.revertToOriginalValues(); | 98 | this.revertToOriginalValues(); |
99 | break; | 99 | break; |
100 | case "OK": | 100 | case "OK": |
101 | // console.log("Committing material with the following values:"); | 101 | // console.log("Committing material with the following values:"); |
102 | for(var i=0, len=this.materialsProperties.childComponents.length; i< len; i++) | 102 | for(var i=0, len=this.materialsProperties.childComponents.length; i< len; i++) |
103 | { | 103 | { |
@@ -116,19 +116,19 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
116 | console.log("--------------"); | 116 | console.log("--------------"); |
117 | 117 | ||
118 | } | 118 | } |
119 | break; | 119 | break; |
120 | case "Save As...": | 120 | case "Save As...": |
121 | this.saveAs(); | 121 | this.saveAs(); |
122 | break; | 122 | break; |
123 | case "Reset": | 123 | case "Reset": |
124 | this.reset(); | 124 | this.reset(); |
125 | break; | 125 | break; |
126 | } | 126 | } |
127 | 127 | ||
128 | // Notify Materials Library to close popup | 128 | // Notify Materials Library to close popup |
129 | NJevent("hideMaterialPopup"); | 129 | NJevent("hideMaterialPopup"); |
130 | } | 130 | } |
131 | }, | 131 | }, |
132 | 132 | ||
133 | saveAs: | 133 | saveAs: |
134 | { | 134 | { |
@@ -152,45 +152,45 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
152 | } | 152 | } |
153 | }, | 153 | }, |
154 | 154 | ||
155 | revertToOriginalValues: | 155 | revertToOriginalValues: |
156 | { | 156 | { |
157 | value: function() | 157 | value: function() |
158 | { | 158 | { |
159 | if (this._originalValues) | 159 | if (this._originalValues) |
160 | { | 160 | { |
161 | this._material.importJSON( this._originalValues ); | 161 | this._material.importJSON( this._originalValues ); |
162 | 162 | ||
163 | if (this._useSelection) | 163 | if (this._useSelection) |
164 | { | 164 | { |
165 | var selection = this.application.ninja.selectedElements; | 165 | var selection = this.application.ninja.selectedElements; |
166 | if (selection && (selection.length > 0)) | 166 | if (selection && (selection.length > 0)) |
167 | { | 167 | { |
168 | var nObjs = selection.length; | 168 | var nObjs = selection.length; |
169 | for (var iObj=0; iObj<nObjs; iObj++) | 169 | for (var iObj=0; iObj<nObjs; iObj++) |
170 | { | 170 | { |
171 | var canvas = selection[iObj]; | 171 | var canvas = selection[iObj]; |
172 | var obj; | 172 | var obj; |
173 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; | 173 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; |
174 | if (obj) | 174 | if (obj) |
175 | { | 175 | { |
176 | var matArray = obj._materialArray; | 176 | var matArray = obj._materialArray; |
177 | var matTypeArray = obj._materialTypeArray; | 177 | var matTypeArray = obj._materialTypeArray; |
178 | var nMats = matArray.length; | 178 | var nMats = matArray.length; |
179 | for (var iMat=0; iMat<nMats; iMat++) | 179 | for (var iMat=0; iMat<nMats; iMat++) |
180 | { | 180 | { |
181 | if (matTypeArray[iMat] === this._whichMaterial) | 181 | if (matTypeArray[iMat] === this._whichMaterial) |
182 | matArray[iMat].importJSON( this._originalValues ); | 182 | matArray[iMat].importJSON( this._originalValues ); |
183 | } | 183 | } |
184 | var world = obj.getWorld(); | 184 | var world = obj.getWorld(); |
185 | if (world) | 185 | if (world) |
186 | world.restartRenderLoop(); | 186 | world.restartRenderLoop(); |
187 | } | 187 | } |
188 | } | 188 | } |
189 | } | 189 | } |
190 | } | 190 | } |
191 | } | 191 | } |
192 | } | 192 | } |
193 | }, | 193 | }, |
194 | 194 | ||
195 | updatePreview: | 195 | updatePreview: |
196 | { | 196 | { |
@@ -221,8 +221,8 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
221 | // console.log(event.propertyLabel + " changing to " + event.propertyValue); | 221 | // console.log(event.propertyLabel + " changing to " + event.propertyValue); |
222 | // } | 222 | // } |
223 | 223 | ||
224 | if (event.propertyLabel && event.propertyValue) | 224 | if (event.propertyLabel && event.propertyValue) |
225 | this.applyProperty( event.propertyLabel, event.propertyValue ); | 225 | this.applyProperty( event.propertyLabel, event.propertyValue ); |
226 | } | 226 | } |
227 | }, | 227 | }, |
228 | 228 | ||
@@ -230,7 +230,7 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
230 | { | 230 | { |
231 | value: function(theEvent) | 231 | value: function(theEvent) |
232 | { | 232 | { |
233 | var event = theEvent._event; | 233 | var event = theEvent._event; |
234 | // if(typeof event.propertyValue === "object") | 234 | // if(typeof event.propertyValue === "object") |
235 | // { | 235 | // { |
236 | // console.log(event.propertyLabel + " changed to "); | 236 | // console.log(event.propertyLabel + " changed to "); |
@@ -241,70 +241,70 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
241 | // console.log(event.propertyLabel + " changed to " + event.propertyValue); | 241 | // console.log(event.propertyLabel + " changed to " + event.propertyValue); |
242 | // } | 242 | // } |
243 | 243 | ||
244 | if (event.propertyLabel) | 244 | if (event.propertyLabel) |
245 | this.applyProperty( event.propertyLabel, event.propertyValue ); | 245 | this.applyProperty( event.propertyLabel, event.propertyValue ); |
246 | } | 246 | } |
247 | }, | 247 | }, |
248 | 248 | ||
249 | applyProperty: | 249 | applyProperty: |
250 | { | 250 | { |
251 | value: function( propLabel, propValue) | 251 | value: function( propLabel, propValue) |
252 | { | 252 | { |
253 | // find the property lable in the array | 25 |