多语言模块
This commit is contained in:
@@ -4,6 +4,8 @@ import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import { TbThemes, Theme } from "../../../schema/schema";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import { InnerMsgCode } from "../../../Main/Config/InnerMsgCode";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("ThemeItem")
|
||||
@@ -19,11 +21,24 @@ export class ThemeItem extends Component {
|
||||
private category: number;
|
||||
|
||||
private isLocked: boolean;
|
||||
start() {}
|
||||
|
||||
key: string;
|
||||
protected onLoad(): void {
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.titleName.string = LanguageUtils.getText(this.key);
|
||||
});
|
||||
}
|
||||
protected onDestroy(): void {
|
||||
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.titleName.string = LanguageUtils.getText(this.key);
|
||||
});
|
||||
}
|
||||
|
||||
refresh(themeData: Theme) {
|
||||
this.lockImg.node.active = !themeData.isRelease;
|
||||
this.isLocked = !themeData.isRelease;
|
||||
this.titleName.string = themeData.name;
|
||||
this.key = themeData.key;
|
||||
this.titleName.string = LanguageUtils.getText(themeData.key);
|
||||
this.category = themeData.category;
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.img,
|
||||
|
||||
Reference in New Issue
Block a user