1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- /** @format */
- import {UI} from '../enums/UI'
- import {BaseUI} from './BaseUI'
- import {Data, Mgr} from '../GameControl'
- import {ccUtils} from '../utils/ccUtils'
- import {observer, render, node, label, editBox, list} from '../mobx/observer'
- import {msgCmd} from '../proto/msg_cmd'
- import {IUserGuide} from '../interface/UIInterface'
- import {FunctionsConfig} from '../config/FunctionsConfig'
- import {EVENT} from '../enums/Enum'
- const {ccclass, property} = cc._decorator
- @ccclass
- @observer
- export class ModOpenUI extends BaseUI {
- @node('layout/item')
- item: cc.Node
- callback: Function
- onShow(args: IUserGuide, fromUI: number) {
- this.callback = args.callback
- let modIDs = args.path.split('_')
- let nodes = ccUtils.instantChildren(this.item, modIDs.length)
- for (let i = 0; i < modIDs.length; i++) {
- let cfg = FunctionsConfig[modIDs[i]]
- ccUtils.setLabel(cfg.name, nodes[i], 'name')
- this.loadTexImg(`Public/modeIcon/${cfg.icon}`, nodes[i], 'icon')
- cc.tween(cc.find('effect', nodes[i])).by(-1, {angle: -1}).repeatForever().start()
- }
- }
- onHide(): any {
- Mgr.event.removeAll(this)
- this.callback && this.callback()
- if (!Mgr.global.curGuideStep) Mgr.event.trigger(EVENT.mainPopAnyUI)
- }
- //UI或者其他函数=======================================
- //网络事件=======================================
- //触发事件=======================================
- // 点击事件=======================================
- }
|