3b9130dfce14c86a7162372c4663262b547285d6.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Node, Label, Sprite, Tween, tween, Vec3, BaseExp, autoBind, userIns, Constants, uiMgr, ResUtil, i18n, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _crd, ccclass, property, SuccessUI;
  4. function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
  5. function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
  6. function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
  7. function _reportPossibleCrUseOfBaseExp(extras) {
  8. _reporterNs.report("BaseExp", "../core/base/BaseExp", _context.meta, extras);
  9. }
  10. function _reportPossibleCrUseOfautoBind(extras) {
  11. _reporterNs.report("autoBind", "../extend/AutoBind", _context.meta, extras);
  12. }
  13. function _reportPossibleCrUseOfuserIns(extras) {
  14. _reporterNs.report("userIns", "../data/UserData", _context.meta, extras);
  15. }
  16. function _reportPossibleCrUseOfConstants(extras) {
  17. _reporterNs.report("Constants", "../data/Constants", _context.meta, extras);
  18. }
  19. function _reportPossibleCrUseOfuiMgr(extras) {
  20. _reporterNs.report("uiMgr", "../core/manager/UIManager", _context.meta, extras);
  21. }
  22. function _reportPossibleCrUseOfResUtil(extras) {
  23. _reporterNs.report("ResUtil", "../utils/ResUtil", _context.meta, extras);
  24. }
  25. function _reportPossibleCrUseOfi18n(extras) {
  26. _reporterNs.report("i18n", "../core/i18n/runtime-scripts/LanguageData", _context.meta, extras);
  27. }
  28. return {
  29. setters: [function (_unresolved_) {
  30. _reporterNs = _unresolved_;
  31. }, function (_cc) {
  32. _cclegacy = _cc.cclegacy;
  33. __checkObsolete__ = _cc.__checkObsolete__;
  34. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  35. _decorator = _cc._decorator;
  36. Node = _cc.Node;
  37. Label = _cc.Label;
  38. Sprite = _cc.Sprite;
  39. Tween = _cc.Tween;
  40. tween = _cc.tween;
  41. Vec3 = _cc.Vec3;
  42. }, function (_unresolved_2) {
  43. BaseExp = _unresolved_2.BaseExp;
  44. }, function (_unresolved_3) {
  45. autoBind = _unresolved_3.autoBind;
  46. }, function (_unresolved_4) {
  47. userIns = _unresolved_4.userIns;
  48. }, function (_unresolved_5) {
  49. Constants = _unresolved_5.Constants;
  50. }, function (_unresolved_6) {
  51. uiMgr = _unresolved_6.uiMgr;
  52. }, function (_unresolved_7) {
  53. ResUtil = _unresolved_7.ResUtil;
  54. }, function (_unresolved_8) {
  55. i18n = _unresolved_8.default;
  56. }],
  57. execute: function () {
  58. _crd = true;
  59. _cclegacy._RF.push({}, "82bdafbov1NI4pcI+yBlNAb", "SuccessUI", undefined);
  60. __checkObsolete__(['_decorator', 'Node', 'Label', 'Sprite', 'EventTouch', 'Tween', 'tween', 'Vec3']);
  61. ({
  62. ccclass,
  63. property
  64. } = _decorator);
  65. _export("SuccessUI", SuccessUI = (_dec = ccclass('SuccessUI'), _dec2 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
  66. error: Error()
  67. }), autoBind) : autoBind)({
  68. type: Node,
  69. tooltip: "旋转光节点"
  70. }), _dec3 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
  71. error: Error()
  72. }), autoBind) : autoBind)({
  73. type: Sprite,
  74. tooltip: "获得的物品图片"
  75. }), _dec4 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
  76. error: Error()
  77. }), autoBind) : autoBind)({
  78. type: Sprite,
  79. tooltip: "获得的物品图片缩影"
  80. }), _dec5 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
  81. error: Error()
  82. }), autoBind) : autoBind)({
  83. type: Label,
  84. tooltip: "获得的物品的名字"
  85. }), _dec6 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
  86. error: Error()
  87. }), autoBind) : autoBind)({
  88. type: Label,
  89. tooltip: "描述文字"
  90. }), _dec7 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
  91. error: Error()
  92. }), autoBind) : autoBind)({
  93. type: Node,
  94. tooltip: "底部提交确认按钮"
  95. }), _dec8 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
  96. error: Error()
  97. }), autoBind) : autoBind)({
  98. type: Node,
  99. tooltip: "拥有状态"
  100. }), _dec(_class = (_class2 = class SuccessUI extends (_crd && BaseExp === void 0 ? (_reportPossibleCrUseOfBaseExp({
  101. error: Error()
  102. }), BaseExp) : BaseExp) {
  103. constructor() {
  104. super(...arguments);
  105. _initializerDefineProperty(this, "rotation_light", _descriptor, this);
  106. _initializerDefineProperty(this, "obtain_good", _descriptor2, this);
  107. _initializerDefineProperty(this, "good_sy_sp", _descriptor3, this);
  108. _initializerDefineProperty(this, "name_lable", _descriptor4, this);
  109. _initializerDefineProperty(this, "dec_lable", _descriptor5, this);
  110. _initializerDefineProperty(this, "confim_btn", _descriptor6, this);
  111. _initializerDefineProperty(this, "owned_lable", _descriptor7, this);
  112. //奖励的数据
  113. this.data = null;
  114. //奖励的id
  115. this.id = '';
  116. //回调函数
  117. this.cb = null;
  118. }
  119. start() {
  120. this.closeOnBlank = false;
  121. }
  122. show() {
  123. this.id = arguments.length <= 0 ? undefined : arguments[0];
  124. this.cb = arguments.length <= 1 ? undefined : arguments[1];
  125. this.hasAnim = true; //加载数据ui
  126. this.ui();
  127. }
  128. /**
  129. * 加载数据ui
  130. */
  131. ui() {
  132. //获得的光圈一直旋转
  133. Tween.stopAllByTarget(this.rotation_light);
  134. tween(this.rotation_light).by(2, {
  135. eulerAngles: new Vec3(0, 0, -360)
  136. }).repeatForever().start();
  137. this.data = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
  138. error: Error()
  139. }), userIns) : userIns).boomerangTable.find(e => e.id == this.id); //设置图片
  140. (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
  141. error: Error()
  142. }), ResUtil) : ResUtil).setSpriteFrame(this.data.icon, this.obtain_good); //设置图片缩影
  143. (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
  144. error: Error()
  145. }), ResUtil) : ResUtil).setSpriteFrame(this.data.s_icon, this.good_sy_sp); //设置名字
  146. this.name_lable.string = (_crd && i18n === void 0 ? (_reportPossibleCrUseOfi18n({
  147. error: Error()
  148. }), i18n) : i18n).isZh ? this.data.name : this.data.name_lang; //设置描述
  149. this.dec_lable.string = (_crd && i18n === void 0 ? (_reportPossibleCrUseOfi18n({
  150. error: Error()
  151. }), i18n) : i18n).isZh ? this.data.description : this.data.dec_lang;
  152. var [gun_id, num] = this.data.quantity.split('_');
  153. if (gun_id == 1001 || gun_id == 1002) {
  154. //金币和钻石
  155. this.owned_lable.active = false;
  156. this.confim_btn.active = false; //是金币和钻石自动关闭
  157. this.scheduleOnce(() => {
  158. (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
  159. error: Error()
  160. }), uiMgr) : uiMgr).hide((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
  161. error: Error()
  162. }), Constants) : Constants).popUIs.obtainUI, this.cb);
  163. }, 2);
  164. } else {
  165. this.confim_btn.active = true; //是解锁的枪 这儿需要判断是否已经拥有的了这把枪 如果已经拥有了这把枪 就转换成钻石和金币
  166. if ((_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
  167. error: Error()
  168. }), userIns) : userIns).isHasGun(gun_id)) {
  169. //拥有这把枪转换成金币
  170. this.owned_lable.active = true;
  171. var [good_id, amount] = this.data.value.split('_');
  172. var sData = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
  173. error: Error()
  174. }), userIns) : userIns).itemTable.find(e => e.id == good_id);
  175. this.dec_lable.string = "Already owned " + this.data.name_lang + ", converted " + amount + " " + sData.name_lang;
  176. } else {
  177. this.owned_lable.active = false;
  178. }
  179. }
  180. }
  181. /**
  182. * 按钮点击事件
  183. * @param event 事件
  184. * @param param 参数
  185. */
  186. onBtnClicked(event, param) {
  187. var btnName = event.target.name;
  188. if (btnName === 'confim_btn' || btnName === 'close_btn') {
  189. this.unscheduleAllCallbacks();
  190. (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
  191. error: Error()
  192. }), uiMgr) : uiMgr).hide((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
  193. error: Error()
  194. }), Constants) : Constants).popUIs.obtainUI, this.cb);
  195. }
  196. }
  197. }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "rotation_light", [_dec2], {
  198. configurable: true,
  199. enumerable: true,
  200. writable: true,
  201. initializer: null
  202. }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "obtain_good", [_dec3], {
  203. configurable: true,
  204. enumerable: true,
  205. writable: true,
  206. initializer: null
  207. }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "good_sy_sp", [_dec4], {
  208. configurable: true,
  209. enumerable: true,
  210. writable: true,
  211. initializer: null
  212. }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "name_lable", [_dec5], {
  213. configurable: true,
  214. enumerable: true,
  215. writable: true,
  216. initializer: null
  217. }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "dec_lable", [_dec6], {
  218. configurable: true,
  219. enumerable: true,
  220. writable: true,
  221. initializer: null
  222. }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "confim_btn", [_dec7], {
  223. configurable: true,
  224. enumerable: true,
  225. writable: true,
  226. initializer: null
  227. }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "owned_lable", [_dec8], {
  228. configurable: true,
  229. enumerable: true,
  230. writable: true,
  231. initializer: null
  232. })), _class2)) || _class));
  233. _cclegacy._RF.pop();
  234. _crd = false;
  235. }
  236. };
  237. });
  238. //# sourceMappingURL=3b9130dfce14c86a7162372c4663262b547285d6.js.map