123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410 |
- System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9", "__unresolved_10", "__unresolved_11", "__unresolved_12"], function (_export, _context) {
- "use strict";
- var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Node, Label, Animation, List, Utils, MsgHints, userIns, BaseExp, autoBind, Constants, uiMgr, TaskItem, stateMgr, Game, i18n, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _crd, ccclass, property, Main;
- 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 _reportPossibleCrUseOfList(extras) {
- _reporterNs.report("List", "../third/List", _context.meta, extras);
- }
- function _reportPossibleCrUseOfUtils(extras) {
- _reporterNs.report("Utils", "../utils/Utils", _context.meta, extras);
- }
- function _reportPossibleCrUseOfMsgHints(extras) {
- _reporterNs.report("MsgHints", "../utils/MsgHints", _context.meta, extras);
- }
- function _reportPossibleCrUseOfuserIns(extras) {
- _reporterNs.report("userIns", "../data/UserData", _context.meta, extras);
- }
- function _reportPossibleCrUseOfBaseExp(extras) {
- _reporterNs.report("BaseExp", "../core/base/BaseExp", _context.meta, extras);
- }
- function _reportPossibleCrUseOfautoBind(extras) {
- _reporterNs.report("autoBind", "../extend/AutoBind", _context.meta, extras);
- }
- function _reportPossibleCrUseOfConstants(extras) {
- _reporterNs.report("Constants", "../data/Constants", _context.meta, extras);
- }
- function _reportPossibleCrUseOfuiMgr(extras) {
- _reporterNs.report("uiMgr", "../core/manager/UIManager", _context.meta, extras);
- }
- function _reportPossibleCrUseOfTaskItem(extras) {
- _reporterNs.report("TaskItem", "../items/item/TaskItem", _context.meta, extras);
- }
- function _reportPossibleCrUseOfstateMgr(extras) {
- _reporterNs.report("stateMgr", "../core/manager/StateManager", _context.meta, extras);
- }
- function _reportPossibleCrUseOfGame(extras) {
- _reporterNs.report("Game", "../game/Game", _context.meta, extras);
- }
- function _reportPossibleCrUseOfi18n(extras) {
- _reporterNs.report("i18n", "../core/i18n/runtime-scripts/LanguageData", _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;
- Animation = _cc.Animation;
- }, function (_unresolved_2) {
- List = _unresolved_2.default;
- }, function (_unresolved_3) {
- Utils = _unresolved_3.Utils;
- }, function (_unresolved_4) {
- MsgHints = _unresolved_4.default;
- }, function (_unresolved_5) {
- userIns = _unresolved_5.userIns;
- }, function (_unresolved_6) {
- BaseExp = _unresolved_6.BaseExp;
- }, function (_unresolved_7) {
- autoBind = _unresolved_7.autoBind;
- }, function (_unresolved_8) {
- Constants = _unresolved_8.Constants;
- }, function (_unresolved_9) {
- uiMgr = _unresolved_9.uiMgr;
- }, function (_unresolved_10) {
- TaskItem = _unresolved_10.TaskItem;
- }, function (_unresolved_11) {
- stateMgr = _unresolved_11.stateMgr;
- }, function (_unresolved_12) {
- Game = _unresolved_12.Game;
- }, function (_unresolved_13) {
- i18n = _unresolved_13.default;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "534c6zwQJ5OqoEYReOC1WY6", "Main", undefined);
- __checkObsolete__(['_decorator', 'EventTouch', 'Node', 'Label', 'Animation', 'Vec3']);
- ({
- ccclass,
- property
- } = _decorator);
- _export("Main", Main = (_dec = ccclass('Main'), _dec2 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Label,
- 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: Label,
- tooltip: "任务描述"
- }), _dec5 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Label,
- tooltip: "关卡等级"
- }), _dec6 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: _crd && List === void 0 ? (_reportPossibleCrUseOfList({
- error: Error()
- }), List) : List,
- tooltip: "任务数据"
- }), _dec7 = property({
- type: Animation,
- tooltip: "进入游戏动画"
- }), _dec8 = property({
- type: [Node],
- tooltip: "动画位置节点数组"
- }), _dec(_class = (_class2 = class Main extends (_crd && BaseExp === void 0 ? (_reportPossibleCrUseOfBaseExp({
- error: Error()
- }), BaseExp) : BaseExp) {
- constructor() {
- super(...arguments);
- _initializerDefineProperty(this, "gold_lable", _descriptor, this);
- _initializerDefineProperty(this, "diamond_lable", _descriptor2, this);
- _initializerDefineProperty(this, "task_des_lable", _descriptor3, this);
- _initializerDefineProperty(this, "level_lable", _descriptor4, this);
- _initializerDefineProperty(this, "task_scrollView", _descriptor5, this);
- _initializerDefineProperty(this, "enterAnim", _descriptor6, this);
- _initializerDefineProperty(this, "animPosArr", _descriptor7, this);
- //所有主要页面
- this.sceneNames = [(_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).mainUIs.main];
- //tabBars数组下标
- this._tabBarIndex = -1;
- //保存点击的页面
- this.preIndexs = [0];
- //任务数据
- this.taskDatas = [];
- //属性存储初始位置
- this.originalPositions = [];
- }
- set tabBarIndex(index) {
- this.cutTabBarIndex(null, index);
- }
- get tabBarIndex() {
- return this._tabBarIndex;
- }
- start() {
- this.hasAnim = false;
- this.closeOnBlank = false; //存储初始位置到类属性
- this.originalPositions = this.animPosArr.map(e => e.position.clone());
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).panels.set((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).mainUIs.main, this.node); //注册动态变化值
- (_crd && stateMgr === void 0 ? (_reportPossibleCrUseOfstateMgr({
- error: Error()
- }), stateMgr) : stateMgr).registerUI((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).gold, this.gold_lable);
- (_crd && stateMgr === void 0 ? (_reportPossibleCrUseOfstateMgr({
- error: Error()
- }), stateMgr) : stateMgr).registerUI((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).diamond, this.diamond_lable); //加载数据
- this.loadData(); //注册事件
- this.node.on(Node.EventType.TOUCH_START, this.playBtn.bind(this), this);
- }
- /**
- * 加载数据
- */
- loadData() {
- var data = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).getCurLevelData();
- if (!data) return; //设置任务描述关卡任务:%{value}
- this.task_des_lable.string = (_crd && i18n === void 0 ? (_reportPossibleCrUseOfi18n({
- error: Error()
- }), i18n) : i18n).isZh ? data.task : data.task_lang;
- this.level_lable.string = (_crd && i18n === void 0 ? (_reportPossibleCrUseOfi18n({
- error: Error()
- }), i18n) : i18n)("main.关卡任务:%{value}", {
- value: data.id
- });
- this.taskDatas = []; //拆分并处理每个敌人配置
- data.dispose.split('|').forEach(item => {
- var [enemyId, count] = item.split('_').map(Number);
- var enemyData = (_crd && Utils === void 0 ? (_reportPossibleCrUseOfUtils({
- error: Error()
- }), Utils) : Utils).clone((_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).enemyTable).find(e => e.id === enemyId);
- enemyData.count = count;
- this.taskDatas.push(enemyData);
- });
- if (this.taskDatas.length <= 0) return;
- this.task_scrollView.numItems = this.taskDatas.length;
- }
- /**
- * 任务数据
- * @param item item节点
- * @param idx 数据下标
- */
- setTaskItemData(item, idx) {
- var task = this.taskDatas[idx];
- item.getComponent(_crd && TaskItem === void 0 ? (_reportPossibleCrUseOfTaskItem({
- error: Error()
- }), TaskItem) : TaskItem).init(task);
- }
- /**
- * 开始游戏
- */
- playBtn() {
- this.enterAnim.play();
- this.scheduleOnce(() => {
- (_crd && Game === void 0 ? (_reportPossibleCrUseOfGame({
- error: Error()
- }), Game) : Game).I.isPause = false;
- (_crd && Game === void 0 ? (_reportPossibleCrUseOfGame({
- error: Error()
- }), Game) : Game).I.isGameOver = false;
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).hide((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).mainUIs.main, () => {
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).show((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.gunfightShootUI);
- }); //加载敌人
- (_crd && Game === void 0 ? (_reportPossibleCrUseOfGame({
- error: Error()
- }), Game) : Game).I.buildEnemys.loadLevelEnemys();
- }, 0.4);
- }
- /**
- * 点击事件
- * @param event 事件
- * @param customEventData 数据
- */
- onBtnClicked(event, customEventData) {
- super.onBtnClicked(event, customEventData);
- var btnName = event.target.name;
- if (btnName === 'set_btn') {
- // 设置页面
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).show((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.settingUI);
- } else if (btnName === 'shop_btn') {
- //商店
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).show((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.storeUI);
- } else if (btnName === 'arsenal_btn') {
- //武器库
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).show((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.arsenalUI);
- } else if (btnName === 'boomerang_btn') {
- //扔飞镖
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).show((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.tossBoomerangUI);
- } else if (btnName === 'ads_free_btn') {
- //免广告按钮
- (_crd && MsgHints === void 0 ? (_reportPossibleCrUseOfMsgHints({
- error: Error()
- }), MsgHints) : MsgHints).show('免广告按钮');
- } else if (btnName === 'bulls_eye_btn') {
- //准心开始按钮
- this.playBtn();
- }
- }
- /**
- * 切换游戏主页面
- * @param idx
- */
- cutTabBarIndex(event, param) {
- var index = parseInt(param);
- this._tabBarIndex = index;
- this.preIndexs.push(index); //设置层级
- var path = this.sceneNames[index];
- if (path == (_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).mainUIs.main) {
- this.animPosArr.forEach((e, index) => e.position = this.originalPositions[index]);
- } //加载页面
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).show(path);
- if (this.preIndexs.length > 2) {
- this.preIndexs.shift();
- }
- }
- }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "gold_lable", [_dec2], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "diamond_lable", [_dec3], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "task_des_lable", [_dec4], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "level_lable", [_dec5], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "task_scrollView", [_dec6], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "enterAnim", [_dec7], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "animPosArr", [_dec8], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: function initializer() {
- return [];
- }
- })), _class2)) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=2efeef402d71ac0671decf5095bbb112f5b4027a.js.map
|