模拟主题数据

This commit is contained in:
chen wei bo
2025-09-02 11:33:55 +08:00
parent 9396e70700
commit aacd18ee21
5 changed files with 69 additions and 29 deletions
+11 -7
View File
@@ -6,6 +6,8 @@ import { NavigationManager } from "../manager/NavigationManager";
import { TbThemes, Theme } from "../../schema/schema";
import LanguageUtils from "../../Main/Common/LanguageUtils";
import { InnerMsgCode } from "../../Main/Config/InnerMsgCode";
import { DataManager, DataId } from "../data/DataManager";
import { ThemeData } from "../data/ThemeData";
const { ccclass, property } = _decorator;
@ccclass("ThemeItem")
@@ -36,16 +38,18 @@ export class ThemeItem extends Component {
});
}
refresh(themeData: Theme) {
refresh(themeId: number) {
// 主题数据
const themeData = DataManager.I.getDataById<ThemeData>(DataId.Theme);
this.lockImg.node.active = this.lockCover.node.active =
!themeData.isRelease;
this.isLocked = !themeData.isRelease;
this.key = themeData.key;
this.titleName.string = LanguageUtils.getText(themeData.key);
this.category = themeData.category;
!themeData.getIsReleaseById(themeId);
this.isLocked = !themeData.getIsReleaseById(themeId);
this.key = themeData.getLanKeyById(themeId);
this.titleName.string = LanguageUtils.getText(themeData.getLanKeyById(themeId));
this.category = themeData.getCategoryById(themeId);
ResManager.I.changeBundleSpriteFrame(
this.img,
themeData.path,
themeData.getPathById(themeId),
"Chat18x",
() => {
let sizeTran = this.img.node.parent.getComponent(UITransform);