diff options
author | hwc487 | 2012-04-26 16:40:05 -0700 |
---|---|---|
committer | hwc487 | 2012-04-26 16:40:05 -0700 |
commit | 5a1965bf2ed9a54601ca16fd67555335c510ce08 (patch) | |
tree | 7fa2419c8a194e7b0265b58f0f4d10d02a0d66f4 /js/panels | |
parent | ee07f71e9e6c9219e02738c77fb038bece2e03b6 (diff) | |
download | ninja-5a1965bf2ed9a54601ca16fd67555335c510ce08.tar.gz |
Update materials to the new texture model.
Create local world for deleted source canvases
Diffstat (limited to 'js/panels')
-rw-r--r-- | js/panels/Materials/materials-data.json | 84 | ||||
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.js | 56 |
2 files changed, 116 insertions, 24 deletions
diff --git a/js/panels/Materials/materials-data.json b/js/panels/Materials/materials-data.json index f06ab6c8..5e86793e 100644 --- a/js/panels/Materials/materials-data.json +++ b/js/panels/Materials/materials-data.json | |||
@@ -5,24 +5,96 @@ | |||
5 | "label": "Ninja Materials", | 5 | "label": "Ninja Materials", |
6 | "children": [ | 6 | "children": [ |
7 | { | 7 | { |
8 | "label": "Uber", | ||
9 | "id" : "UberMaterial" | ||
10 | }, | ||
11 | { | ||
12 | "label": "Bump Metal", | 8 | "label": "Bump Metal", |
13 | "id" : "BumpMetalMaterial" | 9 | "id" : "BumpMetalMaterial" |
14 | }, | 10 | }, |
15 | { | 11 | { |
12 | "label": "Deform", | ||
13 | "id" : "DeformMaterial" | ||
14 | }, | ||
15 | { | ||
16 | "label": "Flat", | ||
17 | "id" : "FlatMaterial" | ||
18 | }, | ||
19 | { | ||
20 | "label": "Flag", | ||
21 | "id" : "FlagMaterial" | ||
22 | }, | ||
23 | { | ||
24 | "label": "Fly", | ||
25 | "id" : "FlyMaterial" | ||
26 | }, | ||
27 | { | ||
28 | "label": "Julia", | ||
29 | "id" : "JuliaMaterial" | ||
30 | }, | ||
31 | { | ||
32 | "label": "Keleidoscope", | ||
33 | "id" : "KeleidoscopeMaterial" | ||
34 | }, | ||
35 | { | ||
16 | "label": "Linear Gradient", | 36 | "label": "Linear Gradient", |
17 | "id" : "LinearGradientMaterial" | 37 | "id" : "LinearGradientMaterial" |
18 | }, | 38 | }, |
19 | { | 39 | { |
40 | "label": "Mandel", | ||
41 | "id" : "MandelMaterial" | ||
42 | }, | ||
43 | { | ||
44 | "label": "Plasma", | ||
45 | "id" : "PlasmaMaterial" | ||
46 | }, | ||
47 | { | ||
48 | "label": "Pulse", | ||
49 | "id" : "PulseMaterial" | ||
50 | }, | ||
51 | { | ||
52 | "label": "Radial Blur", | ||
53 | "id" : "RadialBlurMaterial" | ||
54 | }, | ||
55 | { | ||
20 | "label": "Radial Gradient", | 56 | "label": "Radial Gradient", |
21 | "id" : "RadialGradientMaterial" | 57 | "id" : "RadialGradientMaterial" |
22 | }, | 58 | }, |
23 | { | 59 | { |
24 | "label": "Flat", | 60 | "label": "Relief Tunnel", |
25 | "id" : "FlatMaterial" | 61 | "id" : "ReliefTunnelMaterial" |
62 | }, | ||
63 | { | ||
64 | "label": "Square Tunnel", | ||
65 | "id" : "SquareTunnelMaterial" | ||
66 | }, | ||
67 | { | ||
68 | "label": "Star", | ||
69 | "id" : "StarMaterial" | ||
70 | }, | ||
71 | { | ||
72 | "label": "Taper", | ||
73 | "id" : "TaperMaterial" | ||
74 | }, | ||
75 | { | ||
76 | "label": "Tunnel", | ||
77 | "id" : "TunnelMaterial" | ||
78 | }, | ||
79 | { | ||
80 | "label": "Twist", | ||
81 | "id" : "TwistMaterial" | ||
82 | }, | ||
83 | { | ||
84 | "label": "Twist Vertex", | ||
85 | "id" : "TwistVertMaterial" | ||
86 | }, | ||
87 | { | ||
88 | "label": "Uber", | ||
89 | "id" : "UberMaterial" | ||
90 | }, | ||
91 | { | ||
92 | "label": "Water", | ||
93 | "id" : "WaterMaterial" | ||
94 | }, | ||
95 | { | ||
96 | "label": "Z-Invert", | ||
97 | "id" : "ZInvertMaterial" | ||
26 | } | 98 | } |
27 | ] | 99 | ] |
28 | }, | 100 | }, |
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index bd10f7a5..9220659e 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js | |||
@@ -164,8 +164,10 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
164 | var index = value.lastIndexOf( "/" ); | 164 | var index = value.lastIndexOf( "/" ); |
165 | if (index < 0) index = value.lastIndexOf( "\\" ); | 165 | if (index < 0) index = value.lastIndexOf( "\\" ); |
166 | if (index >= 0) | 166 | if (index >= 0) |
167 | { | ||
167 | value = value.substr( index+1 ); | 168 | value = value.substr( index+1 ); |
168 | value = "assets\\images\\" + value; | 169 | value = "assets\\images\\" + value; |
170 | } | ||
169 | rtnValue = value.slice(0); | 171 | rtnValue = value.slice(0); |
170 | } | 172 | } |
171 | break; | 173 | break; |
@@ -214,30 +216,48 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
214 | enumerable: true, | 216 | enumerable: true, |
215 | value: function(materialID) | 217 | value: function(materialID) |
216 | { | 218 | { |
217 | //TODO - Hack to force repetition to draw. Setting .length = 0 did not work. | 219 | //TODO - Hack to force repetition to draw. Setting .length = 0 did not work. |
218 | this.materialsData = []; | 220 | this.materialsData = []; |
219 | 221 | ||
220 | this._materialName = materialID; | 222 | this._materialName = materialID; |
221 | if( | 223 | if( |
222 | (materialID === "UberMaterial") || | 224 | (materialID === "BumpMetalMaterial") || |
223 | (materialID === "FlatMaterial") || | 225 | (materialID === "DeformMaterial") || |
224 | (materialID === "BumpMetalMaterial") || | 226 | (materialID === "FlatMaterial") || |
225 | (materialID === "LinearGradientMaterial") || | 227 | (materialID === "FlagMaterial") || |
226 | (materialID === "RadialGradientMaterial") | 228 | (materialID === "FlyMaterial") || |
229 | (materialID === "JuliaMaterial") || | ||
230 | (materialID === "KeleidoscopeMaterial") || | ||
231 | (materialID === "LinearGradientMaterial") || | ||
232 | (materialID === "MandelMaterial") || | ||
233 | (materialID === "PlasmaMaterial") || | ||
234 | (materialID === "PulseMaterial") || | ||
235 | (materialID === "RadialBlurMaterial") || | ||
236 | (materialID === "RadialGradientMaterial") || | ||
237 | (materialID === "ReliefTunnelMaterial") || | ||
238 | (materialID === "SquareTunnelMaterial") || | ||
239 | (materialID === "StarMaterial") || | ||
240 | (materialID === "TaperMaterial") || | ||
241 | (materialID === "TunnelMaterial") || | ||
242 | (materialID === "TwistMaterial") || | ||
243 | (materialID === "TwistVertMaterial") || | ||
244 | (materialID === "UberMaterial") || | ||
245 | (materialID === "WaterMaterial") || | ||
246 | (materialID === "ZInvertMaterial") | ||
227 | ) | 247 | ) |
228 | { | 248 | { |
229 | var material = MaterialsModel.getMaterial( materialID ); | 249 | var material = MaterialsModel.getMaterial( materialID ); |
230 | if (material) | 250 | if (material) |
231 | { | 251 | { |
232 | this._material = material; | 252 | this._material = material; |
233 | this.materialsData = this.getMaterialData( material ); | 253 | this.materialsData = this.getMaterialData( material ); |
234 | } | 254 | } |
235 | } | 255 | } |
236 | else | 256 | else |
237 | { | 257 | { |
238 | this.materialsData = this[materialID]; | 258 | this.materialsData = this[materialID]; |
239 | } | 259 | } |
240 | this.needsDraw = true; | 260 | this.needsDraw = true; |
241 | } | 261 | } |
242 | }, | 262 | }, |
243 | 263 | ||