AssemblyInspector.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 InspectorWidget = require("./InspectorWidget");
  23. import ArrayEditWidget = require("./ArrayEditWidget");
  24. import InspectorUtils = require("./InspectorUtils");
  25. class AssemblyInspector extends InspectorWidget {
  26. constructor() {
  27. super();
  28. this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
  29. }
  30. handleWidgetEvent(ev: Atomic.UIWidgetEvent):boolean {
  31. return false;
  32. }
  33. inspect(asset: ToolCore.Asset) {
  34. this.asset = asset;
  35. this.importer = <ToolCore.NETAssemblyImporter> asset.importer;
  36. // node attr layout
  37. var rootLayout = this.rootLayout;
  38. // Assembly Section
  39. var assemblyLayout = this.createSection(rootLayout, "NETAssembly", 1);
  40. var assemblyFile = <AtomicNETScript.CSComponentAssembly> asset.importer.getResource();
  41. var container = InspectorUtils.createContainer();
  42. container.gravity = Atomic.UI_GRAVITY_ALL;
  43. assemblyLayout.addChild(container);
  44. var panel = new Atomic.UILayout();
  45. panel.axis = Atomic.UI_AXIS_Y;
  46. panel.layoutSize = Atomic.UI_LAYOUT_SIZE_PREFERRED;
  47. panel.layoutPosition = Atomic.UI_LAYOUT_POSITION_LEFT_TOP;
  48. container.addChild(panel);
  49. var label = InspectorUtils.createAttrName("CSComponents:");
  50. panel.addChild(label);
  51. for (var index in assemblyFile.classNames) {
  52. var classname = assemblyFile.classNames[index];
  53. label = InspectorUtils.createAttrName(classname);
  54. panel.addChild(label);
  55. }
  56. }
  57. asset: ToolCore.Asset;
  58. importer:ToolCore.NETAssemblyImporter;
  59. }
  60. export = AssemblyInspector;