skeletal-animation.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. const { template, $, update } = require('./base');
  2. exports.template = template;
  3. exports.$ = $;
  4. exports.update = update;
  5. exports.style = `
  6. .use_baked_animation_tips {
  7. color: #707070;
  8. }
  9. .use_baked_animation_tips_hidden {
  10. display: none;
  11. }
  12. `;
  13. function updateTipsState(parent, hidden) {
  14. let tips = parent.getElementsByClassName('use_baked_animation_tips')[0];
  15. if (!tips) {
  16. tips = document.createElement('ui-label');
  17. tips.value = `i18n:ENGINE.components.animation.use_baked_animation_tips`;
  18. tips.classList.add('use_baked_animation_tips', 'use_baked_animation_tips_hidden');
  19. parent.appendChild(tips);
  20. }
  21. if (hidden) {
  22. tips.classList.add('use_baked_animation_tips_hidden');
  23. } else {
  24. tips.classList.remove('use_baked_animation_tips_hidden');
  25. }
  26. return tips;
  27. }
  28. exports.elements = {
  29. useBakedAnimation: {
  30. update(element, dump) {
  31. updateTipsState(element, !dump.useBakedAnimation.value);
  32. }
  33. }
  34. };
  35. exports.ready = function() {
  36. this.elements = exports.elements;
  37. };
  38. exports.close = function() {}