123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9"], function (_export, _context) {
- "use strict";
- var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Node, Label, BaseExp, List, autoBind, userIns, BoomerangItem, uiMgr, Constants, MsgHints, ITEM_TYPE, ResUtil, _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor, _descriptor2, _descriptor3, _crd, ccclass, property, BuyBoomerangUI;
- 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 }); }
- 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; }
- 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.'); }
- function _reportPossibleCrUseOfBaseExp(extras) {
- _reporterNs.report("BaseExp", "../core/base/BaseExp", _context.meta, extras);
- }
- function _reportPossibleCrUseOfList(extras) {
- _reporterNs.report("List", "../third/List", _context.meta, extras);
- }
- function _reportPossibleCrUseOfautoBind(extras) {
- _reporterNs.report("autoBind", "../extend/AutoBind", _context.meta, extras);
- }
- function _reportPossibleCrUseOfuserIns(extras) {
- _reporterNs.report("userIns", "../data/UserData", _context.meta, extras);
- }
- function _reportPossibleCrUseOfBoomerangItem(extras) {
- _reporterNs.report("BoomerangItem", "../items/item/BoomerangItem", _context.meta, extras);
- }
- function _reportPossibleCrUseOfuiMgr(extras) {
- _reporterNs.report("uiMgr", "../core/manager/UIManager", _context.meta, extras);
- }
- function _reportPossibleCrUseOfConstants(extras) {
- _reporterNs.report("Constants", "../data/Constants", _context.meta, extras);
- }
- function _reportPossibleCrUseOfTossBoomerangUI(extras) {
- _reporterNs.report("TossBoomerangUI", "./TossBoomerangUI", _context.meta, extras);
- }
- function _reportPossibleCrUseOfMsgHints(extras) {
- _reporterNs.report("MsgHints", "../utils/MsgHints", _context.meta, extras);
- }
- function _reportPossibleCrUseOfITEM_TYPE(extras) {
- _reporterNs.report("ITEM_TYPE", "../utils/ResUtil", _context.meta, extras);
- }
- function _reportPossibleCrUseOfResUtil(extras) {
- _reporterNs.report("ResUtil", "../utils/ResUtil", _context.meta, extras);
- }
- return {
- setters: [function (_unresolved_) {
- _reporterNs = _unresolved_;
- }, function (_cc) {
- _cclegacy = _cc.cclegacy;
- __checkObsolete__ = _cc.__checkObsolete__;
- __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
- _decorator = _cc._decorator;
- Node = _cc.Node;
- Label = _cc.Label;
- }, function (_unresolved_2) {
- BaseExp = _unresolved_2.BaseExp;
- }, function (_unresolved_3) {
- List = _unresolved_3.default;
- }, function (_unresolved_4) {
- autoBind = _unresolved_4.autoBind;
- }, function (_unresolved_5) {
- userIns = _unresolved_5.userIns;
- }, function (_unresolved_6) {
- BoomerangItem = _unresolved_6.BoomerangItem;
- }, function (_unresolved_7) {
- uiMgr = _unresolved_7.uiMgr;
- }, function (_unresolved_8) {
- Constants = _unresolved_8.Constants;
- }, function (_unresolved_9) {
- MsgHints = _unresolved_9.default;
- }, function (_unresolved_10) {
- ITEM_TYPE = _unresolved_10.ITEM_TYPE;
- ResUtil = _unresolved_10.ResUtil;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "fcacd+AOchJAajjIBQO0OZt", "BuyBoomerangUI", undefined);
- __checkObsolete__(['_decorator', 'Node', 'Label', 'EventTouch']);
- ({
- ccclass,
- property
- } = _decorator); //购买飞镖
- _export("BuyBoomerangUI", BuyBoomerangUI = (_dec = ccclass('BuyBoomerangUI'), _dec2 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: _crd && List === void 0 ? (_reportPossibleCrUseOfList({
- error: Error()
- }), List) : List,
- tooltip: "飞票列表"
- }), _dec3 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Label,
- tooltip: "飞镖个数文本"
- }), _dec4 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Node,
- tooltip: "飞镖按钮"
- }), _dec(_class = (_class2 = class BuyBoomerangUI extends (_crd && BaseExp === void 0 ? (_reportPossibleCrUseOfBaseExp({
- error: Error()
- }), BaseExp) : BaseExp) {
- constructor() {
- super(...arguments);
- _initializerDefineProperty(this, "prop_scrollView", _descriptor, this);
- _initializerDefineProperty(this, "boomerang_num_lable", _descriptor2, this);
- _initializerDefineProperty(this, "boomerang_btn", _descriptor3, this);
- //飞镖商店数据
- this.dartDatas = [];
- }
- show() {
- this.hasAnim = true;
- this.closeOnBlank = false;
- var toss = (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).getPageComponent((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.tossBoomerangUI);
- if (toss && toss.shoot_btn) {
- toss.shoot_btn.parent.active = false;
- } //设置飞镖个数
- this.boomerang_num_lable.string = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).data.boomerang;
- this.loadDartData();
- }
- /**
- * 飞镖商店数据
- */
- loadDartData() {
- this.dartDatas = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).boomerangShopTable;
- this.prop_scrollView.numItems = this.dartDatas.length;
- }
- /**
- * 设置飞镖商店数据
- * @param item item节点
- * @param idx 数据信息
- */
- setDartItemData(item, idx) {
- var com = item.getComponent(_crd && BoomerangItem === void 0 ? (_reportPossibleCrUseOfBoomerangItem({
- error: Error()
- }), BoomerangItem) : BoomerangItem);
- com.init(this.dartDatas[idx], this.buyClicked.bind(this));
- }
- /**
- * 购买飞镖
- */
- buyClicked(data, clikTarget) {
- var [id, num] = data.price_1.split("_");
- var sData = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).itemTable.find(e => e.id == id); //是否升级
- var isSucced = false;
- if (sData.id === 1001) {
- //金币钻石
- if ((_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).data.gold < num) {
- (_crd && MsgHints === void 0 ? (_reportPossibleCrUseOfMsgHints({
- error: Error()
- }), MsgHints) : MsgHints).show("Insufficient gold!");
- } else {
- (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).data.gold -= num;
- isSucced = true;
- }
- } else if (sData.id === 1002) {
- //钻石
- if ((_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).data.diamond < num) {
- (_crd && MsgHints === void 0 ? (_reportPossibleCrUseOfMsgHints({
- error: Error()
- }), MsgHints) : MsgHints).show("Insufficient diamonds!");
- } else {
- (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).data.diamond -= num;
- isSucced = true;
- }
- }
- if (isSucced) {
- (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
- error: Error()
- }), ResUtil) : ResUtil).flyAnim((_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
- error: Error()
- }), ITEM_TYPE) : ITEM_TYPE).Boomerang, clikTarget, this.boomerang_btn, data.quantity, 50, b => {});
- (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).data.boomerang += data.quantity; //设置飞镖个数
- this.boomerang_num_lable.string = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).data.boomerang;
- var toss = (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).getPageComponent((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.tossBoomerangUI);
- if (toss) {
- toss.setBoomerang();
- }
- }
- }
- /**
- * 按钮点击事件
- * @param event 事件
- * @param param 参数
- */
- onBtnClicked(event, param) {
- var btnName = event.target.name;
- if (btnName === 'close_btn') {
- var toss = (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).getPageComponent((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.tossBoomerangUI);
- if (toss && toss.shoot_btn) {
- toss.shoot_btn.parent.active = true;
- }
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).hide((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.buyBoomerangUI);
- }
- }
- }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "prop_scrollView", [_dec2], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "boomerang_num_lable", [_dec3], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "boomerang_btn", [_dec4], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- })), _class2)) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=8a36d34e259ef0ace0dadf9cac99728c2fd19455.js.map
|