GameUIView.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. e =
  5. (this && this.__decorate) ||
  6. function (t, e, i, s) {
  7. var o,
  8. a = arguments.length,
  9. n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
  10. if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
  11. else
  12. for (var r = t.length - 1; 0 <= r; r--)
  13. (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
  14. return 3 < a && n && Object.defineProperty(e, i, n), n;
  15. };
  16. Object.defineProperty(i, "__esModule", { value: !0 });
  17. const n = t("App"),
  18. s = t("BaseView"),
  19. r = t("EffectUtils"),
  20. m = t("CurrencyService"),
  21. c = t("NotificationConst"),
  22. MapService = t("MapService"),
  23. { ccclass: o, property: a, menu: l } = (t("ViewConst"), t("LayerManager"), cc._decorator);
  24. t = class extends s.default {
  25. constructor() {
  26. super(...arguments), (this.moneyBarList = []), (this.progressBar = null), (this.progressRedPoint = null);
  27. }
  28. open() {
  29. super.open();
  30. this.setProgress();
  31. }
  32. setProgress() {
  33. if (MapService.default.ins.curId >= 14) {
  34. console.error('当前大于14关卡 不显示');
  35. console.error('c.default.ins.curId', MapService.default.ins.curId);
  36. this.progressBar.node.active = false;
  37. this.updateProgress = () => { };
  38. }
  39. }
  40. initUI() {
  41. super.initUI();
  42. }
  43. close() {
  44. super.close();
  45. }
  46. playGetCoinAni(t, e = 0, i) {
  47. let s = this.moneyBarList[t];
  48. if (s) {
  49. const a = n.default.ViewManager.uiRoot;
  50. i = i ? a.convertToNodeSpaceAR(i) : cc.Vec2.ZERO;
  51. var o = s.convertToWorldSpaceAR(s.getChildByName("icon").position),
  52. o = a.convertToNodeSpaceAR(o);
  53. r.default.instance.playMoneyAni(i, o, t, a, e);
  54. } else Log.trace("找不到这个类型", t);
  55. }
  56. updateProgress(t) {
  57. (this.progressRedPoint.active = 1 <= t), (this.progressBar.progress = t);
  58. }
  59. onTouchStageUpgradeBtn() {
  60. n.default.ViewManager.open(19);
  61. }
  62. onTouchMapBtn() {
  63. n.default.ViewManager.open(20);
  64. // let t = 100000000
  65. // m.default.ins.moneyChange(t),
  66. // n.default.NotificationCenter.dispatch(c.NotificationConst.UPDATE_MONEY)
  67. }
  68. onTouchSettingBtn() {
  69. n.default.ViewManager.open(8);
  70. }
  71. onTouchAbilityBtn() {
  72. n.default.ViewManager.open(22);
  73. }
  74. onTouchShop() {
  75. n.default.ViewManager.open(7);
  76. }
  77. onTouchEquipment() {
  78. n.default.ViewManager.open(25);
  79. }
  80. onTouchMailIcon() {
  81. n.default.ViewManager.open(45);
  82. }
  83. onTouchRemoveAd() {
  84. n.default.ViewManager.open(53);
  85. }
  86. };
  87. (t.VIEW_INFO = { prefabName: "GameUIView", zIndex: 50, key: 4, dir: "gameUI" }),
  88. e([a([cc.Node])], t.prototype, "moneyBarList", void 0),
  89. e([a(cc.ProgressBar)], t.prototype, "progressBar", void 0),
  90. e([a(cc.Node)], t.prototype, "progressRedPoint", void 0),
  91. (t = e([o], t)),
  92. (i.default = t);