68 lines
2.0 KiB
Plaintext
68 lines
2.0 KiB
Plaintext
import { _decorator, Node, Sprite } from 'cc';
|
|
import { GButton } from '../../Main/Common/GButton';
|
|
import Utils from '../../Main/Common/Utils';
|
|
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
|
|
import li_BaseView from '../../Main/Common/li_BaseView';
|
|
import GameManager from '../../Main/Manager/GameManager';
|
|
import ResManager from '../../Main/Manager/ResManager';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
//关卡提示界面
|
|
@ccclass('Tips_UI')
|
|
export class Tips_UI extends li_BaseView {
|
|
|
|
private _nodeTab: any = {};
|
|
private _data;
|
|
|
|
//----重写父类接口---------------------------------------
|
|
onLoadCT() {
|
|
this.registerListenner();
|
|
Utils.parseNode(this.node, this._nodeTab)
|
|
|
|
}
|
|
openUIDataCT(data: any): void {
|
|
this._data = data
|
|
}
|
|
|
|
|
|
registerListenner() {
|
|
// Utils.addInnerEL(InnerMsgCode.GM_UI_Close, this, this.resiveGMClose)
|
|
}
|
|
|
|
|
|
start() {
|
|
GButton.BandClick(this._nodeTab.mask, ()=>{
|
|
this.doClose();
|
|
}, this, 0, null, null, false);
|
|
|
|
GButton.BandClick(this._nodeTab.btnClose, ()=>{
|
|
this.doClose();
|
|
}, this);
|
|
|
|
let lvCfg = GameManager.getLevelCfg(GameManager.CurLevelId)
|
|
//名字
|
|
Utils.setString(this._nodeTab.labName, lvCfg.name)
|
|
//职业名
|
|
Utils.setString(this._nodeTab.labJob, lvCfg.characterRole)
|
|
//喜欢话题
|
|
Utils.setString(this._nodeTab.labXihuan, lvCfg.characterFavoriteTopic)
|
|
//讨厌话题
|
|
Utils.setString(this._nodeTab.labTaoyan, lvCfg.characterHateTopic)
|
|
//性格
|
|
Utils.setString(this._nodeTab.labXingge, lvCfg.characterDisposition)
|
|
//提示文本
|
|
Utils.setString(this._nodeTab.labTips, lvCfg.tips)
|
|
//半身像
|
|
let halfPath = `halfPic/${lvCfg.characterHalfLengthPortrait}`
|
|
let half = this._nodeTab.half.getComponent(Sprite)
|
|
ResManager.I.changeBundleSpriteFrame(half, halfPath, "Raw")
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|