FootCell.ts 693 B

1234567891011121314151617181920212223242526
  1. /** @format */
  2. import {UI} from '../enums/UI'
  3. import {Data, Mgr} from '../GameControl'
  4. import {ccUtils} from '../utils/ccUtils'
  5. import {observer, render, node, label, editBox, list} from '../mobx/observer'
  6. import {BaseUI} from '../ui/BaseUI'
  7. const {ccclass, property} = cc._decorator
  8. @ccclass
  9. @observer
  10. export class FootCell extends cc.Component {
  11. @node('toggles')
  12. toggles: cc.Node
  13. mods: UI[] = [0, UI.RoleUI, UI.MainUI, UI.TalentUI, 0]
  14. init(baseUI: BaseUI) {
  15. ccUtils.setTogglesChecked(this.mods.indexOf(baseUI.uiID), this.toggles)
  16. }
  17. onToggleClick(e) {
  18. let ui = this.mods[e.target.parent.indexOf(e.target)]
  19. Mgr.global.tryJumpMod(ui)
  20. }
  21. }