import MyModel from "../core/MyModel"; import SKUIUtil from "../gear_2.3.4/util/SKUIUtil"; import FGUtil, { TipAlign } from "../gear_2.3.4/fgui/FGUtil"; import SKSocket from "../gear_2.3.4/net/SKSocket"; import GameModel from "../core/GameModel"; import MsgAlert from "../game/msg/MsgAlert"; import SKDataUtil from "../gear_2.3.4/util/SKDataUtil"; import ItemUtil from "../core/ItemUtil"; import GameUtil from "../core/GameUtil"; import SkillUtil from "../game/skill/core/SkillUtil"; import SkillBase, { ESkillQuality } from "../game/skill/core/SkillBase"; import FGAlert from "../gear_2.3.4/fgui/FGAlert"; import SKLogger from "../gear_2.3.4/util/SKLogger"; import { LongPressSpeedProp } from "../core/EEnum"; export default class FuturePannel extends cc.Component { static shared = new FuturePannel(); main: fgui.GComponent; show() { this.loadUI(); } hide() { FGUtil.dispose(this.main); this.unscheduleAllCallbacks() this.main = null; } loadUI() { FGUtil.dispose(this.main); this.unscheduleAllCallbacks() this.main = fgui.UIPackage.createObject("main_ui", "home_jieju").asCom; FGUtil.root().addChild(this.main); FGUtil.fitScreen(this.main); this.initUI(); this.initEvent(); // this.loadHorseSkill();' } initUI(){ this.main.getChild("close").onClick(this.hide, this) FGUtil.getControl(this.main, "n12/ctrl_isshow").selectedIndex = 1 FGUtil.getControl(this.main, "n15/ctrl_isshow").selectedIndex = 1 } initEvent(){ let ctl = FGUtil.getControl(this.main, "ctrl_select") ctl.onChanged(this.changeSelect, this) ctl.selectedIndex = 0 this.changeSelect() } changeSelect(){ let ctl = FGUtil.getControl(this.main, "ctrl_select") let showCtl = FGUtil.getControl(this.main, "n2/ctrl_isshow") showCtl.selectedIndex = 0 if (ctl.selectedIndex == 0 || ctl.selectedIndex == 1){ showCtl.selectedIndex = 1 } } }