SelectionInspector.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. //
  2. // Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. import EditorUI = require("../../EditorUI");
  23. import CreateComponentButton = require("./CreateComponentButton");
  24. import ScriptWidget = require("ui/ScriptWidget");
  25. import EditorEvents = require("editor/EditorEvents");
  26. import SerializableEditType = require("./SerializableEditType");
  27. import SelectionSection = require("./SelectionSection");
  28. import SelectionPrefabWidget = require("./SelectionPrefabWidget");
  29. import AttributeInfoEdit = require("./AttributeInfoEdit");
  30. class NodeSection extends SelectionSection {
  31. prefabWidget: SelectionPrefabWidget;
  32. transformEdits: AttributeInfoEdit[] = [];
  33. updateDelta: number = 0.0;
  34. constructor(editType: SerializableEditType) {
  35. super(editType);
  36. this.prefabWidget = new SelectionPrefabWidget();
  37. this.attrLayout.addChild(this.prefabWidget);
  38. this.transformEdits.push(this.attrEdits["Position"]);
  39. this.transformEdits.push(this.attrEdits["Rotation"]);
  40. this.transformEdits.push(this.attrEdits["Scale"]);
  41. this.subscribeToEvent("Update", (ev) => this.handleUpdate(ev));
  42. }
  43. handleUpdate(ev) {
  44. this.updateDelta -= ev.timeStep;
  45. if (this.updateDelta < 0.0) {
  46. this.updateDelta = 0.1;
  47. Atomic.ui.blockChangedEvents = true;
  48. for (var i in this.transformEdits) {
  49. this.transformEdits[i].refresh();
  50. }
  51. Atomic.ui.blockChangedEvents = false;
  52. }
  53. }
  54. }
  55. class ComponentSection extends SelectionSection {
  56. constructor(editType: SerializableEditType, inspector: SelectionInspector) {
  57. super(editType);
  58. var deleteButton = new Atomic.UIButton();
  59. deleteButton.text = "Delete Component";
  60. deleteButton.fontDescription = SelectionSection.fontDesc;
  61. deleteButton.onClick = () => {
  62. inspector.onComponentDelete(editType);
  63. return true;
  64. };
  65. var copyButton = new Atomic.UIButton();
  66. copyButton.text = "Copy Settings";
  67. copyButton.onClick = () => {
  68. inspector.onComponentCopy(editType);
  69. return true;
  70. };
  71. var pasteButton = new Atomic.UIButton();
  72. pasteButton.text = "Paste Settings";
  73. pasteButton.onClick = () => {
  74. inspector.onComponentPaste(editType);
  75. return true;
  76. };
  77. this.attrLayout.addChild(deleteButton);
  78. this.attrLayout.addChild(copyButton);
  79. this.attrLayout.addChild(pasteButton);
  80. }
  81. }
  82. class SceneSection extends SelectionSection {
  83. constructor(editType: SerializableEditType) {
  84. super(editType);
  85. }
  86. }
  87. interface AttributeEditResourceChangedEvent {
  88. attrInfoEdit: AttributeInfoEdit;
  89. resource: Atomic.Resource;
  90. }
  91. class JSComponentSection extends ComponentSection {
  92. constructor(editType: SerializableEditType, inspector: SelectionInspector) {
  93. super(editType, inspector);
  94. this.hasDynamicAttr = true;
  95. this.subscribeToEvent(this, "AttributeEditResourceChanged", (ev) => this.handleAttributeEditResourceChanged(ev));
  96. }
  97. private handleAttributeEditResourceChanged(ev: AttributeEditResourceChangedEvent) {
  98. var jsc = <Atomic.JSComponent>this.editType.getFirstObject();
  99. if (!jsc)
  100. return;
  101. var attrInfos = jsc.getAttributes();
  102. this.updateDynamicAttrInfos(attrInfos);
  103. }
  104. }
  105. class CSComponentSection extends ComponentSection {
  106. constructor(editType: SerializableEditType, inspector: SelectionInspector) {
  107. super(editType, inspector);
  108. this.updateTextFromClassAttr();
  109. this.hasDynamicAttr = true;
  110. this.subscribeToEvent(this, "AttributeEditResourceChanged", (ev) => this.handleAttributeEditResourceChanged(ev));
  111. this.subscribeToEvent("CSComponentAssemblyChanged", (ev) => this.handleCSComponentAssemblyChanged(ev));
  112. this.subscribeToEvent("CSComponentClassChanged", (ev) => this.handleCSComponentClassChanged(ev));
  113. }
  114. private handleCSComponentAssemblyChanged(ev) {
  115. var csc = <AtomicNETScript.CSComponent>this.editType.getFirstObject();
  116. if (!csc)
  117. return;
  118. if (csc.componentFile == <Atomic.ScriptComponentFile> ev.resource) {
  119. var attrInfos = csc.getAttributes();
  120. this.updateDynamicAttrInfos(attrInfos);
  121. this.updateTextFromClassAttr();
  122. }
  123. }
  124. private handleCSComponentClassChanged(ev) {
  125. var csc = <AtomicNETScript.CSComponent>this.editType.getFirstObject();
  126. if (!csc)
  127. return;
  128. var attrInfos = csc.getAttributes();
  129. this.updateDynamicAttrInfos(attrInfos);
  130. this.updateTextFromClassAttr();
  131. }
  132. private handleAttributeEditResourceChanged(ev: AttributeEditResourceChangedEvent) {
  133. var csc = <AtomicNETScript.CSComponent>this.editType.getFirstObject();
  134. if (!csc)
  135. return;
  136. var attrInfos = csc.getAttributes();
  137. this.updateDynamicAttrInfos(attrInfos);
  138. }
  139. private updateTextFromClassAttr() {
  140. this.text = this.editType.typeName;
  141. var object = this.editType.getFirstObject();
  142. if (object) {
  143. var value = object.getAttribute("Class");
  144. if (value)
  145. this.text = value;
  146. }
  147. }
  148. }
  149. // Node Inspector + Component Inspectors
  150. class SelectionInspector extends ScriptWidget {
  151. component: Atomic.Component;
  152. constructor(sceneEditor: Editor.SceneEditor3D) {
  153. super();
  154. this.sceneEditor = sceneEditor;
  155. var mainLayout = this.mainLayout = new Atomic.UILayout();
  156. mainLayout.spacing = 4;
  157. var lp = new Atomic.UILayoutParams();
  158. lp.width = 304;
  159. mainLayout.layoutDistribution = Atomic.UI_LAYOUT_DISTRIBUTION_GRAVITY;
  160. mainLayout.layoutPosition = Atomic.UI_LAYOUT_POSITION_LEFT_TOP;
  161. mainLayout.layoutParams = lp;
  162. mainLayout.axis = Atomic.UI_AXIS_Y;
  163. this.addChild(mainLayout);
  164. var noticeLayout = this.multipleSelectNotice = new Atomic.UILayout();
  165. noticeLayout.axis = Atomic.UI_AXIS_Y;
  166. noticeLayout.layoutParams = lp;
  167. var noticeText = new Atomic.UITextField();
  168. noticeText.textAlign = Atomic.UI_TEXT_ALIGN_CENTER;
  169. noticeText.skinBg = "InspectorTextAttrName";
  170. noticeText.text = "Multiple Selection - Some components are hidden";
  171. noticeText.fontDescription = SelectionSection.fontDesc;
  172. noticeText.gravity = Atomic.UI_GRAVITY_LEFT_RIGHT;
  173. noticeText.layoutParams = lp;
  174. noticeLayout.addChild(noticeText);
  175. noticeLayout.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
  176. mainLayout.addChild(noticeLayout);
  177. this.createComponentButton = new CreateComponentButton();
  178. mainLayout.addChild(this.createComponentButton);
  179. this.subscribeToEvent(sceneEditor.scene, "SceneEditStateChangesBegin", (data) => this.handleSceneEditStateChangesBeginEvent());
  180. this.subscribeToEvent("SceneEditStateChange", (data) => this.handleSceneEditStateChangeEvent(data));
  181. this.subscribeToEvent(sceneEditor.scene, "SceneEditStateChangesEnd", (data) => this.handleSceneEditStateChangesEndEvent());
  182. this.subscribeToEvent(sceneEditor.scene, "SceneEditNodeRemoved", (ev: Editor.SceneEditNodeRemovedEvent) => this.handleSceneEditNodeRemoved(ev));
  183. this.subscribeToEvent(sceneEditor.scene, "SceneEditComponentAddedRemoved", (ev) => this.handleSceneEditComponentAddedRemovedEvent(ev));
  184. this.subscribeToEvent(this.createComponentButton, "SelectionCreateComponent", (data) => this.handleSelectionCreateComponent(data));
  185. }
  186. pruneSections() {
  187. var remove: SelectionSection[] = [];
  188. for (var i in this.sections) {
  189. var section = this.sections[i];
  190. var editType = section.editType;
  191. if (editType.typeName == "Node") {
  192. continue;
  193. }
  194. if (editType.typeName == "Scene") {
  195. var gotone = false;
  196. for (var j in this.nodes) {
  197. if (this.nodes[j].typeName == "Scene") {
  198. gotone = true;
  199. break;
  200. }
  201. }
  202. if (gotone)
  203. continue;
  204. }
  205. if (!editType.nodes.length) {
  206. remove.push(section);
  207. }
  208. }
  209. if (remove.length) {
  210. for (var i in remove) {
  211. var section = remove[i];
  212. this.removeSection(section);
  213. }
  214. this.suppressSections();
  215. }
  216. }
  217. suppressSections() {
  218. this.multipleSelectNotice.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
  219. for (var i in this.sections) {
  220. var section = this.sections[i];
  221. var editType = section.editType;
  222. if (editType.typeName == "Node" || editType.typeName == "Scene") {
  223. continue;
  224. }
  225. var suppressed = false;
  226. for (var j in this.nodes) {
  227. if (editType.nodes.indexOf(this.nodes[j]) == -1) {
  228. suppressed = true;
  229. break;
  230. }
  231. }
  232. if (suppressed)
  233. this.multipleSelectNotice.visibility = Atomic.UI_WIDGET_VISIBILITY_VISIBLE;
  234. section.suppress(suppressed);
  235. }
  236. }
  237. refresh() {
  238. Atomic.ui.blockChangedEvents = true;
  239. this.pruneSections();
  240. this.suppressSections();
  241. for (var i in this.sections) {
  242. this.sections[i].refresh();
  243. }
  244. if (this.nodeSection) {
  245. this.nodeSection.prefabWidget.updateSelection(this.nodes);
  246. }
  247. Atomic.ui.blockChangedEvents = false;
  248. }
  249. addSection(editType: SerializableEditType) {
  250. var section: SelectionSection;
  251. if (editType.typeName == "Node") {
  252. this.nodeSection = new NodeSection(editType);
  253. section = this.nodeSection;
  254. } else if (editType.typeName == "Scene") {
  255. section = new SceneSection(editType);
  256. } else if (editType.typeName == "JSComponent") {
  257. section = new JSComponentSection(editType, this);
  258. } else if (editType.typeName == "CSComponent") {
  259. section = new CSComponentSection(editType, this);
  260. }
  261. else {
  262. section = new ComponentSection(editType, this);
  263. }
  264. section.value = SelectionInspector.sectionStates[editType.typeName] ? 1 : 0;
  265. this.mainLayout.removeChild(this.createComponentButton, false);
  266. this.mainLayout.removeChild(this.multipleSelectNotice, false);
  267. // sort it in alphabetically
  268. this.sections.push(section);
  269. this.sections.sort(function(a, b) {
  270. if (a.editType.typeName == "Node" && b.editType.typeName == "Scene")
  271. return -1;
  272. if (a.editType.typeName == "Scene" && b.editType.typeName == "Node")
  273. return 1;
  274. if (a.editType.typeName == "Node" || a.editType.typeName == "Scene")
  275. return -1;
  276. if (b.editType.typeName == "Node" || b.editType.typeName == "Scene")
  277. return 1;
  278. return a.editType.typeName.localeCompare(b.editType.typeName);
  279. });
  280. var idx = this.sections.indexOf(section);
  281. if (idx == 0) {
  282. if (this.sections.length == 1) {
  283. this.mainLayout.addChild(section);
  284. } else {
  285. this.mainLayout.addChildBefore(section, this.sections[1]);
  286. }
  287. }
  288. else if (idx == this.sections.length - 1) {
  289. this.mainLayout.addChild(section);
  290. }
  291. else {
  292. this.mainLayout.addChildAfter(section, this.sections[idx - 1]);
  293. }
  294. // move the create component button down
  295. this.mainLayout.addChild(this.multipleSelectNotice);
  296. this.mainLayout.addChild(this.createComponentButton);
  297. }
  298. removeSection(section: SelectionSection) {
  299. SelectionInspector.sectionStates[section.editType.typeName] = section.value ? true : false;
  300. var index = this.sections.indexOf(section);
  301. this.sections.splice(index, 1);
  302. this.mainLayout.removeChild(section);
  303. }
  304. removeSerializable(serial: Atomic.Serializable) {
  305. for (var i in this.sections) {
  306. var section = this.sections[i];
  307. var e = section.editType;
  308. var index = e.objects.indexOf(serial);
  309. if (index != -1) {
  310. e.objects.splice(index, 1);
  311. }
  312. if (serial.typeName == "Node") {
  313. index = e.nodes.indexOf(<Atomic.Node>serial);
  314. if (index != -1) {
  315. e.nodes.splice(index, 1);
  316. }
  317. }
  318. }
  319. }
  320. addSerializable(serial: Atomic.Serializable): SerializableEditType {
  321. var editType = this.getEditType(serial);
  322. // does it already exist?
  323. for (var i in this.sections) {
  324. var section = this.sections[i];
  325. var e = section.editType;
  326. if (e.compareTypes(editType, this.nodes.length > 1)) {
  327. e.addSerializable(serial);
  328. return e;
  329. }
  330. }
  331. this.addSection(editType);
  332. return editType;
  333. }
  334. getEditType(serial: Atomic.Serializable): SerializableEditType {
  335. var typeName = serial.typeName;
  336. if (SelectionInspector._editTypes[typeName]) {
  337. return new SelectionInspector._editTypes[typeName](serial);
  338. }
  339. return new SerializableEditType(serial);
  340. }
  341. addNode(node: Atomic.Node) {
  342. var index = this.nodes.indexOf(node);
  343. if (index == -1) {
  344. this.nodes.push(node);
  345. this.addSerializable(node);
  346. var components = node.getComponents();
  347. for (var i in components) {
  348. if (this.filterComponent(components[i]))
  349. continue;
  350. var editType = this.addSerializable(components[i]);
  351. editType.addNode(node);
  352. }
  353. this.refresh();
  354. }
  355. }
  356. removeNode(node: Atomic.Node) {
  357. var index = this.nodes.indexOf(node);
  358. if (index != -1) {
  359. this.nodes.splice(index, 1);
  360. this.removeSerializable(node);
  361. var components = node.getComponents();
  362. for (var i in components) {
  363. if (this.filterComponent(components[i]))
  364. continue;
  365. this.removeSerializable(components[i]);
  366. }
  367. this.refresh();
  368. }
  369. // save node section state
  370. if (!this.nodes.length && this.nodeSection)
  371. SelectionInspector.sectionStates["Node"] = this.nodeSection.value ? true : false;
  372. }
  373. handleSceneEditStateChangesBeginEvent() {
  374. this.stateChangesInProgress = true;
  375. }
  376. handleSceneEditNodeRemoved(ev: Editor.SceneEditNodeRemovedEvent) {
  377. this.removeNode(ev.node);
  378. }
  379. handleSceneEditComponentAddedRemovedEvent(ev: Editor.SceneEditComponentAddedRemovedEvent) {
  380. if (this.filterComponent(ev.component)) {
  381. // still refresh as may affect UI (for example PrefabComponents)
  382. this.refresh();
  383. return;
  384. }
  385. var editType;
  386. if (!ev.removed) {
  387. editType = this.addSerializable(ev.component);
  388. editType.addNode(ev.node);
  389. } else {
  390. for (var i in this.sections) {
  391. var section = this.sections[i];
  392. editType = section.editType;
  393. var index = editType.objects.indexOf(ev.component);
  394. if (index != -1) {
  395. editType.objects.splice(index, 1);
  396. index = editType.nodes.indexOf(ev.node);
  397. if (index != -1) {
  398. editType.nodes.splice(index, 1);
  399. }
  400. break;
  401. }
  402. }
  403. }
  404. this.refresh();
  405. }
  406. onComponentDelete(editType: SerializableEditType) {
  407. var removed: Atomic.Component[] = [];
  408. for (var i in editType.objects) {
  409. var c = <Atomic.Component>editType.objects[i];
  410. removed.push(c);
  411. }
  412. for (var i in removed) {
  413. var c = removed[i];
  414. var node = c.node;
  415. c.remove();
  416. this.removeSerializable(removed[i]);
  417. var index = editType.nodes.indexOf(node);
  418. if (index != -1) {
  419. editType.nodes.splice(index, 1);
  420. }
  421. }
  422. if (removed.length) {
  423. this.sceneEditor.scene.sendEvent("SceneEditEnd");
  424. this.refresh();
  425. }
  426. }
  427. onComponentCopy(editType: SerializableEditType) {
  428. var copy: Atomic.Component[] = [];
  429. for (var i in editType.objects) {
  430. var c = <Atomic.Component>editType.objects[i];
  431. copy.push(c);
  432. }
  433. for (var i in copy) {
  434. var c = copy[i];
  435. this.component = c;
  436. this.sceneEditor.scene.sendEvent("SceneEditComponentCopy", { component: this.component });
  437. this.refresh();
  438. }
  439. }
  440. onComponentPaste(editType: SerializableEditType) {
  441. var paste: Atomic.Component[] = [];
  442. for (var i in editType.objects) {
  443. var c = <Atomic.Component>editType.objects[i];
  444. paste.push(c);
  445. }
  446. for (var i in paste) {
  447. var c = paste[i];
  448. this.component = c;
  449. this.sceneEditor.scene.sendEvent("SceneEditComponentPaste", { component: this.component });
  450. this.refresh();
  451. }
  452. }
  453. handleSelectionCreateComponent(ev) {
  454. var valid = true;
  455. if (ev.componentTypeName != "JSComponent" && ev.componentTypeName != "CSComponent") {
  456. for (var i in this.nodes) {
  457. var node = this.nodes[i];
  458. if (node.getComponent(ev.componentTypeName, false)) {
  459. valid = false;
  460. break;
  461. }
  462. }
  463. }
  464. if (!valid) {
  465. EditorUI.showModalError("Component Create", "Unable to create component, a node with an existing " + ev.componentTypeName + " component is selected");
  466. return;
  467. }
  468. for (var i in this.nodes) {
  469. var node = this.nodes[i];
  470. var c = node.createComponent(ev.componentTypeName);
  471. if (!c) {
  472. console.log("ERROR: unable to create component ", ev.componentTypeName);
  473. return;
  474. }
  475. var editType = this.addSerializable(c);
  476. editType.addNode(node);
  477. for (var i in this.sections) {
  478. if (this.sections[i].editType == editType) {
  479. this.sections[i].value = 1;
  480. break;
  481. }
  482. }
  483. }
  484. this.refresh();
  485. }
  486. handleSceneEditStateChangeEvent(ev: Editor.SceneEditStateChangeEvent) {
  487. if (!this.stateChangesInProgress)
  488. return;
  489. if (this.stateChanges.indexOf(ev.serializable) == -1) {
  490. this.stateChanges.push(ev.serializable);
  491. }
  492. }
  493. getPrefabComponent(node: Atomic.Node): Atomic.PrefabComponent {
  494. if (node.getComponent("PrefabComponent"))
  495. return <Atomic.PrefabComponent>node.getComponent("PrefabComponent");
  496. if (node.parent)
  497. return this.getPrefabComponent(node.parent);
  498. return null;
  499. }
  500. filterComponent(component: Atomic.Component): boolean {
  501. if (component.typeName == "PrefabComponent") {
  502. return true;
  503. }
  504. return false;
  505. }
  506. handleSceneEditStateChangesEndEvent() {
  507. Atomic.ui.blockChangedEvents = true;
  508. var sections: SelectionSection[] = [];
  509. for (var i in this.stateChanges) {
  510. var serial = this.stateChanges[i];
  511. for (var j in this.sections) {
  512. var section = this.sections[j];
  513. if (sections.indexOf(section) != -1)
  514. continue;
  515. if (section.editType.objects.indexOf(serial) != -1) {
  516. sections.push(section);
  517. if (section.hasDynamicAttr) {
  518. var object = section.editType.getFirstObject();
  519. if (object) {
  520. var attrInfos = object.getAttributes();
  521. section.updateDynamicAttrInfos(attrInfos);
  522. }
  523. }
  524. section.refresh();
  525. }
  526. }
  527. }
  528. Atomic.ui.blockChangedEvents = false;
  529. this.stateChanges = [];
  530. this.stateChangesInProgress = false;
  531. }
  532. mainLayout: Atomic.UILayout;
  533. multipleSelectNotice: Atomic.UILayout;
  534. sceneEditor: Editor.SceneEditor3D;
  535. nodes: Atomic.Node[] = [];
  536. sections: SelectionSection[] = [];
  537. createComponentButton: CreateComponentButton;
  538. nodeSection: NodeSection;
  539. stateChangesInProgress: boolean = false;
  540. stateChanges: Atomic.Serializable[] = [];
  541. // ------------------------------------
  542. static registerEditType(typeName: string, type: typeof SerializableEditType) {
  543. SelectionInspector._editTypes[typeName] = type;
  544. }
  545. private static sectionStates: { [typeName: string]: boolean } = {};
  546. private static _editTypes: { [typeName: string]: typeof SerializableEditType } = {};
  547. private static Ctor = (() => {
  548. SelectionInspector.sectionStates["Node"] = true;
  549. })();
  550. }
  551. export = SelectionInspector;