AttributeInfoEdit.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. import EditorUI = require("ui/EditorUI");
  8. import InspectorUtils = require("./InspectorUtils");
  9. import SerializableEditType = require("./SerializableEditType");
  10. class AttributeInfoEdit extends Atomic.UILayout {
  11. attrInfo: Atomic.AttributeInfo;
  12. editType: SerializableEditType;
  13. editWidget: Atomic.UIWidget;
  14. nameOverride: string;
  15. constructor() {
  16. super();
  17. }
  18. initialize(editType: SerializableEditType, attrInfo: Atomic.AttributeInfo): boolean {
  19. this.editType = editType;
  20. this.attrInfo = attrInfo;
  21. this.createLayout();
  22. return true;
  23. }
  24. handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
  25. return false;
  26. }
  27. createLayout() {
  28. this.createEditWidget();
  29. this.editWidget.subscribeToEvent(this.editWidget, "WidgetEvent", (data) => this.handleWidgetEvent(data));
  30. var attr = this.attrInfo;
  31. var attrNameLP = AttributeInfoEdit.attrNameLP;
  32. this.layoutDistribution = Atomic.UI_LAYOUT_DISTRIBUTION_GRAVITY;
  33. var name = new Atomic.UITextField();
  34. name.textAlign = Atomic.UI_TEXT_ALIGN_LEFT;
  35. name.skinBg = "InspectorTextAttrName";
  36. name.layoutParams = attrNameLP;
  37. if (attr.type == Atomic.VAR_VECTOR3 || attr.type == Atomic.VAR_COLOR ||
  38. attr.type == Atomic.VAR_QUATERNION) {
  39. this.axis = Atomic.UI_AXIS_Y;
  40. this.layoutPosition = Atomic.UI_LAYOUT_POSITION_LEFT_TOP;
  41. this.skinBg = "InspectorVectorAttrLayout";
  42. }
  43. var bname = attr.name;
  44. if (bname == "Is Enabled")
  45. bname = "Enabled";
  46. if (this.nameOverride)
  47. name.text = this.nameOverride;
  48. else
  49. name.text = bname;
  50. name.fontDescription = AttributeInfoEdit.fontDesc;
  51. this.addChild(name);
  52. this.addChild(this.editWidget);
  53. }
  54. createEditWidget() {
  55. }
  56. refresh() {
  57. }
  58. static createAttrEdit(editType: SerializableEditType, attrInfo: Atomic.AttributeInfo): AttributeInfoEdit {
  59. var type: typeof AttributeInfoEdit;
  60. var customTypes = AttributeInfoEdit.customAttrEditTypes[editType.typeName];
  61. if (customTypes) {
  62. type = customTypes[attrInfo.name];
  63. }
  64. if (!type) {
  65. type = AttributeInfoEdit.standardAttrEditTypes[attrInfo.type];
  66. }
  67. if (!type)
  68. return null;
  69. var attrEdit = new type();
  70. if (!attrEdit.initialize(editType, attrInfo))
  71. return null;
  72. return attrEdit;
  73. }
  74. // atttribute name layout param
  75. static attrNameLP: Atomic.UILayoutParams;
  76. static fontDesc: Atomic.UIFontDescription;
  77. static standardAttrEditTypes: { [variantType: number /*Atomic.VariantType*/]: typeof AttributeInfoEdit } = {};
  78. static customAttrEditTypes: { [typeName: string]: { [name: string]: typeof AttributeInfoEdit } } = {};
  79. static registerCustomAttr(typeName: string, attrName: string, edit: typeof AttributeInfoEdit) {
  80. if (!AttributeInfoEdit.customAttrEditTypes[typeName]) {
  81. AttributeInfoEdit.customAttrEditTypes[typeName] = {};
  82. }
  83. AttributeInfoEdit.customAttrEditTypes[typeName][attrName] = edit;
  84. }
  85. private static Ctor = (() => {
  86. var attrNameLP = AttributeInfoEdit.attrNameLP = new Atomic.UILayoutParams();
  87. attrNameLP.width = 100;
  88. var fd = AttributeInfoEdit.fontDesc = new Atomic.UIFontDescription();
  89. fd.id = "Vera";
  90. fd.size = 11;
  91. })();
  92. }
  93. class BoolAttributeEdit extends AttributeInfoEdit {
  94. createEditWidget() {
  95. var box = new Atomic.UICheckBox();
  96. this.editWidget = box;
  97. }
  98. refresh() {
  99. var uniform = this.editType.getUniformValue(this.attrInfo);
  100. if (uniform) {
  101. var object = this.editType.getFirstObject();
  102. this.editWidget.skinBg = "TBGreyCheckBox";
  103. if (object) {
  104. var value = object.getAttribute(this.attrInfo.name);
  105. this.editWidget.value = (value ? 1 : 0);
  106. }
  107. } else {
  108. this.editWidget.skinBg = "TBGreyCheckBoxNonUniform";
  109. this.editWidget.value = 1;
  110. }
  111. }
  112. handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
  113. if (ev.type == Atomic.UI_EVENT_TYPE_CHANGED) {
  114. this.editType.onAttributeInfoEdited(this.attrInfo, this.editWidget.value ? true : false);
  115. this.refresh();
  116. return true;
  117. }
  118. return false;
  119. }
  120. }
  121. class StringAttributeEdit extends AttributeInfoEdit {
  122. createEditWidget() {
  123. var field = new Atomic.UIEditField();
  124. field.textAlign = Atomic.UI_TEXT_ALIGN_LEFT;
  125. field.skinBg = "TBAttrEditorField";;
  126. field.fontDescription = AttributeInfoEdit.fontDesc;
  127. var lp = new Atomic.UILayoutParams();
  128. lp.width = 140;
  129. field.layoutParams = lp;
  130. field.subscribeToEvent(field, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
  131. this.editWidget = field;
  132. }
  133. refresh() {
  134. var uniform = this.editType.getUniformValue(this.attrInfo);
  135. if (uniform) {
  136. var object = this.editType.getFirstObject();
  137. if (object) {
  138. var value = object.getAttribute(this.attrInfo.name);
  139. this.editWidget.text = value;
  140. }
  141. } else {
  142. this.editWidget.text = "--";
  143. }
  144. }
  145. handleUIWidgetEditCompleteEvent(ev) {
  146. this.editType.onAttributeInfoEdited(this.attrInfo, this.editWidget.text);
  147. this.refresh();
  148. }
  149. handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
  150. if (ev.type == Atomic.UI_EVENT_TYPE_CHANGED) {
  151. return true;
  152. }
  153. return false;
  154. }
  155. }
  156. class IntAttributeEdit extends AttributeInfoEdit {
  157. enumSource: Atomic.UISelectItemSource;
  158. createEditWidget() {
  159. var attrInfo = this.attrInfo;
  160. if (attrInfo.enumNames.length) {
  161. var enumSource = this.enumSource = new Atomic.UISelectItemSource();
  162. for (var i in attrInfo.enumNames) {
  163. enumSource.addItem(new Atomic.UISelectItem(attrInfo.enumNames[i], (Number(i) + 1).toString()));
  164. }
  165. var button = new Atomic.UIButton();
  166. button.fontDescription = AttributeInfoEdit.fontDesc;
  167. button.text = "Enum Value!";
  168. var lp = new Atomic.UILayoutParams();
  169. lp.width = 140;
  170. button.layoutParams = lp;
  171. this.editWidget = button;
  172. } else {
  173. var field = new Atomic.UIEditField();
  174. field.textAlign = Atomic.UI_TEXT_ALIGN_CENTER;
  175. field.skinBg = "TBAttrEditorField";;
  176. field.fontDescription = AttributeInfoEdit.fontDesc;
  177. var lp = new Atomic.UILayoutParams();
  178. lp.width = 140;
  179. field.layoutParams = lp;
  180. field.subscribeToEvent(field, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
  181. this.editWidget = field;
  182. }
  183. }
  184. refresh() {
  185. var uniform = this.editType.getUniformValue(this.attrInfo);
  186. if (uniform) {
  187. var object = this.editType.getFirstObject();
  188. if (object) {
  189. var value = object.getAttribute(this.attrInfo.name);
  190. var widget = this.editWidget;
  191. var attrInfo = this.attrInfo;
  192. if (attrInfo.enumNames.length) {
  193. widget.text = attrInfo.enumNames[value];
  194. }
  195. else {
  196. widget.text = value.toString();
  197. }
  198. }
  199. } else {
  200. this.editWidget.text = "--";
  201. }
  202. }
  203. handleUIWidgetEditCompleteEvent(ev) {
  204. // non-enum
  205. this.editType.onAttributeInfoEdited(this.attrInfo, Number(this.editWidget.text));
  206. this.refresh();
  207. }
  208. handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
  209. if (ev.type == Atomic.UI_EVENT_TYPE_CHANGED) {
  210. return true;
  211. }
  212. if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
  213. var id = this.attrInfo.name + " enum popup";
  214. if (ev.target.id == id) {
  215. this.editType.onAttributeInfoEdited(this.attrInfo, Number(ev.refid) - 1);
  216. this.refresh();
  217. }
  218. else if (this.editWidget == ev.target && this.attrInfo.enumNames.length) {
  219. if (this.enumSource) {
  220. var menu = new Atomic.UIMenuWindow(ev.target, id);
  221. menu.show(this.enumSource);
  222. }
  223. return true;
  224. }
  225. }
  226. return false;
  227. }
  228. }
  229. class FloatAttributeEdit extends AttributeInfoEdit {
  230. createEditWidget() {
  231. var attrInfo = this.attrInfo;
  232. var field = new Atomic.UIEditField();
  233. field.textAlign = Atomic.UI_TEXT_ALIGN_CENTER;
  234. field.skinBg = "TBAttrEditorField";;
  235. field.fontDescription = AttributeInfoEdit.fontDesc;
  236. var lp = new Atomic.UILayoutParams();
  237. lp.width = 140;
  238. field.layoutParams = lp;
  239. field.subscribeToEvent(field, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
  240. this.editWidget = field;
  241. }
  242. refresh() {
  243. var uniform = this.editType.getUniformValue(this.attrInfo);
  244. if (uniform) {
  245. var object = this.editType.getFirstObject();
  246. if (object) {
  247. var widget = this.editWidget;
  248. var attrInfo = this.attrInfo;
  249. var value = object.getAttribute(attrInfo.name);
  250. if (value == undefined) {
  251. console.log("WARNING: Undefined value for object: ", this.editType.typeName + "." + attrInfo.name);
  252. widget.text = "???";
  253. } else {
  254. widget.text = parseFloat(value.toFixed(5)).toString();
  255. }
  256. }
  257. } else {
  258. this.editWidget.text = "--";
  259. }
  260. }
  261. handleUIWidgetEditCompleteEvent(ev) {
  262. this.editType.onAttributeInfoEdited(this.attrInfo, Number(this.editWidget.text));
  263. this.refresh();
  264. }
  265. handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
  266. if (ev.type == Atomic.UI_EVENT_TYPE_CHANGED) {
  267. return true;
  268. }
  269. return false;
  270. }
  271. }
  272. class NumberArrayAttributeEdit extends AttributeInfoEdit {
  273. selects: Atomic.UIInlineSelect[] = [];
  274. private numElements: number;
  275. constructor(numElements: number) {
  276. super();
  277. this.numElements = numElements;
  278. }
  279. createEditWidget() {
  280. var attrInfo = this.attrInfo;
  281. var layout = new Atomic.UILayout();
  282. layout.spacing = 0;
  283. var lp = new Atomic.UILayoutParams();
  284. lp.width = this.numElements != 4 ? 100 : 70;
  285. for (var i = 0; i < this.numElements; i++) {
  286. var select = new Atomic.UIInlineSelect();
  287. this.selects.push(select);
  288. select.id = String(i + 1);
  289. select.fontDescription = AttributeInfoEdit.fontDesc;
  290. select.skinBg = "InspectorVectorAttrName";
  291. select.setLimits(-10000000, 10000000);
  292. if (this.numElements != 4) {
  293. var editlp = new Atomic.UILayoutParams();
  294. editlp.minWidth = 60;
  295. select.editFieldLayoutParams = editlp;
  296. }
  297. select.layoutParams = lp;
  298. layout.addChild(select);
  299. select["_edit"] = select.getWidget("edit");
  300. select["_dec"] = select.getWidget("dec");
  301. select["_inc"] = select.getWidget("inc");
  302. select.subscribeToEvent(select, "WidgetEvent", (ev) => this.handleWidgetEvent(ev));
  303. select.subscribeToEvent(select, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
  304. }
  305. this.editWidget = layout;
  306. }
  307. refresh() {
  308. for (var i in this.selects) {
  309. var select = this.selects[i];
  310. if (select["_edit"].focus || select["_dec"].captured || select["_inc"].captured)
  311. continue;
  312. var uniform = this.editType.getUniformValue(this.attrInfo, i);
  313. if (uniform) {
  314. var object = this.editType.getFirstObject();
  315. if (object) {
  316. var value = object.getAttribute(this.attrInfo.name);
  317. select.value = parseFloat(value[i].toFixed(5));
  318. }
  319. } else {
  320. select["_edit"].text = "--";
  321. }
  322. }
  323. }
  324. handleUIWidgetEditCompleteEvent(ev: Atomic.UIWidgetEditCompleteEvent) {
  325. var index = Number(ev.widget.id) - 1;
  326. this.editType.onAttributeInfoEdited(this.attrInfo, ev.widget.value, index);
  327. this.refresh();
  328. }
  329. handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
  330. if (ev.type == Atomic.UI_EVENT_TYPE_CHANGED) {
  331. var captured = false;
  332. for (var i in this.selects) {
  333. var select = this.selects[i];
  334. if (select["_dec"].captured || select["_inc"].captured) {
  335. captured = true;
  336. break;
  337. }
  338. }
  339. if (captured) {
  340. var index = Number(ev.target.id) - 1;
  341. this.editType.onAttributeInfoEdited(this.attrInfo, ev.target.value, index, false);
  342. }
  343. return true;
  344. }
  345. return false;
  346. }
  347. }
  348. class Vector2AttributeEdit extends NumberArrayAttributeEdit {
  349. constructor() {
  350. super(2);
  351. }
  352. }
  353. class Vector3AttributeEdit extends NumberArrayAttributeEdit {
  354. constructor() {
  355. super(3);
  356. }
  357. }
  358. class QuaternionAttributeEdit extends NumberArrayAttributeEdit {
  359. constructor() {
  360. super(3);
  361. }
  362. }
  363. class ColorAttributeEdit extends NumberArrayAttributeEdit {
  364. constructor() {
  365. super(4);
  366. }
  367. }
  368. class ResourceRefAttributeEdit extends AttributeInfoEdit {
  369. refListIndex: number;
  370. editField: Atomic.UIEditField;
  371. constructor(refListIndex: number = -1) {
  372. super();
  373. this.refListIndex = refListIndex;
  374. }
  375. onResourceChanged(resource: Atomic.Resource) {
  376. var parent = this.parent;
  377. while (parent) {
  378. if (parent.typeName == "UISection") {
  379. break;
  380. }
  381. parent = parent.parent;
  382. }
  383. if (parent) {
  384. parent.sendEvent("AttributeEditResourceChanged", { attrInfoEdit: this, resource: resource});
  385. }
  386. }
  387. initialize(editType: SerializableEditType, attrInfo: Atomic.AttributeInfo): boolean {
  388. if (!attrInfo.resourceTypeName)
  389. return false;
  390. if (this.refListIndex >= 0)
  391. this.nameOverride = attrInfo.resourceTypeName + " " + this.refListIndex;
  392. var importerName = ToolCore.assetDatabase.getResourceImporterName(attrInfo.resourceTypeName);
  393. if (!importerName)
  394. return false;
  395. return super.initialize(editType, attrInfo);
  396. }
  397. refresh() {
  398. var uniform = this.editType.getUniformValue(this.attrInfo, this.refListIndex);
  399. if (uniform) {
  400. var object = this.editType.getFirstObject();
  401. if (object) {
  402. // for cached resources, use the asset name, otherwise use the resource path name
  403. var resource: Atomic.Resource;
  404. if (this.refListIndex != -1) {
  405. resource = object.getAttribute(this.attrInfo.name).resources[this.refListIndex];
  406. } else {
  407. resource = <Atomic.Resource>object.getAttribute(this.attrInfo.name);
  408. }
  409. var text = "";
  410. if (resource) {
  411. text = resource.name;
  412. var asset = ToolCore.assetDatabase.getAssetByCachePath(resource.name);
  413. if (asset)
  414. text = asset.name;
  415. }
  416. this.editField.text = text;
  417. }
  418. } else {
  419. this.editField.text = "--";
  420. }
  421. }
  422. createEditWidget() {
  423. var layout = new Atomic.UILayout();
  424. var o = InspectorUtils.createAttrEditFieldWithSelectButton("", layout);
  425. this.editField = o.editField;
  426. layout.layoutSize = Atomic.UI_LAYOUT_SIZE_AVAILABLE;
  427. layout.gravity = Atomic.UI_GRAVITY_LEFT_RIGHT;
  428. layout.layoutDistribution = Atomic.UI_LAYOUT_DISTRIBUTION_GRAVITY;
  429. var lp = new Atomic.UILayoutParams();
  430. lp.width = 140;
  431. o.editField.layoutParams = lp;
  432. o.editField.readOnly = true;
  433. this.editWidget = layout;
  434. var selectButton = o.selectButton;
  435. var resourceTypeName = this.attrInfo.resourceTypeName;
  436. var importerName = ToolCore.assetDatabase.getResourceImporterName(resourceTypeName);
  437. selectButton.onClick = () => {
  438. EditorUI.getModelOps().showResourceSelection("Select " + resourceTypeName + " Resource", importerName, function(asset: ToolCore.Asset) {
  439. var resource = asset.getResource(resourceTypeName);
  440. this.editType.onAttributeInfoEdited(this.attrInfo, resource, this.refListIndex);
  441. this.onResourceChanged(resource);
  442. this.refresh();
  443. }.bind(this));
  444. }
  445. // handle dropping of component on field
  446. this.editField.subscribeToEvent(this.editField, "DragEnded", (ev: Atomic.DragEndedEvent) => {
  447. if (ev.target == o.editField) {
  448. var dragObject = ev.dragObject;
  449. var importer;
  450. if (dragObject.object && dragObject.object.typeName == "Asset") {
  451. var asset = <ToolCore.Asset>dragObject.object;
  452. if (asset.importerTypeName == importerName) {
  453. importer = asset.importer;
  454. }
  455. }
  456. if (importer) {
  457. var resource = asset.getResource(resourceTypeName);
  458. this.editType.onAttributeInfoEdited(this.attrInfo, resource, this.refListIndex);
  459. this.onResourceChanged(resource);
  460. this.refresh();
  461. }
  462. }
  463. });
  464. }
  465. }
  466. class ResourceRefListAttributeEdit extends AttributeInfoEdit {
  467. layout: Atomic.UILayout;
  468. refEdits: ResourceRefAttributeEdit[] = [];
  469. initialize(editType: SerializableEditType, attrInfo: Atomic.AttributeInfo): boolean {
  470. return super.initialize(editType, attrInfo);
  471. }
  472. createRefEdit(index: number) {
  473. var refEdit = new ResourceRefAttributeEdit(index);
  474. refEdit.initialize(this.editType, this.attrInfo);
  475. this.layout.addChild(refEdit);
  476. this.refEdits.push(refEdit);
  477. }
  478. createEditWidget() {
  479. this.spacing = 0;
  480. var layout = this.layout = new Atomic.UILayout();
  481. layout.axis = Atomic.UI_AXIS_Y;
  482. layout.spacing = 2;
  483. layout.layoutSize = Atomic.UI_LAYOUT_SIZE_AVAILABLE;
  484. layout.gravity = Atomic.UI_GRAVITY_LEFT_RIGHT;
  485. layout.layoutDistribution = Atomic.UI_LAYOUT_DISTRIBUTION_GRAVITY;
  486. var lp = new Atomic.UILayoutParams();
  487. lp.width = 304;
  488. layout.layoutParams = lp;
  489. this.editWidget = layout;
  490. }
  491. createLayout() {
  492. this.createEditWidget();
  493. this.editWidget.subscribeToEvent(this.editWidget, "WidgetEvent", (data) => this.handleWidgetEvent(data));
  494. this.addChild(this.editWidget);
  495. }
  496. refresh() {
  497. var editType = this.editType;
  498. var object = this.editType.getFirstObject();
  499. if (!object) {
  500. this.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
  501. return;
  502. }
  503. this.visibility = Atomic.UI_WIDGET_VISIBILITY_VISIBLE;
  504. var maxLength = -1;
  505. var i;
  506. for (i in editType.objects) {
  507. object = editType.objects[i];
  508. var value = object.getAttribute(this.attrInfo.name);
  509. if (value.resources.length > maxLength) {
  510. maxLength = value.resources.length;
  511. }
  512. }
  513. if (maxLength == -1) {
  514. this.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
  515. return;
  516. }
  517. for (i = this.refEdits.length; i < maxLength; i++) {
  518. this.createRefEdit(i);
  519. }
  520. for (i = 0; i < this.refEdits.length; i++) {
  521. var refEdit = this.refEdits[i];
  522. if (i < maxLength) {
  523. refEdit.visibility = Atomic.UI_WIDGET_VISIBILITY_VISIBLE;
  524. refEdit.refresh();
  525. }
  526. else {
  527. refEdit.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
  528. }
  529. }
  530. }
  531. }
  532. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_BOOL] = BoolAttributeEdit;
  533. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_INT] = IntAttributeEdit;
  534. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_FLOAT] = FloatAttributeEdit;
  535. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_STRING] = StringAttributeEdit;
  536. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_VECTOR2] = Vector2AttributeEdit;
  537. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_VECTOR3] = Vector3AttributeEdit;
  538. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_QUATERNION] = QuaternionAttributeEdit;
  539. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_COLOR] = ColorAttributeEdit;
  540. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_RESOURCEREF] = ResourceRefAttributeEdit;
  541. AttributeInfoEdit.standardAttrEditTypes[Atomic.VAR_RESOURCEREFLIST] = ResourceRefListAttributeEdit;
  542. export = AttributeInfoEdit;