多语言配置化

This commit is contained in:
2025-08-12 20:22:54 +08:00
parent 707946304e
commit dfa3179094
19 changed files with 3490 additions and 205 deletions
+17 -3
View File
@@ -16,6 +16,8 @@ import { NavigationManager } from "../../manager/NavigationManager";
import { GirlListItem } from "./GirlListItem";
import ConfigManager from "../../manager/ConfigManager";
import LanguageUtils from "../../../Main/Common/LanguageUtils";
import { ViewManager } from "../../../Main/Manager/ViewManager";
import { InnerMsgCode } from "../../../Main/Config/InnerMsgCode";
const { ccclass, property } = _decorator;
@@ -48,6 +50,7 @@ export class ThemePanel extends li_BaseView {
this.Show();
}
rectNameKey: string;
Show() {
//some temp data
this.coinNum.string = (50.0).toString();
@@ -68,10 +71,11 @@ export class ThemePanel extends li_BaseView {
this.cache.push(item);
this.content.addChild(newNode);
}
const rectInfo = cfgs[0];
this.recId = rectInfo.id;
this.recName.string = rectInfo.name;
this.rectNameKey = rectInfo.key;
//this.recName.string = LanguageUtils.getText(this.rectNameKey);
ResManager.I.changeBundleSpriteFrame(
this.recSprite,
rectInfo.path,
@@ -92,6 +96,10 @@ export class ThemePanel extends li_BaseView {
GButton.BandClick(this._nodeTab.msgBoxBtn, this.openMsgBox, this);
GButton.BandClick(this._nodeTab.ChatWithRecBtn, this.chatWithRec, this);
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
this.recName.string = LanguageUtils.getText(this.rectNameKey);
});
}
chatWithRec() {
@@ -99,10 +107,16 @@ export class ThemePanel extends li_BaseView {
}
openSetting() {
console.log("Setting");
ViewManager.I.openBundlesView("LanguagePanel");
}
openMsgBox() {
console.log("打开信箱");
}
onDestroy(): void {
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, () => {
this.recName.string = LanguageUtils.getText(this.rectNameKey);
});
}
}