多语言模块
This commit is contained in:
@@ -22,6 +22,7 @@ import { ImagePopup } from "../components/ImagePopup";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import { VideoRoleType } from "db://assets/Scripts/Main/Common/GlobalValue";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("ChatPanel")
|
||||
@@ -46,6 +47,7 @@ export class ChatPanel extends li_BaseView {
|
||||
id: number;
|
||||
private _nodeTab: any = {};
|
||||
|
||||
nameKey: string;
|
||||
openUIDataCT(data) {
|
||||
this.id = data;
|
||||
// 设置当前聊天的角色ID
|
||||
@@ -64,13 +66,23 @@ export class ChatPanel extends li_BaseView {
|
||||
this,
|
||||
this.onDialogUpdate
|
||||
);
|
||||
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
});
|
||||
}
|
||||
onDestroy(): void {
|
||||
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
});
|
||||
}
|
||||
refresh(id: number) {
|
||||
this.id = id;
|
||||
const data = ConfigManager.tables.TbGirls.get(this.id);
|
||||
const dataDetail = ConfigManager.tables.TbGirlsDetail.get(this.id);
|
||||
if (!data) return;
|
||||
this.girlName.string = data.name;
|
||||
this.nameKey = data.nameKey;
|
||||
this.girlName.string = LanguageUtils.getText(data.nameKey);
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.girlImg,
|
||||
data.avatarPath,
|
||||
|
||||
Reference in New Issue
Block a user