64 lines
1.8 KiB
TypeScript
64 lines
1.8 KiB
TypeScript
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";
|
|
import Baby from "./Baby";
|
|
|
|
|
|
export default class AdoptPannel extends cc.Component {
|
|
static shared = new AdoptPannel();
|
|
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_lingyang").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)
|
|
|
|
|
|
this.main.getChild("btnGetBoy").onClick(this.onClickGetBoy, this)
|
|
this.main.getChild("btnGetGirl").onClick(this.onClickGetGirl, this)
|
|
}
|
|
|
|
initEvent(){
|
|
|
|
}
|
|
|
|
onClickGetBoy(){
|
|
GameModel.send("c2s_adoptBaby", { sex: 1 });
|
|
}
|
|
|
|
onClickGetGirl(){
|
|
GameModel.send("c2s_adoptBaby", { sex: 0 });
|
|
}
|
|
} |