aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Materials
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-06-27 14:21:27 -0700
committerNivesh Rajbhandari2012-06-27 14:21:27 -0700
commit978b9049d057d2a0995758275f68da8641193201 (patch)
treed26fadef6100d5eb87e871a68f8c71fac9ab27a6 /js/panels/Materials
parent8351c3685a6db703d1940817abc71f92ef4e1bd4 (diff)
downloadninja-978b9049d057d2a0995758275f68da8641193201.tar.gz
Integrating Materials UI changes. Squashed commit of the following:
commit 89ccb55130e67c4516e616ccc56d2a649a2b9160 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Wed Jun 27 14:20:01 2012 -0700 Position Materials Editor popup and change buttons' text color. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 89bca82adc781f4913f8d302a49a8baa907631c5 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Wed Jun 27 12:00:51 2012 -0700 Support deleting and editing custom materials. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 5be5160c4786beb70e8ad4d75562adb135718c6c Merge: 1d9d9f6 2ebf3e3 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Wed Jun 27 11:11:37 2012 -0700 Merge branch 'refs/heads/ninja-internal' into WebGLMaterials Conflicts: js/data/panels-data.js Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 1d9d9f6e66ea7585f07ed461cebba99e71f65de0 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Tue Jun 26 22:01:22 2012 -0700 "Save as" support to duplicate material with modified settings. Also removed Add button and disabled Reset button for now. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit bf1037508dbc686f2884765344832f906cbf06d0 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Tue Jun 26 17:23:31 2012 -0700 Added UI for duplicating and deleting materials in the Materials Library. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 54930792f9c417df5f739831164aa1f96a41d67a Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Tue Jun 26 14:29:17 2012 -0700 Added preview of material in materials editor popup and fixed some styling. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/panels/Materials')
-rw-r--r--js/panels/Materials/materials-data.json5
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.css18
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.html25
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.js109
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.css36
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.html26
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.js333
7 files changed, 297 insertions, 255 deletions
diff --git a/js/panels/Materials/materials-data.json b/js/panels/Materials/materials-data.json
index a5d8997b..fde82d3d 100644
--- a/js/panels/Materials/materials-data.json
+++ b/js/panels/Materials/materials-data.json
@@ -101,6 +101,11 @@
101 "id" : "Z-Invert" 101 "id" : "Z-Invert"
102 } 102 }
103 ] 103 ]
104 },
105 {
106 "label": "Custom Materials",
107 "children": [
108 ]
104 } 109 }
105 ] 110 ]
106} \ No newline at end of file 111} \ No newline at end of file
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css
index bed3acfe..b5d36108 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css
@@ -15,6 +15,12 @@
15 margin: 4px 0 4px 0; 15 margin: 4px 0 4px 0;
16} 16}
17 17
18.materials_library_panel .ml_tree_holder {
19 height: 200px;
20 min-height: 200px;
21 max-height: 200px;
22 overflow-y: scroll;
23}
18 24
19.ml_buttons { 25.ml_buttons {
20 clear:both; 26 clear:both;
@@ -30,9 +36,19 @@
30 cursor: pointer; 36 cursor: pointer;
31 margin: 0 1px; 37 margin: 0 1px;
32 float: left; 38 float: left;
39 width: 40px;
40}
41
42.ml_buttons .ml_duplicate_btn {
33 width: 60px; 43 width: 60px;
34} 44}
35 45
36.ml_buttons .nj-skinned:last-child { 46.ml_buttons .ml_delete_btn {
47 width: 50px;
37 float: right; 48 float: right;
49}
50
51.ml_buttons .nj-skinned:hover,
52.ml_buttons .nj-skinned:active {
53 color: white;
38} \ No newline at end of file 54} \ No newline at end of file
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
index 6fa54495..3adb2108 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
@@ -10,12 +10,12 @@
10 <link rel="stylesheet" type="text/css" href="materials-library-panel.css"> 10 <link rel="stylesheet" type="text/css" href="materials-library-panel.css">
11 <script type="text/montage-serialization"> 11 <script type="text/montage-serialization">
12 { 12 {
13 "addButton": { 13 "duplicateButton": {
14 "prototype": "montage/ui/button.reel", 14 "prototype": "montage/ui/button.reel",
15 "properties": { 15 "properties": {
16 "element": {"#": "ml_add_btn"}, 16 "element": {"#": "ml_duplicate_btn"},
17 "enabled": false 17 "enabled": true
18 }, 18 },
19 "listeners": [ 19 "listeners": [
20 { 20 {
21 "type": "action", 21 "type": "action",
@@ -23,11 +23,10 @@
23 } 23 }
24 ] 24 ]
25 }, 25 },
26 "copyButton": { 26 "editButton": {
27 "prototype": "montage/ui/button.reel", 27 "prototype": "montage/ui/button.reel",
28 "properties": { 28 "properties": {
29 "element": {"#": "ml_copy_btn"}, 29 "element": {"#": "ml_edit_btn"}
30 "enabled": false
31 }, 30 },
32 "listeners": [ 31 "listeners": [
33 { 32 {
@@ -82,7 +81,9 @@
82 "prototype": "js/panels/Materials/materials-library-panel.reel[MaterialsLibraryPanels]", 81 "prototype": "js/panels/Materials/materials-library-panel.reel[MaterialsLibraryPanels]",
83 "properties": { 82 "properties": {
84 "element": {"#": "materials_library_panel"}, 83 "element": {"#": "materials_library_panel"},
85 "_materialInfo": {"@": "materialInfo"} 84 "_materialInfo": {"@": "materialInfo"},
85 "materialsController": {"@": "materialsController"},
86 "deleteButton": {"@": "deleteButton"}
86 } 87 }
87 } 88 }
88 } 89 }
@@ -92,14 +93,14 @@
92 <body> 93 <body>
93 94
94 <div data-montage-id="materials_library_panel" class="materials_library_panel"> 95 <div data-montage-id="materials_library_panel" class="materials_library_panel">
95 <section data-montage-id="ml_tree_holder" class="animationsLibrary"> 96 <section data-montage-id="ml_tree_holder" class="ml_tree_holder">
96 <div data-montage-id="materials_library_tree"></div> 97 <div data-montage-id="materials_library_tree"></div>
97 </section> 98 </section>
98 <hr /> 99 <hr />
99 <div data-montage-id="ml_buttons" class="ml_buttons"> 100 <div data-montage-id="ml_buttons" class="ml_buttons">
100 <button data-montage-id="ml_add_btn" class="nj-skinned">Add</button> 101 <button data-montage-id="ml_duplicate_btn" class="nj-skinned ml_duplicate_btn">Duplicate</button>
101 <button data-montage-id="ml_copy_btn" class="nj-skinned">Copy</button> 102 <button data-montage-id="ml_edit_btn" class="nj-skinned ml_edit_btn">Edit</button>
102 <button data-montage-id="ml_delete_btn" class="nj-skinned">Delete</button> 103 <button data-montage-id="ml_delete_btn" class="nj-skinned ml_delete_btn">Delete</button>
103 </div> 104 </div>
104 </div> 105 </div>
105 106
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
index cf0d4e93..cd933ea6 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
@@ -7,14 +7,36 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
7var Montage = require("montage/core/core").Montage, 7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component, 8 Component = require("montage/ui/component").Component,
9 MaterialsData = require("js/panels/Materials/materials-data.json"), 9 MaterialsData = require("js/panels/Materials/materials-data.json"),
10 Popup = require("montage/ui/popup/popup.reel").Popup; 10 Popup = require("montage/ui/popup/popup.reel").Popup,
11 MaterialsModel = require("js/models/materials-model").MaterialsModel,
12 LeafNode = require("js/components/treeview/ninja-leaf.reel").Leaf;
11 13
12exports.MaterialsLibraryPanel = Montage.create(Component, { 14exports.MaterialsLibraryPanel = Montage.create(Component, {
13 15
16 deleteButton: {
17 value: null
18 },
19
14 materialsData: { 20 materialsData: {
15 value: null 21 value: null
16 }, 22 },
17 23
24 materialId: {
25 value: null
26 },
27
28 selectedMaterialNode: {
29 value: null
30 },
31
32 customMaterialsBranch: {
33 value: null
34 },
35
36 customMaterialsCounter: {
37 value: 2
38 },
39
18 _hasFocus: { 40 _hasFocus: {
19 enumerable: false, 41 enumerable: false,
20 value: false 42 value: false