多语言模块
This commit is contained in:
@@ -4,6 +4,9 @@ import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import { DetailImageItem } from "./DetailImageItem";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import Utils from "../../../Main/Common/Utils";
|
||||
import { InnerMsgCode } from "../../../Main/Config/InnerMsgCode";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -47,6 +50,19 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
super.onLoadCT();
|
||||
this.imgItemInst.node.active = false;
|
||||
this.refresh(this.id);
|
||||
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = this.descName.string = LanguageUtils.getText(
|
||||
this.nameKey
|
||||
);
|
||||
let desc = "";
|
||||
const tags = LanguageUtils.getText(this.tagKey).split("|");
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (i != 0) desc += "\n";
|
||||
desc += tags[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
});
|
||||
}
|
||||
|
||||
setVideEnable(enable: boolean) {
|
||||
@@ -55,12 +71,16 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
this.avatarVideo.play();
|
||||
}
|
||||
}
|
||||
|
||||
nameKey: string;
|
||||
tagKey: string;
|
||||
refresh(index: number) {
|
||||
console.log(index);
|
||||
const dataDetail = ConfigManager.tables.TbGirlsDetail.get(this.id);
|
||||
const data = ConfigManager.tables.TbGirls.get(this.id);
|
||||
this.girlName.string = this.descName.string = data.name;
|
||||
this.nameKey = data.nameKey;
|
||||
this.girlName.string = this.descName.string = LanguageUtils.getText(
|
||||
data.nameKey
|
||||
);
|
||||
|
||||
if (dataDetail.pics[0].endsWith("video")) {
|
||||
ResManager.I.changeBundleVideo(
|
||||
@@ -86,9 +106,11 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
|
||||
this.desc.string = dataDetail.detailDesc;
|
||||
let desc = "";
|
||||
for (let i = 0; i < data.tag.length; i++) {
|
||||
this.tagKey = data.tagKey;
|
||||
const tags = LanguageUtils.getText(data.tagKey).split("|");
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (i != 0) desc += "\n";
|
||||
desc += data.tag[i];
|
||||
desc += tags[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
for (let i = 0; i < 5; i++) {
|
||||
|
||||
Reference in New Issue
Block a user