模拟主题数据
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user