优化加载显示
This commit is contained in:
@@ -19,6 +19,9 @@ export class ThemeItem extends Component {
|
||||
@property(Label)
|
||||
titleName: Label;
|
||||
|
||||
@property(Node)
|
||||
loading: Node;
|
||||
|
||||
@property(Sprite)
|
||||
img: Sprite;
|
||||
|
||||
@@ -39,13 +42,16 @@ export class ThemeItem extends Component {
|
||||
}
|
||||
|
||||
refresh(themeId: number) {
|
||||
this.loading.active = true;
|
||||
// 主题数据
|
||||
const themeData = DataManager.I.getDataById<ThemeData>(DataId.Theme);
|
||||
this.lockImg.node.active = this.lockCover.node.active =
|
||||
!themeData.getIsReleaseById(themeId);
|
||||
this.isLocked = !themeData.getIsReleaseById(themeId);
|
||||
this.key = themeData.getLanKeyById(themeId);
|
||||
this.titleName.string = LanguageUtils.getText(themeData.getLanKeyById(themeId));
|
||||
this.titleName.string = LanguageUtils.getText(
|
||||
themeData.getLanKeyById(themeId)
|
||||
);
|
||||
this.category = themeData.getCategoryById(themeId);
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.img,
|
||||
@@ -54,6 +60,7 @@ export class ThemeItem extends Component {
|
||||
() => {
|
||||
let sizeTran = this.img.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize, this.img.node, 3);
|
||||
this.loading.active = false;
|
||||
}
|
||||
);
|
||||
GButton.RemoveAndBandClick(this.node, this.OnClickThis, this);
|
||||
|
||||
Reference in New Issue
Block a user